This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Finding the start and end of memory areas
- From: Shaun Jackman <sjackman at gmail dot com>
- To: binutils at sources dot redhat dot com
- Date: Wed, 22 Dec 2004 16:21:45 -0800
- Subject: Finding the start and end of memory areas
- Reply-to: Shaun Jackman <sjackman at gmail dot com>
First off, this posting is somewhat off-topic. My apologies in
advance. If anyone knows of a better forum for this topic, I'd
appreciate being pointed in the right direction. Now, on to my
question...
I'd like to find the start and end of the following memory areas
during run-time...
text
data
bss - &__bss_start to &__bss_end
heap - &__bss_end to sbrk(0)
(gap)
stack - stack pointer to ?
Presumably, they appear in that order in memory, so then end of one
should be the start of the next. Note that I'm doing this at run-time
by the program itself (introspection, as it were) and not with tools
like readelf and objdump. I've filled in the few values I know. If you
can provide any others I'd appreciate it.
If it affects the results, the target architectures are
i686-pc-linux-gnu and arm-elf.
Many thanks!
Shaun