1

I have a hex offset, say 0xcccddd. Using gdb info symbol 0xcccddd I can get the symbol name, e.g. fn() in section_name.

How can I do this using the readelf or objdump command, or any other commands without running gdb?


EDIT: After using the below command

objdump -d --start-address 0xcccddd --stop-address 0xcccdde filename.axf

I am getting

filename.axf:     file format elf32-little
objdump: can't disassemble for architecture UNKNOWN!
janw
  • 8,758
  • 11
  • 40
  • 62
user00011
  • 103
  • 1
  • 15

1 Answers1

5

Use this:

objdump -d --start-address 0xcccddd --stop-address 0xcccdde

I am getting objdump: can't disassemble for architecture UNKNOWN!

It looks like you are cross-compiling for ARM using RealView compiler. You need to use objdump from the same NDK the compiler came from (instead of using host-native objdump).

Employed Russian
  • 199,314
  • 34
  • 295
  • 362
  • If i use this I am getting filename.elf file format elf32-i386.Is there any other steps i need to do after that – user00011 Oct 17 '18 at 07:42
  • @Prakrithi If that's *all* you get, then `objdump` didn't recognize the section your `0xcccddd` address is in. In that case, I wouldn't expect GDB `info symbol 0xcccddd` to produce anything useful either. Please edit your question to show *actual* commands you give GDB and `objdump`, and their output. – Employed Russian Oct 17 '18 at 14:32
  • I am getting objdump: can't disassemble for architecture UNKNOWN! below filename.elf and file format.Missed that in that comment. Can you pls help . I am using .axf file – user00011 Oct 19 '18 at 11:10