llvm.org GIT mirror llvm / fe9ce42
Add support for DT_VERxxx and DT_MIPS_xxx .dynamic section entries to the llvm-readobj. The patch reviewed by Michael Spencer. http://llvm-reviews.chandlerc.com/D2113 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194421 91177308-0d34-0410-b5e6-96231b3b80d8 Simon Atanasyan 6 years ago
4 changed file(s) with 62 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 // clang -target mipsel-linux-gnu -shared -fPIC -lc dynamic-table.c \
1 // -o dynamic-table.mips
2 int puts(const char *);
3
4 void foo(void) {
5 puts("Hello, World");
6 }
0 RUN: llvm-readobj -dynamic-table %p/Inputs/dynamic-table.mips \
1 RUN: | FileCheck %s -check-prefix ELF-MIPS
2
3 ELF-MIPS: Format: ELF32-mips
4 ELF-MIPS: Arch: mipsel
5 ELF-MIPS: AddressSize: 32bit
6 ELF-MIPS: LoadName:
7 ELF-MIPS: DynamicSection [ (23 entries)
8 ELF-MIPS: Tag Type Name/Value
9 ELF-MIPS: 0x00000001 NEEDED SharedLibrary (libc.so.6)
10 ELF-MIPS: 0x0000000C INIT 0x528
11 ELF-MIPS: 0x0000000D FINI 0x860
12 ELF-MIPS: 0x00000004 HASH 0x210
13 ELF-MIPS: 0x00000005 STRTAB 0x3D8
14 ELF-MIPS: 0x00000006 SYMTAB 0x2A8
15 ELF-MIPS: 0x0000000A STRSZ 231 (bytes)
16 ELF-MIPS: 0x0000000B SYMENT 16 (bytes)
17 ELF-MIPS: 0x00000003 PLTGOT 0x108E0
18 ELF-MIPS: 0x00000011 REL 0x518
19 ELF-MIPS: 0x00000012 RELSZ 16 (bytes)
20 ELF-MIPS: 0x00000013 RELENT 8 (bytes)
21 ELF-MIPS: 0x70000001 MIPS_RLD_VERSION 1
22 ELF-MIPS: 0x70000005 MIPS_FLAGS 0x2
23 ELF-MIPS: 0x70000006 MIPS_BASE_ADDRESS 0x0
24 ELF-MIPS: 0x7000000A MIPS_LOCAL_GOTNO 10
25 ELF-MIPS: 0x70000011 MIPS_SYMTABNO 19
26 ELF-MIPS: 0x70000012 MIPS_UNREFEXTNO 26
27 ELF-MIPS: 0x70000013 MIPS_GOTSYM 0xD
28 ELF-MIPS: 0x6FFFFFFE VERNEED 0x4E8
29 ELF-MIPS: 0x6FFFFFFF VERNEEDNUM 1
30 ELF-MIPS: 0x6FFFFFF0 VERSYM 0x4C0
31 ELF-MIPS: 0x00000000 NULL 0x0
32 ELF-MIPS: ]
682682 LLVM_READOBJ_TYPE_CASE(SYMENT);
683683 LLVM_READOBJ_TYPE_CASE(SYMTAB);
684684 LLVM_READOBJ_TYPE_CASE(TEXTREL);
685 LLVM_READOBJ_TYPE_CASE(VERNEED);
686 LLVM_READOBJ_TYPE_CASE(VERNEEDNUM);
687 LLVM_READOBJ_TYPE_CASE(VERSYM);
688 LLVM_READOBJ_TYPE_CASE(MIPS_RLD_VERSION);
689 LLVM_READOBJ_TYPE_CASE(MIPS_FLAGS);
690 LLVM_READOBJ_TYPE_CASE(MIPS_BASE_ADDRESS);
691 LLVM_READOBJ_TYPE_CASE(MIPS_LOCAL_GOTNO);
692 LLVM_READOBJ_TYPE_CASE(MIPS_SYMTABNO);
693 LLVM_READOBJ_TYPE_CASE(MIPS_UNREFEXTNO);
694 LLVM_READOBJ_TYPE_CASE(MIPS_GOTSYM);
685695 default: return "unknown";
686696 }
687697 }
714724 case DT_FINI_ARRAY:
715725 case DT_PREINIT_ARRAY:
716726 case DT_DEBUG:
727 case DT_VERNEED:
728 case DT_VERSYM:
717729 case DT_NULL:
730 case DT_MIPS_FLAGS:
731 case DT_MIPS_BASE_ADDRESS:
732 case DT_MIPS_GOTSYM:
718733 OS << format("0x%" PRIX64, Value);
734 break;
735 case DT_VERNEEDNUM:
736 case DT_MIPS_RLD_VERSION:
737 case DT_MIPS_LOCAL_GOTNO:
738 case DT_MIPS_SYMTABNO:
739 case DT_MIPS_UNREFEXTNO:
740 OS << Value;
719741 break;
720742 case DT_PLTRELSZ:
721743 case DT_RELASZ: