[lld] r367533 - [ELF][X86] Improve tests
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 1 02:25:34 PDT 2019
Author: maskray
Date: Thu Aug 1 02:25:34 2019
New Revision: 367533
URL: http://llvm.org/viewvc/llvm-project?rev=367533&view=rev
Log:
[ELF][X86] Improve tests
* Add --no-show-raw-insn to llvm-objdump -d tests
* When linking an executable with %t.so, the path %t.so will be recorded
in the DT_NEEDED entry if %t.so doesn't have DT_SONAME. .dynstr will
have varying lengths on different systems. Add -soname so that the
string in .dynstr is of fixed length to make tests more robust.
* Rename i386-tls-initial-exec-local.s to i386-tls-ie-local.s
* Refactor tls-initial-exec-local.s to x86-64-tls-ie-local.s
Added:
lld/trunk/test/ELF/i386-tls-ie-local.s
- copied, changed from r367515, lld/trunk/test/ELF/i386-tls-initial-exec-local.s
lld/trunk/test/ELF/x86-64-tls-ie-local.s
Removed:
lld/trunk/test/ELF/i386-tls-initial-exec-local.s
lld/trunk/test/ELF/tls-initial-exec-local.s
Modified:
lld/trunk/test/ELF/i386-gotpc.s
lld/trunk/test/ELF/i386-reloc-range.s
lld/trunk/test/ELF/i386-retpoline-nopic-linkerscript.s
lld/trunk/test/ELF/i386-retpoline-nopic.s
lld/trunk/test/ELF/i386-retpoline-pic.s
lld/trunk/test/ELF/i386-tls-ie-shared.s
Modified: lld/trunk/test/ELF/i386-gotpc.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/i386-gotpc.s?rev=367533&r1=367532&r2=367533&view=diff
==============================================================================
--- lld/trunk/test/ELF/i386-gotpc.s (original)
+++ lld/trunk/test/ELF/i386-gotpc.s Thu Aug 1 02:25:34 2019
@@ -2,7 +2,7 @@
// RUN: llvm-mc -filetype=obj -triple=i686-pc-linux %s -o %t.o
// RUN: ld.lld --hash-style=sysv %t.o -o %t.so -shared
// RUN: llvm-readelf -S %t.so | FileCheck %s
-// RUN: llvm-objdump -d %t.so | FileCheck --check-prefix=DISASM %s
+// RUN: llvm-objdump -d --no-show-raw-insn %t.so | FileCheck --check-prefix=DISASM %s
movl $_GLOBAL_OFFSET_TABLE_, %eax
@@ -11,5 +11,5 @@ movl $_GLOBAL_OFFSET_TABLE_, %eax
// DISASM: Disassembly of section .text:
// DISASM-EMPTY:
// DISASM-NEXT: .text:
-// DISASM-NEXT: 1000: {{.*}} movl $8192, %eax
-// 0x3000 (.got.plt) - 0x1000 = 8192
+// DISASM-NEXT: 1000: movl $8192, %eax
+// ^-- 0x3000 (.got.plt) - 0x1000 = 8192
Modified: lld/trunk/test/ELF/i386-reloc-range.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/i386-reloc-range.s?rev=367533&r1=367532&r2=367533&view=diff
==============================================================================
--- lld/trunk/test/ELF/i386-reloc-range.s (original)
+++ lld/trunk/test/ELF/i386-reloc-range.s Thu Aug 1 02:25:34 2019
@@ -7,12 +7,12 @@
// RUN: llvm-mc %t2.s -o %t2.o -triple i386-pc-linux -filetype=obj
// RUN: ld.lld -Ttext 0x200 %t.o %t1.o -o %t1
-// RUN: llvm-objdump -d -triple=i386-pc-linux-code16 %t1 | FileCheck %s
+// RUN: llvm-objdump -d --no-show-raw-insn -triple=i386-pc-linux-code16 %t1 | FileCheck %s
// CHECK: Disassembly of section .text:
// CHECK-EMPTY:
// CHECK-NEXT: _start:
-// CHECK-NEXT: 200: {{.*}} jmp -1
+// CHECK-NEXT: 200: jmp -1
// 0x10202 - 0x203 == 0xffff
// RUN: not ld.lld -Ttext 0x200 %t.o %t2.o -o /dev/null 2>&1 | FileCheck --check-prefix=ERR %s
Modified: lld/trunk/test/ELF/i386-retpoline-nopic-linkerscript.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/i386-retpoline-nopic-linkerscript.s?rev=367533&r1=367532&r2=367533&view=diff
==============================================================================
--- lld/trunk/test/ELF/i386-retpoline-nopic-linkerscript.s (original)
+++ lld/trunk/test/ELF/i386-retpoline-nopic-linkerscript.s Thu Aug 1 02:25:34 2019
@@ -1,7 +1,7 @@
// REQUIRES: x86
// RUN: llvm-mc -filetype=obj -triple=i386-unknown-linux %s -o %t1.o
// RUN: llvm-mc -filetype=obj -triple=i386-unknown-linux %p/Inputs/shared.s -o %t2.o
-// RUN: ld.lld -shared %t2.o -o %t2.so
+// RUN: ld.lld -shared -soname=t2.so %t2.o -o %t2.so
// RUN: echo "SECTIONS { \
// RUN: .text : { *(.text) } \
@@ -10,57 +10,57 @@
// RUN: .dynstr : { *(.dynstr) } \
// RUN: }" > %t.script
// RUN: ld.lld %t1.o %t2.so -o %t.exe -z retpolineplt --script %t.script
-// RUN: llvm-objdump -d -s %t.exe | FileCheck %s
+// RUN: llvm-objdump -d -s --no-show-raw-insn %t.exe | FileCheck %s
// CHECK: Disassembly of section .plt:
// CHECK-EMPTY:
// CHECK-NEXT: .plt:
-// CHECK-NEXT: 10: ff 35 ec 00 00 00 pushl 236
-// CHECK-NEXT: 16: 50 pushl %eax
-// CHECK-NEXT: 17: a1 f0 00 00 00 movl 240, %eax
-// CHECK-NEXT: 1c: e8 0f 00 00 00 calll 15 <.plt+0x20>
-// CHECK-NEXT: 21: f3 90 pause
-// CHECK-NEXT: 23: 0f ae e8 lfence
-// CHECK-NEXT: 26: eb f9 jmp -7 <.plt+0x11>
-// CHECK-NEXT: 28: cc int3
-// CHECK-NEXT: 29: cc int3
-// CHECK-NEXT: 2a: cc int3
-// CHECK-NEXT: 2b: cc int3
-// CHECK-NEXT: 2c: cc int3
-// CHECK-NEXT: 2d: cc int3
-// CHECK-NEXT: 2e: cc int3
-// CHECK-NEXT: 2f: cc int3
-// CHECK-NEXT: 30: 89 0c 24 movl %ecx, (%esp)
-// CHECK-NEXT: 33: 8b 4c 24 04 movl 4(%esp), %ecx
-// CHECK-NEXT: 37: 89 44 24 04 movl %eax, 4(%esp)
-// CHECK-NEXT: 3b: 89 c8 movl %ecx, %eax
-// CHECK-NEXT: 3d: 59 popl %ecx
-// CHECK-NEXT: 3e: c3 retl
-// CHECK-NEXT: 3f: cc int3
-// CHECK-NEXT: 40: 50 pushl %eax
-// CHECK-NEXT: 41: a1 f4 00 00 00 movl 244, %eax
-// CHECK-NEXT: 46: e8 e5 ff ff ff calll -27 <.plt+0x20>
-// CHECK-NEXT: 4b: e9 d1 ff ff ff jmp -47 <.plt+0x11>
-// CHECK-NEXT: 50: 68 00 00 00 00 pushl $0
-// CHECK-NEXT: 55: e9 b6 ff ff ff jmp -74 <.plt>
-// CHECK-NEXT: 5a: cc int3
-// CHECK-NEXT: 5b: cc int3
-// CHECK-NEXT: 5c: cc int3
-// CHECK-NEXT: 5d: cc int3
-// CHECK-NEXT: 5e: cc int3
-// CHECK-NEXT: 5f: cc int3
-// CHECK-NEXT: 60: 50 pushl %eax
-// CHECK-NEXT: 61: a1 f8 00 00 00 movl 248, %eax
-// CHECK-NEXT: 66: e8 c5 ff ff ff calll -59 <.plt+0x20>
-// CHECK-NEXT: 6b: e9 b1 ff ff ff jmp -79 <.plt+0x11>
-// CHECK-NEXT: 70: 68 08 00 00 00 pushl $8
-// CHECK-NEXT: 75: e9 96 ff ff ff jmp -106 <.plt>
-// CHECK-NEXT: 7a: cc int3
-// CHECK-NEXT: 7b: cc int3
-// CHECK-NEXT: 7c: cc int3
-// CHECK-NEXT: 7d: cc int3
-// CHECK-NEXT: 7e: cc int3
-// CHECK-NEXT: 7f: cc int3
+// CHECK-NEXT: 10: pushl 236
+// CHECK-NEXT: 16: pushl %eax
+// CHECK-NEXT: 17: movl 240, %eax
+// CHECK-NEXT: 1c: calll 15 <.plt+0x20>
+// CHECK-NEXT: 21: pause
+// CHECK-NEXT: 23: lfence
+// CHECK-NEXT: 26: jmp -7 <.plt+0x11>
+// CHECK-NEXT: 28: int3
+// CHECK-NEXT: 29: int3
+// CHECK-NEXT: 2a: int3
+// CHECK-NEXT: 2b: int3
+// CHECK-NEXT: 2c: int3
+// CHECK-NEXT: 2d: int3
+// CHECK-NEXT: 2e: int3
+// CHECK-NEXT: 2f: int3
+// CHECK-NEXT: 30: movl %ecx, (%esp)
+// CHECK-NEXT: 33: movl 4(%esp), %ecx
+// CHECK-NEXT: 37: movl %eax, 4(%esp)
+// CHECK-NEXT: 3b: movl %ecx, %eax
+// CHECK-NEXT: 3d: popl %ecx
+// CHECK-NEXT: 3e: retl
+// CHECK-NEXT: 3f: int3
+// CHECK-NEXT: 40: pushl %eax
+// CHECK-NEXT: 41: movl 244, %eax
+// CHECK-NEXT: 46: calll -27 <.plt+0x20>
+// CHECK-NEXT: 4b: jmp -47 <.plt+0x11>
+// CHECK-NEXT: 50: pushl $0
+// CHECK-NEXT: 55: jmp -74 <.plt>
+// CHECK-NEXT: 5a: int3
+// CHECK-NEXT: 5b: int3
+// CHECK-NEXT: 5c: int3
+// CHECK-NEXT: 5d: int3
+// CHECK-NEXT: 5e: int3
+// CHECK-NEXT: 5f: int3
+// CHECK-NEXT: 60: pushl %eax
+// CHECK-NEXT: 61: movl 248, %eax
+// CHECK-NEXT: 66: calll -59 <.plt+0x20>
+// CHECK-NEXT: 6b: jmp -79 <.plt+0x11>
+// CHECK-NEXT: 70: pushl $8
+// CHECK-NEXT: 75: jmp -106 <.plt>
+// CHECK-NEXT: 7a: int3
+// CHECK-NEXT: 7b: int3
+// CHECK-NEXT: 7c: int3
+// CHECK-NEXT: 7d: int3
+// CHECK-NEXT: 7e: int3
+// CHECK-NEXT: 7f: int3
.global _start
_start:
Modified: lld/trunk/test/ELF/i386-retpoline-nopic.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/i386-retpoline-nopic.s?rev=367533&r1=367532&r2=367533&view=diff
==============================================================================
--- lld/trunk/test/ELF/i386-retpoline-nopic.s (original)
+++ lld/trunk/test/ELF/i386-retpoline-nopic.s Thu Aug 1 02:25:34 2019
@@ -1,60 +1,60 @@
// REQUIRES: x86
// RUN: llvm-mc -filetype=obj -triple=i386-unknown-linux %s -o %t1.o
// RUN: llvm-mc -filetype=obj -triple=i386-unknown-linux %p/Inputs/shared.s -o %t2.o
-// RUN: ld.lld -shared %t2.o -o %t2.so
+// RUN: ld.lld -shared -soname=t2.so %t2.o -o %t2.so
// RUN: ld.lld %t1.o %t2.so -o %t.exe -z retpolineplt
-// RUN: llvm-objdump -d -s %t.exe | FileCheck %s
+// RUN: llvm-objdump -d -s --no-show-raw-insn %t.exe | FileCheck %s
// CHECK: Disassembly of section .plt:
// CHECK-EMPTY:
// CHECK-NEXT: .plt:
-// CHECK-NEXT: 401010: ff 35 04 30 40 00 pushl 4206596
-// CHECK-NEXT: 401016: 50 pushl %eax
-// CHECK-NEXT: 401017: a1 08 30 40 00 movl 4206600, %eax
-// CHECK-NEXT: 40101c: e8 0f 00 00 00 calll 15 <.plt+0x20>
-// CHECK-NEXT: 401021: f3 90 pause
-// CHECK-NEXT: 401023: 0f ae e8 lfence
-// CHECK-NEXT: 401026: eb f9 jmp -7 <.plt+0x11>
-// CHECK-NEXT: 401028: cc int3
-// CHECK-NEXT: 401029: cc int3
-// CHECK-NEXT: 40102a: cc int3
-// CHECK-NEXT: 40102b: cc int3
-// CHECK-NEXT: 40102c: cc int3
-// CHECK-NEXT: 40102d: cc int3
-// CHECK-NEXT: 40102e: cc int3
-// CHECK-NEXT: 40102f: cc int3
-// CHECK-NEXT: 401030: 89 0c 24 movl %ecx, (%esp)
-// CHECK-NEXT: 401033: 8b 4c 24 04 movl 4(%esp), %ecx
-// CHECK-NEXT: 401037: 89 44 24 04 movl %eax, 4(%esp)
-// CHECK-NEXT: 40103b: 89 c8 movl %ecx, %eax
-// CHECK-NEXT: 40103d: 59 popl %ecx
-// CHECK-NEXT: 40103e: c3 retl
-// CHECK-NEXT: 40103f: cc int3
-// CHECK-NEXT: 401040: 50 pushl %eax
-// CHECK-NEXT: 401041: a1 0c 30 40 00 movl 4206604, %eax
-// CHECK-NEXT: 401046: e8 e5 ff ff ff calll -27 <.plt+0x20>
-// CHECK-NEXT: 40104b: e9 d1 ff ff ff jmp -47 <.plt+0x11>
-// CHECK-NEXT: 401050: 68 00 00 00 00 pushl $0
-// CHECK-NEXT: 401055: e9 b6 ff ff ff jmp -74 <.plt>
-// CHECK-NEXT: 40105a: cc int3
-// CHECK-NEXT: 40105b: cc int3
-// CHECK-NEXT: 40105c: cc int3
-// CHECK-NEXT: 40105d: cc int3
-// CHECK-NEXT: 40105e: cc int3
-// CHECK-NEXT: 40105f: cc int3
-// CHECK-NEXT: 401060: 50 pushl %eax
-// CHECK-NEXT: 401061: a1 10 30 40 00 movl 4206608, %eax
-// CHECK-NEXT: 401066: e8 c5 ff ff ff calll -59 <.plt+0x20>
-// CHECK-NEXT: 40106b: e9 b1 ff ff ff jmp -79 <.plt+0x11>
-// CHECK-NEXT: 401070: 68 08 00 00 00 pushl $8
-// CHECK-NEXT: 401075: e9 96 ff ff ff jmp -106 <.plt>
-// CHECK-NEXT: 40107a: cc int3
-// CHECK-NEXT: 40107b: cc int3
-// CHECK-NEXT: 40107c: cc int3
-// CHECK-NEXT: 40107d: cc int3
-// CHECK-NEXT: 40107e: cc int3
-// CHECK-NEXT: 40107f: cc int3
+// CHECK-NEXT: 401010: pushl 4206596
+// CHECK-NEXT: 401016: pushl %eax
+// CHECK-NEXT: 401017: movl 4206600, %eax
+// CHECK-NEXT: 40101c: calll 15 <.plt+0x20>
+// CHECK-NEXT: 401021: pause
+// CHECK-NEXT: 401023: lfence
+// CHECK-NEXT: 401026: jmp -7 <.plt+0x11>
+// CHECK-NEXT: 401028: int3
+// CHECK-NEXT: 401029: int3
+// CHECK-NEXT: 40102a: int3
+// CHECK-NEXT: 40102b: int3
+// CHECK-NEXT: 40102c: int3
+// CHECK-NEXT: 40102d: int3
+// CHECK-NEXT: 40102e: int3
+// CHECK-NEXT: 40102f: int3
+// CHECK-NEXT: 401030: movl %ecx, (%esp)
+// CHECK-NEXT: 401033: movl 4(%esp), %ecx
+// CHECK-NEXT: 401037: movl %eax, 4(%esp)
+// CHECK-NEXT: 40103b: movl %ecx, %eax
+// CHECK-NEXT: 40103d: popl %ecx
+// CHECK-NEXT: 40103e: retl
+// CHECK-NEXT: 40103f: int3
+// CHECK-NEXT: 401040: pushl %eax
+// CHECK-NEXT: 401041: movl 4206604, %eax
+// CHECK-NEXT: 401046: calll -27 <.plt+0x20>
+// CHECK-NEXT: 40104b: jmp -47 <.plt+0x11>
+// CHECK-NEXT: 401050: pushl $0
+// CHECK-NEXT: 401055: jmp -74 <.plt>
+// CHECK-NEXT: 40105a: int3
+// CHECK-NEXT: 40105b: int3
+// CHECK-NEXT: 40105c: int3
+// CHECK-NEXT: 40105d: int3
+// CHECK-NEXT: 40105e: int3
+// CHECK-NEXT: 40105f: int3
+// CHECK-NEXT: 401060: pushl %eax
+// CHECK-NEXT: 401061: movl 4206608, %eax
+// CHECK-NEXT: 401066: calll -59 <.plt+0x20>
+// CHECK-NEXT: 40106b: jmp -79 <.plt+0x11>
+// CHECK-NEXT: 401070: pushl $8
+// CHECK-NEXT: 401075: jmp -106 <.plt>
+// CHECK-NEXT: 40107a: int3
+// CHECK-NEXT: 40107b: int3
+// CHECK-NEXT: 40107c: int3
+// CHECK-NEXT: 40107d: int3
+// CHECK-NEXT: 40107e: int3
+// CHECK-NEXT: 40107f: int3
// CHECK: Contents of section .got.plt:
// CHECK-NEXT: 00204000 00000000 00000000 50104000
Modified: lld/trunk/test/ELF/i386-retpoline-pic.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/i386-retpoline-pic.s?rev=367533&r1=367532&r2=367533&view=diff
==============================================================================
--- lld/trunk/test/ELF/i386-retpoline-pic.s (original)
+++ lld/trunk/test/ELF/i386-retpoline-pic.s Thu Aug 1 02:25:34 2019
@@ -1,57 +1,57 @@
// REQUIRES: x86
// RUN: llvm-mc -filetype=obj -triple=i386-unknown-linux -position-independent %s -o %t1.o
// RUN: llvm-mc -filetype=obj -triple=i386-unknown-linux -position-independent %p/Inputs/shared.s -o %t2.o
-// RUN: ld.lld -shared %t2.o -o %t2.so
+// RUN: ld.lld -shared -soname=t2.so %t2.o -o %t2.so
// RUN: ld.lld %t1.o %t2.so -o %t.exe -z retpolineplt -pie
-// RUN: llvm-objdump -d -s %t.exe | FileCheck %s
+// RUN: llvm-objdump -d -s --no-show-raw-insn %t.exe | FileCheck %s
// CHECK: Disassembly of section .plt:
// CHECK-EMPTY:
// CHECK-NEXT: .plt:
-// CHECK-NEXT: 1010: ff b3 04 00 00 00 pushl 4(%ebx)
-// CHECK-NEXT: 1016: 50 pushl %eax
-// CHECK-NEXT: 1017: 8b 83 08 00 00 00 movl 8(%ebx), %eax
-// CHECK-NEXT: 101d: e8 0e 00 00 00 calll 14 <.plt+0x20>
-// CHECK-NEXT: 1022: f3 90 pause
-// CHECK-NEXT: 1024: 0f ae e8 lfence
-// CHECK-NEXT: 1027: eb f9 jmp -7 <.plt+0x12>
-// CHECK-NEXT: 1029: cc int3
-// CHECK-NEXT: 102a: cc int3
-// CHECK-NEXT: 102b: cc int3
-// CHECK-NEXT: 102c: cc int3
-// CHECK-NEXT: 102d: cc int3
-// CHECK-NEXT: 102e: cc int3
-// CHECK-NEXT: 102f: cc int3
-// CHECK-NEXT: 1030: 89 0c 24 movl %ecx, (%esp)
-// CHECK-NEXT: 1033: 8b 4c 24 04 movl 4(%esp), %ecx
-// CHECK-NEXT: 1037: 89 44 24 04 movl %eax, 4(%esp)
-// CHECK-NEXT: 103b: 89 c8 movl %ecx, %eax
-// CHECK-NEXT: 103d: 59 popl %ecx
-// CHECK-NEXT: 103e: c3 retl
-// CHECK-NEXT: 103f: cc int3
-// CHECK-NEXT: 1040: 50 pushl %eax
-// CHECK-NEXT: 1041: 8b 83 0c 00 00 00 movl 12(%ebx), %eax
-// CHECK-NEXT: 1047: e8 e4 ff ff ff calll -28 <.plt+0x20>
-// CHECK-NEXT: 104c: e9 d1 ff ff ff jmp -47 <.plt+0x12>
-// CHECK-NEXT: 1051: 68 00 00 00 00 pushl $0
-// CHECK-NEXT: 1056: e9 b5 ff ff ff jmp -75 <.plt>
-// CHECK-NEXT: 105b: cc int3
-// CHECK-NEXT: 105c: cc int3
-// CHECK-NEXT: 105d: cc int3
-// CHECK-NEXT: 105e: cc int3
-// CHECK-NEXT: 105f: cc int3
-// CHECK-NEXT: 1060: 50 pushl %eax
-// CHECK-NEXT: 1061: 8b 83 10 00 00 00 movl 16(%ebx), %eax
-// CHECK-NEXT: 1067: e8 c4 ff ff ff calll -60 <.plt+0x20>
-// CHECK-NEXT: 106c: e9 b1 ff ff ff jmp -79 <.plt+0x12>
-// CHECK-NEXT: 1071: 68 08 00 00 00 pushl $8
-// CHECK-NEXT: 1076: e9 95 ff ff ff jmp -107 <.plt>
-// CHECK-NEXT: 107b: cc int3
-// CHECK-NEXT: 107c: cc int3
-// CHECK-NEXT: 107d: cc int3
-// CHECK-NEXT: 107e: cc int3
-// CHECK-NEXT: 107f: cc int3
+// CHECK-NEXT: 1010: pushl 4(%ebx)
+// CHECK-NEXT: 1016: pushl %eax
+// CHECK-NEXT: 1017: movl 8(%ebx), %eax
+// CHECK-NEXT: 101d: calll 14 <.plt+0x20>
+// CHECK-NEXT: 1022: pause
+// CHECK-NEXT: 1024: lfence
+// CHECK-NEXT: 1027: jmp -7 <.plt+0x12>
+// CHECK-NEXT: 1029: int3
+// CHECK-NEXT: 102a: int3
+// CHECK-NEXT: 102b: int3
+// CHECK-NEXT: 102c: int3
+// CHECK-NEXT: 102d: int3
+// CHECK-NEXT: 102e: int3
+// CHECK-NEXT: 102f: int3
+// CHECK-NEXT: 1030: movl %ecx, (%esp)
+// CHECK-NEXT: 1033: movl 4(%esp), %ecx
+// CHECK-NEXT: 1037: movl %eax, 4(%esp)
+// CHECK-NEXT: 103b: movl %ecx, %eax
+// CHECK-NEXT: 103d: popl %ecx
+// CHECK-NEXT: 103e: retl
+// CHECK-NEXT: 103f: int3
+// CHECK-NEXT: 1040: pushl %eax
+// CHECK-NEXT: 1041: movl 12(%ebx), %eax
+// CHECK-NEXT: 1047: calll -28 <.plt+0x20>
+// CHECK-NEXT: 104c: jmp -47 <.plt+0x12>
+// CHECK-NEXT: 1051: pushl $0
+// CHECK-NEXT: 1056: jmp -75 <.plt>
+// CHECK-NEXT: 105b: int3
+// CHECK-NEXT: 105c: int3
+// CHECK-NEXT: 105d: int3
+// CHECK-NEXT: 105e: int3
+// CHECK-NEXT: 105f: int3
+// CHECK-NEXT: 1060: pushl %eax
+// CHECK-NEXT: 1061: movl 16(%ebx), %eax
+// CHECK-NEXT: 1067: calll -60 <.plt+0x20>
+// CHECK-NEXT: 106c: jmp -79 <.plt+0x12>
+// CHECK-NEXT: 1071: pushl $8
+// CHECK-NEXT: 1076: jmp -107 <.plt>
+// CHECK-NEXT: 107b: int3
+// CHECK-NEXT: 107c: int3
+// CHECK-NEXT: 107d: int3
+// CHECK-NEXT: 107e: int3
+// CHECK-NEXT: 107f: int3
// CHECK: Contents of section .got.plt:
// CHECK-NEXT: 3000 00200000 00000000 00000000 51100000
Copied: lld/trunk/test/ELF/i386-tls-ie-local.s (from r367515, lld/trunk/test/ELF/i386-tls-initial-exec-local.s)
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/i386-tls-ie-local.s?p2=lld/trunk/test/ELF/i386-tls-ie-local.s&p1=lld/trunk/test/ELF/i386-tls-initial-exec-local.s&r1=367515&r2=367533&rev=367533&view=diff
==============================================================================
(empty)
Modified: lld/trunk/test/ELF/i386-tls-ie-shared.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/i386-tls-ie-shared.s?rev=367533&r1=367532&r2=367533&view=diff
==============================================================================
--- lld/trunk/test/ELF/i386-tls-ie-shared.s (original)
+++ lld/trunk/test/ELF/i386-tls-ie-shared.s Thu Aug 1 02:25:34 2019
@@ -1,10 +1,10 @@
// REQUIRES: x86
// RUN: llvm-mc -filetype=obj -triple=i686-pc-linux %s -o %t.o
// RUN: llvm-mc -filetype=obj -triple=i686-pc-linux %p/Inputs/tls-opt-iele-i686-nopic.s -o %tso.o
-// RUN: ld.lld -shared %tso.o -o %tso
+// RUN: ld.lld -shared -soname=t.so %tso.o -o %tso
// RUN: ld.lld --hash-style=sysv -shared %t.o %tso -o %t1
// RUN: llvm-readobj -S -r -d %t1 | FileCheck --check-prefix=GOTRELSHARED %s
-// RUN: llvm-objdump -d %t1 | FileCheck --check-prefix=DISASMSHARED %s
+// RUN: llvm-objdump -d --no-show-raw-insn %t1 | FileCheck --check-prefix=DISASMSHARED %s
// GOTRELSHARED: Section {
// GOTRELSHARED: Index: 8
@@ -47,22 +47,22 @@
// (.got)[1] = 0x2064 = 8292
// (.got)[2] = 0x2068 = 8296
// (.got)[3] = 0x206C = 8300
-// DISASMSHARED-NEXT: 1000: {{.*}} movl 8288, %ecx
-// DISASMSHARED-NEXT: 1006: {{.*}} movl %gs:(%ecx), %eax
-// DISASMSHARED-NEXT: 1009: {{.*}} movl 8288, %eax
-// DISASMSHARED-NEXT: 100e: {{.*}} movl %gs:(%eax), %eax
-// DISASMSHARED-NEXT: 1011: {{.*}} addl 8288, %ecx
-// DISASMSHARED-NEXT: 1017: {{.*}} movl %gs:(%ecx), %eax
-// DISASMSHARED-NEXT: 101a: {{.*}} movl 8292, %ecx
-// DISASMSHARED-NEXT: 1020: {{.*}} movl %gs:(%ecx), %eax
-// DISASMSHARED-NEXT: 1023: {{.*}} movl 8292, %eax
-// DISASMSHARED-NEXT: 1028: {{.*}} movl %gs:(%eax), %eax
-// DISASMSHARED-NEXT: 102b: {{.*}} addl 8292, %ecx
-// DISASMSHARED-NEXT: 1031: {{.*}} movl %gs:(%ecx), %eax
-// DISASMSHARED-NEXT: 1034: {{.*}} movl 8296, %ecx
-// DISASMSHARED-NEXT: 103a: {{.*}} movl %gs:(%ecx), %eax
-// DISASMSHARED-NEXT: 103d: {{.*}} addl 8300, %ecx
-// DISASMSHARED-NEXT: 1043: {{.*}} movl %gs:(%ecx), %eax
+// DISASMSHARED-NEXT: 1000: movl 8288, %ecx
+// DISASMSHARED-NEXT: 1006: movl %gs:(%ecx), %eax
+// DISASMSHARED-NEXT: 1009: movl 8288, %eax
+// DISASMSHARED-NEXT: 100e: movl %gs:(%eax), %eax
+// DISASMSHARED-NEXT: 1011: addl 8288, %ecx
+// DISASMSHARED-NEXT: 1017: movl %gs:(%ecx), %eax
+// DISASMSHARED-NEXT: 101a: movl 8292, %ecx
+// DISASMSHARED-NEXT: 1020: movl %gs:(%ecx), %eax
+// DISASMSHARED-NEXT: 1023: movl 8292, %eax
+// DISASMSHARED-NEXT: 1028: movl %gs:(%eax), %eax
+// DISASMSHARED-NEXT: 102b: addl 8292, %ecx
+// DISASMSHARED-NEXT: 1031: movl %gs:(%ecx), %eax
+// DISASMSHARED-NEXT: 1034: movl 8296, %ecx
+// DISASMSHARED-NEXT: 103a: movl %gs:(%ecx), %eax
+// DISASMSHARED-NEXT: 103d: addl 8300, %ecx
+// DISASMSHARED-NEXT: 1043: movl %gs:(%ecx), %eax
.type tlslocal0, at object
.section .tbss,"awT", at nobits
Removed: lld/trunk/test/ELF/i386-tls-initial-exec-local.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/i386-tls-initial-exec-local.s?rev=367532&view=auto
==============================================================================
--- lld/trunk/test/ELF/i386-tls-initial-exec-local.s (original)
+++ lld/trunk/test/ELF/i386-tls-initial-exec-local.s (removed)
@@ -1,36 +0,0 @@
-# REQUIRES: x86
-# RUN: llvm-mc %s -o %t.o -filetype=obj -triple=i386-pc-linux
-# RUN: ld.lld %t.o -o %t.so -shared
-# RUN: llvm-readobj --relocations --sections --section-data %t.so | FileCheck %s
-
-# Check initial exec access to a local symbol.
-
-# CHECK: Name: .got (
-# CHECK-NEXT: Type:
-# CHECK-NEXT: Flags [
-# CHECK-NEXT: SHF_ALLOC
-# CHECK-NEXT: SHF_WRITE
-# CHECK-NEXT: ]
-# CHECK-NEXT: Address:
-# CHECK-NEXT: Offset:
-# CHECK-NEXT: Size: 8
-# CHECK-NEXT: Link:
-# CHECK-NEXT: Info:
-# CHECK-NEXT: AddressAlignment:
-# CHECK-NEXT: EntrySize:
-# CHECK-NEXT: SectionData (
-# CHECK-NEXT: 0000: 00000000 04000000
-# CHECK-NEXT: )
-
-# CHECK: R_386_TLS_TPOFF - 0x0
-# CHECK-NEXT: R_386_TLS_TPOFF - 0x0
-
- movl bar1 at GOTNTPOFF(%eax), %ecx
- movl bar2 at GOTNTPOFF(%eax), %eax
-
- .section .tdata,"awT", at progbits
-bar1:
- .long 42
-
-bar2:
- .long 42
Removed: lld/trunk/test/ELF/tls-initial-exec-local.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/tls-initial-exec-local.s?rev=367532&view=auto
==============================================================================
--- lld/trunk/test/ELF/tls-initial-exec-local.s (original)
+++ lld/trunk/test/ELF/tls-initial-exec-local.s (removed)
@@ -1,37 +0,0 @@
-// REQUIRES: x86
-// RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
-// RUN: ld.lld --hash-style=sysv -shared %t.o -o %t
-// RUN: llvm-readobj -r -S %t | FileCheck %s
-// RUN: llvm-objdump -d %t | FileCheck --check-prefix=DISASM %s
-
-// CHECK: Name: .got
-// CHECK-NEXT: Type: SHT_PROGBITS
-// CHECK-NEXT: Flags [
-// CHECK-NEXT: SHF_ALLOC (0x2)
-// CHECK-NEXT: SHF_WRITE (0x1)
-// CHECK-NEXT: ]
-// CHECK-NEXT: Address: 0x20A0
-
-// CHECK: Relocations [
-// CHECK-NEXT: Section ({{.*}}) .rela.dyn {
-// CHECK-NEXT: 0x20A0 R_X86_64_TPOFF64 - 0x0
-// CHECK-NEXT: 0x20A8 R_X86_64_TPOFF64 - 0x4
-// CHECK-NEXT: }
-// CHECK-NEXT: ]
-
-// 0x1007 + 4249 = 0x20A0
-// 0x100e + 4250 = 0x20A8
-// DISASM: Disassembly of section .text:
-// DISASM-EMPTY:
-// DISASM-NEXT: .text:
-// DISASM-NEXT: 1000: {{.*}} addq 4249(%rip), %rax
-// DISASM-NEXT: 1007: {{.*}} addq 4250(%rip), %rax
-
- addq foo at GOTTPOFF(%rip), %rax
- addq bar at GOTTPOFF(%rip), %rax
-
- .section .tbss,"awT", at nobits
-foo:
- .long 0
-bar:
- .long 0
Added: lld/trunk/test/ELF/x86-64-tls-ie-local.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/x86-64-tls-ie-local.s?rev=367533&view=auto
==============================================================================
--- lld/trunk/test/ELF/x86-64-tls-ie-local.s (added)
+++ lld/trunk/test/ELF/x86-64-tls-ie-local.s Thu Aug 1 02:25:34 2019
@@ -0,0 +1,28 @@
+# REQUIRES: x86
+# RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t.o
+# RUN: ld.lld -shared %t.o -o %t.so
+# RUN: llvm-readelf -S %t.so | FileCheck --check-prefix=SEC %s
+# RUN: llvm-readobj -r %t.so | FileCheck --check-prefix=REL %s
+# RUN: llvm-objdump -d --no-show-raw-insn %t.so | FileCheck %s
+
+# SEC: .got PROGBITS 00000000000020b0 0020b0 000010 00 WA 0 0 8
+
+## Dynamic relocations for non-preemptable symbols in a shared object have section index 0.
+# REL: .rela.dyn {
+# REL-NEXT: 0x20B0 R_X86_64_TPOFF64 - 0x0
+# REL-NEXT: 0x20B8 R_X86_64_TPOFF64 - 0x4
+# REL-NEXT: }
+
+## &.got[0] - 0x1007 = 0x20B0 - 0x1007 = 4265
+## &.got[1] - 0x100e = 0x20B8 - 0x100e = 4266
+# CHECK: 1000: addq 4265(%rip), %rax
+# CHECK-NEXT: 1007: addq 4266(%rip), %rax
+
+addq foo at GOTTPOFF(%rip), %rax
+addq bar at GOTTPOFF(%rip), %rax
+
+.section .tbss,"awT", at nobits
+foo:
+ .long 0
+bar:
+ .long 0
More information about the llvm-commits
mailing list