2 ms·
Really great article and blog. > You can examine binary images using the nm and objdump commands to display symbols, their addresses, segments, and so on. You
by haberman 10y ago
Really great article and blog.
> You can examine binary images using the nm and objdump commands to display symbols, their addresses, segments, and so on.
You can also use my new tool Bloaty McBloatface (https://github.com/google/bloaty https://github.com/google/bloaty). Check out the -v option especially, which will dump a memory map of both the file domain and the VM address domain:
$ ./bloaty `which ls` -v -d segments
FILE MAP:
[0, 19d44] LOAD [RX], LOAD [RX]
[19d44, 19df0] [None], [Unmapped]
[19df0, 1a5f4] LOAD [RW], LOAD [RW]
[1a5f4, 1a700] [None], [Unmapped]
[1a700, 1ae00] [None], [ELF Headers]
VM MAP:
[0, 400000] NO ENTRY
[400000, 419d44] LOAD [RX], LOAD [RX]
[419d44, 619df0] NO ENTRY
[619df0, 61a5f4] LOAD [RW], LOAD [RW]
[61a5f4, 61b360] LOAD [RW], LOAD [RW]
VM SIZE FILE SIZE
-------------- --------------
95.1% 103Ki LOAD [RX] 103Ki 96.1%
4.9% 5.36Ki LOAD [RW] 2.00Ki 1.9%
0.0% 0 [ELF Headers] 1.75Ki 1.6%
0.0% 0 [Unmapped] 440 0.4%
100.0% 108Ki TOTAL 107Ki 100.0%
If you leave off "-d segments" the map will include all sections too (like .bss, .text, etc). Here is an example of that output: http://pastebin.com/3XGcqA8k http://pastebin.com/3XGcqA8k