Skip to contentSkip to conversation

ELF binarry

DISCUSSION ssams sudin 3 participants 3 messages Oct 14, 2003 – Oct 15, 2003

lore
Share & tools
lore
#0 lore raw

with GDB or another debugger, can we look at highest memory address of ELF binarry. if yes what is the command ?
where can i found some reference about it?

forgive me if this subject out of topic or just repeating last post regard
ssams

Signature · 6 lines
______________________________________________
Check out the latest SMS services @ http://www.linuxmail.org 
This allows you to send and receive SMS through your mailbox.


Powered by Outblaze
#1 lore raw
Quoted 3 lines

with GDB or another debugger, can we look at highest memory address of ELF binarry. if yes what is the command ? where can i found some reference about it?

No, there is no gdb command for finding that.

For a typical ELF binary under Linux, the highest valid memory address will be the space just above the top of the stack, 0xBFFFFFFF. This space is used to stash the argv and envp array. The stack starts just before that and grows downward. The actual program and other read-only sections will be loaded at 0x08048000, followed by the read-write sections and then the heap. Shared-object libraries tend to be loaded from 0x40000000 on up.

None of this is written in stone, of course. But the vast majority of Linux ELF binaries are laid out in this way.

Do be aware that just because 0xBFFFFFFF is valid doesn't mean that every memory address less than that will be valid. In fact, most of them won't be.

b

#2 lore raw
In reply to ssams sudin
Quoted 9 lines · ssams sudin

with GDB or another debugger, can we look at highest memory address of ELF binarry. if yes what is the command ?
where can i found some reference about it?

forgive me if this subject out of topic or just repeating last post regard
ssams

You may find usefull to see all infos about your elf with the 'readelf' tool.

$ readelf -a /bin/dd
will display a lot of interesting thing about where is what (but it is oriented to shared libraries though...)

It is usefull to see the basic organisation of a program, before starting debug it.

Fred