1

Ubuntu 18.04

I have a simple ELF64 binary compiled from a C source file and linked with a shared object. I tried to examine it with objdump and got the following confusion:

$ objdump -d -j .plt bin

bin:     file format elf64-x86-64


Disassembly of section .plt:

00000000000006a0 <.plt>:
 6a0:   ff 35 62 09 20 00       pushq  0x200962(%rip)        # 201008 <_GLOBAL_OFFSET_TABLE_+0x8>
 6a6:   ff 25 64 09 20 00       jmpq   *0x200964(%rip)        # 201010 <_GLOBAL_OFFSET_TABLE_+0x10>
 6ac:   0f 1f 40 00             nopl   0x0(%rax)

00000000000006b0 <foo@plt>:
 6b0:   ff 25 62 09 20 00       jmpq   *0x200962(%rip)        # 201018 <foo>
 6b6:   68 00 00 00 00          pushq  $0x0
 6bb:   e9 e0 ff ff ff          jmpq   6a0 <.plt>

00000000000006c0 <dlopen@plt>:
 6c0:   ff 25 5a 09 20 00       jmpq   *0x20095a(%rip)        # 201020 <dlopen@GLIBC_2.2.5>
 6c6:   68 01 00 00 00          pushq  $0x1
 6cb:   e9 d0 ff ff ff          jmpq   6a0 <.plt>

00000000000006d0 <__printf_chk@plt>:
 6d0:   ff 25 52 09 20 00       jmpq   *0x200952(%rip)        # 201028 <__printf_chk@GLIBC_2.3.4>
 6d6:   68 02 00 00 00          pushq  $0x2
 6db:   e9 c0 ff ff ff          jmpq   6a0 <.plt>

But when just printing symbols from a plt section I got no output:

$ objdump -t -j .plt bin

bin:     file format elf64-x86-64

SYMBOL TABLE:
00000000000006a0 l    d  .plt   0000000000000000              .plt

Why was not the symbols from the plt section printed when objdump -t as they were when disassembling?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.