0

I've both libc6 and libc6-dbg packages installed. What I want to do is to display the disassembly of ld.so with source interleaved. I also have the glibc source placed in a chroot, reachable at the exact location as displayed by DW_AT_comp_dir in debug symbols.

Could someone tell me--if it's possible--how to output the source-interleaved disassembly of ld.so library please? I know I could use objdump -S, but how would I point it to the separate debug symbol file available?

Jeenu
  • 2,109
  • 2
  • 20
  • 27

1 Answers1

0

The best match I could find was to use GDB:

  • gdb /the/original/library
  • Use add-symbol-file command to locate the add the symbol file that was installed as part of -dbg package (use dpkg -L the-package-name-dbg to find all files installed as part of the package). This command would also need an address to load the symbols from. This address can be found out from readelf -a /the/original/library, and is most likely the load address of the text segment
  • Install package source with apt-get source the-package-name. This will download the source in the current working directory
  • Use dir command in GDB to locate the source downloaded above
  • Now use disas/m function_name so that GDB will display a the disassembly, ordered by source lines
Jeenu
  • 2,109
  • 2
  • 20
  • 27