[llvm] r280471 - [llvm-readobj] - Teach readobj to print DT_AUXILIARY dynamic tag in human readable form.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 2 00:35:20 PDT 2016


Author: grimar
Date: Fri Sep  2 02:35:19 2016
New Revision: 280471

URL: http://llvm.org/viewvc/llvm-project?rev=280471&view=rev
Log:
[llvm-readobj] - Teach readobj to print DT_AUXILIARY dynamic tag in human readable form.

Previously DT_AUXILIARY was unknown, patch fixes that.

Differential revision: https://reviews.llvm.org/D24138

Added:
    llvm/trunk/test/tools/llvm-readobj/Inputs/dynamic-table-so.x86   (with props)
Modified:
    llvm/trunk/test/tools/llvm-readobj/Inputs/dynamic-table.c
    llvm/trunk/test/tools/llvm-readobj/dynamic.test
    llvm/trunk/tools/llvm-readobj/ELFDumper.cpp

Added: llvm/trunk/test/tools/llvm-readobj/Inputs/dynamic-table-so.x86
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-readobj/Inputs/dynamic-table-so.x86?rev=280471&view=auto
==============================================================================
Binary file - no diff available.

Propchange: llvm/trunk/test/tools/llvm-readobj/Inputs/dynamic-table-so.x86
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Modified: llvm/trunk/test/tools/llvm-readobj/Inputs/dynamic-table.c
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-readobj/Inputs/dynamic-table.c?rev=280471&r1=280470&r2=280471&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-readobj/Inputs/dynamic-table.c (original)
+++ llvm/trunk/test/tools/llvm-readobj/Inputs/dynamic-table.c Fri Sep  2 02:35:19 2016
@@ -1,3 +1,5 @@
+// clang -target x86_64-linux-gnu -shared -fPIC -lc dynamic-table.c \
+//       -o dynamic-table-so.x86 -Wl,-f,aux_val
 // clang -target mipsel-linux-gnu -shared -fPIC -lc dynamic-table.c \
 //       -o dynamic-table-so.mips
 // clang -target mipsel-linux-gnu -lc dynamic-table.c \

Modified: llvm/trunk/test/tools/llvm-readobj/dynamic.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-readobj/dynamic.test?rev=280471&r1=280470&r2=280471&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-readobj/dynamic.test (original)
+++ llvm/trunk/test/tools/llvm-readobj/dynamic.test Fri Sep  2 02:35:19 2016
@@ -112,6 +112,42 @@ ELF-X86-EXE:   0x6FFFFFFA RELCOUNT
 ELF-X86-EXE:   0x00000000 NULL                 0x0
 ELF-X86-EXE: ]
 
+RUN: llvm-readobj -dynamic-table %p/Inputs/dynamic-table-so.x86 \
+RUN:     | FileCheck %s -check-prefix ELF-X86-SO
+
+ELF-X86-SO: Format: ELF64-x86-64
+ELF-X86-SO: Arch: x86_64
+ELF-X86-SO: AddressSize: 64bit
+ELF-X86-SO: LoadName: 
+ELF-X86-SO: DynamicSection [ (26 entries)
+ELF-X86-SO:   Tag                Type                 Name/Value
+ELF-X86-SO:   0x0000000000000001 NEEDED               SharedLibrary (libc.so.6)
+ELF-X86-SO:   0x0000000000000001 NEEDED               SharedLibrary (ld-linux-x86-64.so.2)
+ELF-X86-SO:   0x000000007FFFFFFD AUXILIARY            Auxiliary library: [aux_val]
+ELF-X86-SO:   0x000000000000000C INIT                 0x610
+ELF-X86-SO:   0x000000000000000D FINI                 0x7AC
+ELF-X86-SO:   0x0000000000000019 INIT_ARRAY           0x200DD0
+ELF-X86-SO:   0x000000000000001B INIT_ARRAYSZ         8 (bytes)
+ELF-X86-SO:   0x000000000000001A FINI_ARRAY           0x200DD8
+ELF-X86-SO:   0x000000000000001C FINI_ARRAYSZ         8 (bytes)
+ELF-X86-SO:   0x000000006FFFFEF5 GNU_HASH             0x1C8
+ELF-X86-SO:   0x0000000000000005 STRTAB               0x3A0
+ELF-X86-SO:   0x0000000000000006 SYMTAB               0x208
+ELF-X86-SO:   0x000000000000000A STRSZ                231 (bytes)
+ELF-X86-SO:   0x000000000000000B SYMENT               24 (bytes)
+ELF-X86-SO:   0x0000000000000003 PLTGOT               0x201000
+ELF-X86-SO:   0x0000000000000002 PLTRELSZ             48 (bytes)
+ELF-X86-SO:   0x0000000000000014 PLTREL               RELA
+ELF-X86-SO:   0x0000000000000017 JMPREL               0x5E0
+ELF-X86-SO:   0x0000000000000007 RELA                 0x4F0
+ELF-X86-SO:   0x0000000000000008 RELASZ               240 (bytes)
+ELF-X86-SO:   0x0000000000000009 RELAENT              24 (bytes)
+ELF-X86-SO:   0x000000006FFFFFFE VERNEED              0x4B0
+ELF-X86-SO:   0x000000006FFFFFFF VERNEEDNUM           2
+ELF-X86-SO:   0x000000006FFFFFF0 VERSYM               0x488
+ELF-X86-SO:   0x000000006FFFFFF9 RELACOUNT            3
+ELF-X86-SO:   0x0000000000000000 NULL                 0x0
+
 RUN: llvm-readobj -dynamic-table %p/Inputs/dynamic-table-so.aarch64 \
 RUN:     | FileCheck %s -check-prefix ELF-AARCH64-SO
 

Modified: llvm/trunk/tools/llvm-readobj/ELFDumper.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-readobj/ELFDumper.cpp?rev=280471&r1=280470&r2=280471&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-readobj/ELFDumper.cpp (original)
+++ llvm/trunk/tools/llvm-readobj/ELFDumper.cpp Fri Sep  2 02:35:19 2016
@@ -1561,6 +1561,7 @@ static const char *getTypeString(uint64_
   LLVM_READOBJ_TYPE_CASE(MIPS_RLD_MAP);
   LLVM_READOBJ_TYPE_CASE(MIPS_PLTGOT);
   LLVM_READOBJ_TYPE_CASE(MIPS_OPTIONS);
+  LLVM_READOBJ_TYPE_CASE(AUXILIARY);
   default: return "unknown";
   }
 }
@@ -1721,6 +1722,9 @@ void ELFDumper<ELFT>::printValue(uint64_
   case DT_SONAME:
     OS << "LibrarySoname (" << getDynamicString(Value) << ")";
     break;
+  case DT_AUXILIARY:
+    OS << "Auxiliary library: [" << getDynamicString(Value) << "]";
+    break;
   case DT_RPATH:
   case DT_RUNPATH:
     OS << getDynamicString(Value);




More information about the llvm-commits mailing list