Is it possible to determine the total amount of memory dedicated to static and global variables from the binary? I'm looking for a Linux utility that reads an elf file and figures out how much memory is pre-allocated for variables.
The size
utility will report that, under "data".
> size ./my_program
Yes. Use...
objdump -h progfile
which will list the "headers". Find the .data
header and check the size column.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With