[llvm] r257912 - [llvm-readobj] Add support for TLSDESC_PLT and TLSDESC_GOT dynamic section tags to the llvm-readobj.
George Rimar via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 15 10:13:59 PST 2016
Author: grimar
Date: Fri Jan 15 12:13:59 2016
New Revision: 257912
URL: http://llvm.org/viewvc/llvm-project?rev=257912&view=rev
Log:
[llvm-readobj] Add support for TLSDESC_PLT and TLSDESC_GOT dynamic section tags to the llvm-readobj.
If module uses uses lazy TLSDESC relocations it should define DT_TLSDESC_PLT and DT_TLSDESC_GOT entries.
They were unknown for llvm-readobj before this patch.
Differential revision: http://reviews.llvm.org/D16224
Added:
llvm/trunk/test/tools/llvm-readobj/Inputs/dynamic-table-so.aarch64 (with props)
Modified:
llvm/trunk/test/tools/llvm-readobj/Inputs/dynamic-table.c
llvm/trunk/test/tools/llvm-readobj/dynamic.test
Added: llvm/trunk/test/tools/llvm-readobj/Inputs/dynamic-table-so.aarch64
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-readobj/Inputs/dynamic-table-so.aarch64?rev=257912&view=auto
==============================================================================
Binary file - no diff available.
Propchange: llvm/trunk/test/tools/llvm-readobj/Inputs/dynamic-table-so.aarch64
------------------------------------------------------------------------------
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=257912&r1=257911&r2=257912&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-readobj/Inputs/dynamic-table.c (original)
+++ llvm/trunk/test/tools/llvm-readobj/Inputs/dynamic-table.c Fri Jan 15 12:13:59 2016
@@ -1,9 +1,14 @@
// 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
-int puts(const char *);
-
-int main(void) {
- puts("Hello, World");
-}
+// -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 \
+// -o dynamic-table-so.aarch64
+int puts(const char *);
+
+__thread int foo;
+
+int main(void) {
+ puts("Hello, World");
+ foo = 0;
+}
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=257912&r1=257911&r2=257912&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-readobj/dynamic.test (original)
+++ llvm/trunk/test/tools/llvm-readobj/dynamic.test Fri Jan 15 12:13:59 2016
@@ -108,6 +108,43 @@ ELF-X86-EXE: 0x0000001E FLAGS
ELF-X86-EXE: 0x6FFFFFFE VERNEED 0x4E4
ELF-X86-EXE: 0x6FFFFFFF VERNEEDNUM 3
ELF-X86-EXE: 0x6FFFFFF0 VERSYM 0x4C0
-ELF-X86-EXE: 0x6FFFFFFA RELCOUNT 6
-ELF-X86-EXE: 0x00000000 NULL 0x0
-ELF-X86-EXE: ]
+ELF-X86-EXE: 0x6FFFFFFA RELCOUNT 6
+ELF-X86-EXE: 0x00000000 NULL 0x0
+ELF-X86-EXE: ]
+
+RUN: llvm-readobj -dynamic-table %p/Inputs/dynamic-table-so.aarch64 \
+RUN: | FileCheck %s -check-prefix ELF-AARCH64-SO
+
+ELF-AARCH64-SO: Format: ELF64-aarch64-little
+ELF-AARCH64-SO: Arch: aarch64
+ELF-AARCH64-SO: AddressSize: 64bit
+ELF-AARCH64-SO: LoadName:
+ELF-AARCH64-SO: DynamicSection [ (26 entries)
+ELF-AARCH64-SO: Tag Type Name/Value
+ELF-AARCH64-SO: 0x0000000000000001 NEEDED SharedLibrary (libc.so.6)
+ELF-AARCH64-SO: 0x000000000000000C INIT 0x660
+ELF-AARCH64-SO: 0x000000000000000D FINI 0x83C
+ELF-AARCH64-SO: 0x0000000000000019 INIT_ARRAY 0x10DB8
+ELF-AARCH64-SO: 0x000000000000001B INIT_ARRAYSZ 8 (bytes)
+ELF-AARCH64-SO: 0x000000000000001A FINI_ARRAY 0x10DC0
+ELF-AARCH64-SO: 0x000000000000001C FINI_ARRAYSZ 8 (bytes)
+ELF-AARCH64-SO: 0x000000006FFFFEF5 GNU_HASH 0x1F0
+ELF-AARCH64-SO: 0x0000000000000005 STRTAB 0x420
+ELF-AARCH64-SO: 0x0000000000000006 SYMTAB 0x240
+ELF-AARCH64-SO: 0x000000000000000A STRSZ 210 (bytes)
+ELF-AARCH64-SO: 0x000000000000000B SYMENT 24 (bytes)
+ELF-AARCH64-SO: 0x0000000000000003 PLTGOT 0x10FE8
+ELF-AARCH64-SO: 0x0000000000000002 PLTRELSZ 96 (bytes)
+ELF-AARCH64-SO: 0x0000000000000014 PLTREL RELA
+ELF-AARCH64-SO: 0x0000000000000017 JMPREL 0x600
+ELF-AARCH64-SO: 0x000000006FFFFEF6 TLSDESC_PLT 0x6D0
+ELF-AARCH64-SO: 0x000000006FFFFEF7 TLSDESC_GOT 0x10FE0
+ELF-AARCH64-SO: 0x0000000000000007 RELA 0x540
+ELF-AARCH64-SO: 0x0000000000000008 RELASZ 192 (bytes)
+ELF-AARCH64-SO: 0x0000000000000009 RELAENT 24 (bytes)
+ELF-AARCH64-SO: 0x000000006FFFFFFE VERNEED 0x520
+ELF-AARCH64-SO: 0x000000006FFFFFFF VERNEEDNUM 1
+ELF-AARCH64-SO: 0x000000006FFFFFF0 VERSYM 0x4F2
+ELF-AARCH64-SO: 0x000000006FFFFFF9 unknown 0x3
+ELF-AARCH64-SO: 0x0000000000000000 NULL 0x0
+ELF-AARCH64-SO: ]
More information about the llvm-commits
mailing list