HomePhabricator

[llvm-objdump] Teach `llvm-objdump` dump dynamic symbols.

Authored by Higuoxing on Apr 4 2020, 6:58 PM.

Description

[llvm-objdump] Teach llvm-objdump dump dynamic symbols.

Summary:
This patch is to teach llvm-objdump dump dynamic symbols (-T and --dynamic-syms). Currently, this patch is not fully compatible with gnu-objdump, but I would like to continue working on this in next few patches. It has two issues.

  1. Some symbols shouldn't be marked as global(g). (-t/--syms has same issue as well) (Fixed by D75659)
  2. gnu-objdump can dump version information and *dynamically* insert before symbol name field.

objdump -T a.out gives:

DYNAMIC SYMBOL TABLE:
0000000000000000  w   D  *UND*  0000000000000000              _ITM_deregisterTMCloneTable
0000000000000000      DF *UND*  0000000000000000  GLIBC_2.2.5 printf
0000000000000000      DF *UND*  0000000000000000  GLIBC_2.2.5 __libc_start_main
0000000000000000  w   D  *UND*  0000000000000000              __gmon_start__
0000000000000000  w   D  *UND*  0000000000000000              _ITM_registerTMCloneTable
0000000000000000  w   DF *UND*  0000000000000000  GLIBC_2.2.5 __cxa_finalize

llvm-objdump -T a.out gives:

DYNAMIC SYMBOL TABLE:
0000000000000000  w   D  *UND*  0000000000000000 _ITM_deregisterTMCloneTable
0000000000000000 g    DF *UND*  0000000000000000 printf
0000000000000000 g    DF *UND*  0000000000000000 __libc_start_main
0000000000000000  w   D  *UND*  0000000000000000 __gmon_start__
0000000000000000  w   D  *UND*  0000000000000000 _ITM_registerTMCloneTable
0000000000000000  w   DF *UND*  0000000000000000 __cxa_finalize

Reviewers: jhenderson, grimar, MaskRay, espindola

Reviewed By: jhenderson, grimar

Subscribers: emaste, rupprecht, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D75756

Details

Committed
HiguoxingApr 4 2020, 7:46 PM
Reviewer
jhenderson
Differential Revision
D75756: [llvm-objdump] Teach `llvm-objdump` dump dynamic symbols.
Parents
rG5aacce3db2e3: [mlir] NFC: Fix trivial typo
Branches
Unknown
Tags
Unknown