the experiment is on Linux, x86 32-bit. So suppose in my assembly program, I need to periodically (for instance every time after executing 100000 basic blocks) dump an array in .bss section from memory to the disk.  The starting address and size of the array is fixed. The array records the executed basic block's address, the size is 16M right now.I tried to write some native code, to memcpy from .bss section to the stack,  and then write it back to disk. But it seems to me that it is very tedious and I am worried about the performance and memory consumption, say, every-time allocate a very large memory on the stack...So here is my question, how can I dump the memory from global data sections in an efficient way? Am I clear enough? 
Dump global datas to disk in assembly code
assembly;binary analysis;linux;c;memory dump