views:

294

answers:

1

I've been using objdump to look at assembly code in Linux ELF binaries. Sometimes there is an indirect jump through a jump table that is stored in the rodata (read-only data) section. I have tried Google and SO, but I must be wearing my stupid hat, because I cannot figure out how to get objdump or any other tool to show me the contents of this data section. Short of executing the program and examining the relevant addresses in the debugger, which I don't want to do because it has to be done interactively, how can I display the contents of the read-only data section?

The ideal answer will identify a tool that will not only show me the contents but will let me control the display format, much as od does.

+3  A: 
objdump -s -j .rodata exefile

should give you a side-by-side hex/printable ASCII dump of the contents of the rodata section. It doesn't look like there's anything in there to control formatting, but it's a start. You could always undump the hex and feed it to od, I suppose :)

hobbs
Brilliant! I tried this but I didn't think to include the bloody dot...
Norman Ramsey