[all-commits] [llvm/llvm-project] 948ef5: [llvm-objdump] Teach `llvm-objdump` dump dynamic s...
Xing GUO via All-commits
all-commits at lists.llvm.org
Sat Apr 4 19:44:44 PDT 2020
Branch: refs/heads/master
Home: https://github.com/llvm/llvm-project
Commit: 948ef5b1a60459220aa1a4fa0c7483780deebb4e
https://github.com/llvm/llvm-project/commit/948ef5b1a60459220aa1a4fa0c7483780deebb4e
Author: vgxbj <higuoxing at gmail.com>
Date: 2020-04-05 (Sun, 05 Apr 2020)
Changed paths:
M llvm/docs/CommandGuide/llvm-objdump.rst
A llvm/test/tools/llvm-objdump/X86/elf-dynamic-symbols.test
A llvm/test/tools/llvm-objdump/unimplemented-features.test
M llvm/tools/llvm-objdump/llvm-objdump.cpp
M llvm/tools/llvm-objdump/llvm-objdump.h
Log Message:
-----------
[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
More information about the All-commits
mailing list