How Can I Get See A Memory Map For An Executable
Ian Lance Taylor
ian@airs.com
Mon Nov 14 21:57:00 GMT 2005
Steven Woody <narkewoody@gmail.com> writes:
> i want to check in my C++ program, what variable is allocated in where. is
> there such a tool?
I don't know if it will much, but the GNU linker supports a -Map
option. See the documentation. You can also use nm or objdump -t or
readelf -s to see where symbols are in the fully linked executable.
> another relative question is, where the 'new' operator get memory from? the
> global heap? does it same with what 'malloc' get from?
In general, the answers are yes and yes.
Ian
More information about the Gcc-help
mailing list