[PATCH] D35351: [llvm-readobj] - Teach readobj to print DT_FILTER dynamic tag in human readable form.
George Rimar via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 13 04:50:44 PDT 2017
grimar created this revision.
Nothing special here, except that I desided that DT_FILTER
output formatting should be probably consistent with output of DT_NEEDED and DT_SONAME.
So I had to change DT_AUXILARY as well, because DT_FILTER and DT_AUXILARY are
very close (https://docs.oracle.com/cd/E19683-01/817-3677/chapter4-31738/index.html).
I am using it in LLD patch which will be posted soon.
https://reviews.llvm.org/D35351
Files:
test/tools/llvm-readobj/Inputs/dynamic-table-so.x86
test/tools/llvm-readobj/Inputs/dynamic-table.c
test/tools/llvm-readobj/dynamic.test
tools/llvm-readobj/ELFDumper.cpp
Index: tools/llvm-readobj/ELFDumper.cpp
===================================================================
--- tools/llvm-readobj/ELFDumper.cpp
+++ tools/llvm-readobj/ELFDumper.cpp
@@ -1532,6 +1532,7 @@
LLVM_READOBJ_TYPE_CASE(TLSDESC_PLT);
LLVM_READOBJ_TYPE_CASE(TLSDESC_GOT);
LLVM_READOBJ_TYPE_CASE(AUXILIARY);
+ LLVM_READOBJ_TYPE_CASE(FILTER);
default: return "unknown";
}
}
@@ -1693,7 +1694,10 @@
OS << "LibrarySoname (" << getDynamicString(Value) << ")";
break;
case DT_AUXILIARY:
- OS << "Auxiliary library: [" << getDynamicString(Value) << "]";
+ OS << "AuxiliaryLibrary (" << getDynamicString(Value) << ")";
+ break;
+ case DT_FILTER:
+ OS << "FilterLibrary (" << getDynamicString(Value) << ")";
break;
case DT_RPATH:
case DT_RUNPATH:
Index: test/tools/llvm-readobj/dynamic.test
===================================================================
--- test/tools/llvm-readobj/dynamic.test
+++ test/tools/llvm-readobj/dynamic.test
@@ -119,32 +119,33 @@
ELF-X86-SO: Arch: x86_64
ELF-X86-SO: AddressSize: 64bit
ELF-X86-SO: LoadName:
-ELF-X86-SO: DynamicSection [ (26 entries)
+ELF-X86-SO: DynamicSection [ ({{[0-9]+}} 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: 0x000000007FFFFFFF FILTER FilterLibrary (filter.so)
+ELF-X86-SO: 0x000000007FFFFFFD AUXILIARY AuxiliaryLibrary (aux.so)
+ELF-X86-SO: 0x000000000000000C INIT 0x{{[0-9A-F]+}}
+ELF-X86-SO: 0x000000000000000D FINI 0x{{[0-9A-F]+}}
+ELF-X86-SO: 0x0000000000000019 INIT_ARRAY 0x{{[0-9A-F]+}}
ELF-X86-SO: 0x000000000000001B INIT_ARRAYSZ 8 (bytes)
-ELF-X86-SO: 0x000000000000001A FINI_ARRAY 0x200DD8
+ELF-X86-SO: 0x000000000000001A FINI_ARRAY 0x{{[0-9A-F]+}}
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: 0x000000000000000A STRSZ {{[0-9]+}} (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: 0x0000000000000017 JMPREL 0x{{[0-9A-F]+}}
+ELF-X86-SO: 0x0000000000000007 RELA 0x{{[0-9A-F]+}}
ELF-X86-SO: 0x0000000000000008 RELASZ 240 (bytes)
ELF-X86-SO: 0x0000000000000009 RELAENT 24 (bytes)
-ELF-X86-SO: 0x000000006FFFFFFE VERNEED 0x4B0
+ELF-X86-SO: 0x000000006FFFFFFE VERNEED 0x{{[0-9A-F]+}}
ELF-X86-SO: 0x000000006FFFFFFF VERNEEDNUM 2
-ELF-X86-SO: 0x000000006FFFFFF0 VERSYM 0x488
+ELF-X86-SO: 0x000000006FFFFFF0 VERSYM 0x{{[0-9A-F]+}}
ELF-X86-SO: 0x000000006FFFFFF9 RELACOUNT 3
ELF-X86-SO: 0x0000000000000000 NULL 0x0
Index: test/tools/llvm-readobj/Inputs/dynamic-table.c
===================================================================
--- test/tools/llvm-readobj/Inputs/dynamic-table.c
+++ test/tools/llvm-readobj/Inputs/dynamic-table.c
@@ -1,10 +1,10 @@
// clang -target x86_64-linux-gnu -shared -fPIC -lc dynamic-table.c \
-// -o dynamic-table-so.x86 -Wl,-f,aux_val
+// -o dynamic-table-so.x86 -Wl,-f,aux.so -Wl,-F,filter.so
// 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 \
// -o dynamic-table-exe.mips
-// clang -target aarch64-linux-gnu -fPIC -shared dynamic-table.c \
+// clang -target aarch64-linux-gnu -fPIC -shared dynamic-table.c\
// -o dynamic-table-so.aarch64
int puts(const char *);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D35351.106409.patch
Type: text/x-patch
Size: 4581 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170713/0514b018/attachment.bin>
More information about the llvm-commits
mailing list