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.
- Some symbols shouldn't be marked as global(g). (-t/--syms has same issue as well) (Fixed by D75659)
- gnu-objdump can dump version information and *dynamically* insert before symbol name field. (I haven't been able to figure out how it works)
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
Lexicographically, 'T' is before 't', so this should probably be before the -t option.