Given a literal address, how can I determine which section that address falls in? Here is an example. From a disassembly of a program, made with ‘objdump’, I obtain a literal address 0x8048520:
80483ea: c7 45 f4 20 85 04 08 movl $0x8048520,-0xc(%ebp)
…
On my platform (Linux 2.6.39, Gentoo) I can obtain a listing of sections simply by running ‘less’ on the ELF file, and see that this address falls within the .rodata section:
[15] .rodata PROGBITS 08048518 000518 000016 00 A 0 0 4
...
However, I’m looking for a convenient way to do the same thing that does not require visually scanning through and comparing addresses. Suggestions?
Using your example address of 0x8048520:
In your example, the output of this command would be: