diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/ELF/Inputs/i386-static-tls-model1.s | 10 | ||||
-rw-r--r-- | test/ELF/Inputs/i386-static-tls-model2.s | 9 | ||||
-rw-r--r-- | test/ELF/Inputs/i386-static-tls-model3.s | 9 | ||||
-rw-r--r-- | test/ELF/Inputs/i386-static-tls-model4.s | 9 | ||||
-rw-r--r-- | test/ELF/defsym.s | 5 | ||||
-rw-r--r-- | test/ELF/i386-static-tls-model.s | 20 | ||||
-rw-r--r-- | test/ELF/i386-tls-ie-shared.s | 52 | ||||
-rw-r--r-- | test/ELF/linkerscript/Inputs/compress-debug-sections.s | 3 | ||||
-rw-r--r-- | test/ELF/linkerscript/compress-debug-sections.s | 36 | ||||
-rw-r--r-- | test/ELF/lto/Inputs/duplicated-name.ll | 6 | ||||
-rw-r--r-- | test/ELF/lto/archive-no-index.ll | 28 | ||||
-rw-r--r-- | test/ELF/lto/duplicated-name.ll | 15 | ||||
-rw-r--r-- | test/ELF/lto/thin-archivecollision.ll | 19 | ||||
-rw-r--r-- | test/ELF/tls-dynamic-i686.s | 46 | ||||
-rw-r--r-- | test/ELF/tls-offset.s | 6 | ||||
-rw-r--r-- | test/ELF/tls-opt-iele-i686-nopic.s | 44 |
16 files changed, 216 insertions, 101 deletions
diff --git a/test/ELF/Inputs/i386-static-tls-model1.s b/test/ELF/Inputs/i386-static-tls-model1.s new file mode 100644 index 000000000000..e7e584c1fcf1 --- /dev/null +++ b/test/ELF/Inputs/i386-static-tls-model1.s @@ -0,0 +1,10 @@ +.section ".tdata", "awT", @progbits +.globl var +var: + +.section .foo, "aw" +.global _start +_start: + movl $var@tpoff, %edx # R_386_TLS_LE_32 + movl %gs:0, %ecx + subl %edx, %eax diff --git a/test/ELF/Inputs/i386-static-tls-model2.s b/test/ELF/Inputs/i386-static-tls-model2.s new file mode 100644 index 000000000000..b28a1458742d --- /dev/null +++ b/test/ELF/Inputs/i386-static-tls-model2.s @@ -0,0 +1,9 @@ +.section ".tdata", "awT", @progbits +.globl var +var: + +.section .foo, "aw" +.global _start +_start: + movl %gs:0, %eax + addl var@gotntpoff(%ebx),%eax # R_386_TLS_GOTIE diff --git a/test/ELF/Inputs/i386-static-tls-model3.s b/test/ELF/Inputs/i386-static-tls-model3.s new file mode 100644 index 000000000000..f92267ecbdd0 --- /dev/null +++ b/test/ELF/Inputs/i386-static-tls-model3.s @@ -0,0 +1,9 @@ +.section ".tdata", "awT", @progbits +.globl var +var: + +.section .foo, "aw" +.global _start +_start: + movl %gs:0, %eax + addl var@indntpoff, %eax #R_386_TLS_IE diff --git a/test/ELF/Inputs/i386-static-tls-model4.s b/test/ELF/Inputs/i386-static-tls-model4.s new file mode 100644 index 000000000000..ffb20def4fab --- /dev/null +++ b/test/ELF/Inputs/i386-static-tls-model4.s @@ -0,0 +1,9 @@ +.section ".tdata", "awT", @progbits +.globl var +var: + +.section .foo, "aw" +.global _start +_start: + movl %gs:0, %eax + leal var@ntpoff(%eax), %eax #R_386_TLS_LE diff --git a/test/ELF/defsym.s b/test/ELF/defsym.s index cafc5142d1a9..778180dc9324 100644 --- a/test/ELF/defsym.s +++ b/test/ELF/defsym.s @@ -4,6 +4,11 @@ # RUN: llvm-readobj -t -s %t | FileCheck %s # RUN: llvm-objdump -d -print-imm-hex %t | FileCheck %s --check-prefix=USE +## Check that we accept --defsym foo2=foo1 form. +# RUN: ld.lld -o %t2 %t.o --defsym foo2=foo1 +# RUN: llvm-readobj -t -s %t2 | FileCheck %s +# RUN: llvm-objdump -d -print-imm-hex %t2 | FileCheck %s --check-prefix=USE + ## In compare with GNU linkers, symbol defined with --defsym does ## not get aliased name in symbol table: # CHECK: Symbol { diff --git a/test/ELF/i386-static-tls-model.s b/test/ELF/i386-static-tls-model.s new file mode 100644 index 000000000000..b2799c4c722f --- /dev/null +++ b/test/ELF/i386-static-tls-model.s @@ -0,0 +1,20 @@ +# REQUIRES: x86 + +# RUN: llvm-mc -filetype=obj -triple=i686-pc-linux %S/Inputs/i386-static-tls-model1.s -o %t.o +# RUN: ld.lld %t.o -o %t1 -shared +# RUN: llvm-readobj -dynamic-table %t1 | FileCheck %s + +# RUN: llvm-mc -filetype=obj -triple=i686-pc-linux %S/Inputs/i386-static-tls-model2.s -o %t.o +# RUN: ld.lld %t.o -o %t2 -shared +# RUN: llvm-readobj -dynamic-table %t2 | FileCheck %s + +# RUN: llvm-mc -filetype=obj -triple=i686-pc-linux %S/Inputs/i386-static-tls-model3.s -o %t.o +# RUN: ld.lld %t.o -o %t3 -shared +# RUN: llvm-readobj -dynamic-table %t3 | FileCheck %s + +# RUN: llvm-mc -filetype=obj -triple=i686-pc-linux %S/Inputs/i386-static-tls-model4.s -o %t.o +# RUN: ld.lld %t.o -o %t4 -shared +# RUN: llvm-readobj -dynamic-table %t4 | FileCheck %s + +# CHECK: DynamicSection [ +# CHECK: FLAGS STATIC_TLS diff --git a/test/ELF/i386-tls-ie-shared.s b/test/ELF/i386-tls-ie-shared.s index 8becc3199f95..c6dccf84a216 100644 --- a/test/ELF/i386-tls-ie-shared.s +++ b/test/ELF/i386-tls-ie-shared.s @@ -13,8 +13,8 @@ // GOTRELSHARED-NEXT: SHF_ALLOC // GOTRELSHARED-NEXT: SHF_WRITE // GOTRELSHARED-NEXT: ] -// GOTRELSHARED-NEXT: Address: 0x1058 -// GOTRELSHARED-NEXT: Offset: 0x1058 +// GOTRELSHARED-NEXT: Address: 0x1060 +// GOTRELSHARED-NEXT: Offset: 0x1060 // GOTRELSHARED-NEXT: Size: 16 // GOTRELSHARED-NEXT: Link: 0 // GOTRELSHARED-NEXT: Info: 0 @@ -31,36 +31,36 @@ // GOTRELSHARED-NEXT: 0x202D R_386_RELATIVE - 0x0 // GOTRELSHARED-NEXT: 0x2036 R_386_RELATIVE - 0x0 // GOTRELSHARED-NEXT: 0x203F R_386_RELATIVE - 0x0 -// GOTRELSHARED-NEXT: 0x1058 R_386_TLS_TPOFF tlslocal0 0x0 -// GOTRELSHARED-NEXT: 0x105C R_386_TLS_TPOFF tlslocal1 0x0 -// GOTRELSHARED-NEXT: 0x1060 R_386_TLS_TPOFF tlsshared0 0x0 -// GOTRELSHARED-NEXT: 0x1064 R_386_TLS_TPOFF tlsshared1 0x0 +// GOTRELSHARED-NEXT: 0x1060 R_386_TLS_TPOFF tlslocal0 0x0 +// GOTRELSHARED-NEXT: 0x1064 R_386_TLS_TPOFF tlslocal1 0x0 +// GOTRELSHARED-NEXT: 0x1068 R_386_TLS_TPOFF tlsshared0 0x0 +// GOTRELSHARED-NEXT: 0x106C R_386_TLS_TPOFF tlsshared1 0x0 // GOTRELSHARED-NEXT: } // GOTRELSHARED-NEXT: ] // GOTRELSHARED: 0x6FFFFFFA RELCOUNT 8 // DISASMSHARED: Disassembly of section test: // DISASMSHARED-NEXT: _start: -// (.got)[0] = 0x2050 = 8272 -// (.got)[1] = 0x2054 = 8276 -// (.got)[2] = 0x2058 = 8280 -// (.got)[3] = 0x205C = 8284 -// DISASMSHARED-NEXT: 2000: 8b 0d 58 10 00 00 movl 4184, %ecx -// DISASMSHARED-NEXT: 2006: 65 8b 01 movl %gs:(%ecx), %eax -// DISASMSHARED-NEXT: 2009: a1 58 10 00 00 movl 4184, %eax -// DISASMSHARED-NEXT: 200e: 65 8b 00 movl %gs:(%eax), %eax -// DISASMSHARED-NEXT: 2011: 03 0d 58 10 00 00 addl 4184, %ecx -// DISASMSHARED-NEXT: 2017: 65 8b 01 movl %gs:(%ecx), %eax -// DISASMSHARED-NEXT: 201a: 8b 0d 5c 10 00 00 movl 4188, %ecx -// DISASMSHARED-NEXT: 2020: 65 8b 01 movl %gs:(%ecx), %eax -// DISASMSHARED-NEXT: 2023: a1 5c 10 00 00 movl 4188, %eax -// DISASMSHARED-NEXT: 2028: 65 8b 00 movl %gs:(%eax), %eax -// DISASMSHARED-NEXT: 202b: 03 0d 5c 10 00 00 addl 4188, %ecx -// DISASMSHARED-NEXT: 2031: 65 8b 01 movl %gs:(%ecx), %eax -// DISASMSHARED-NEXT: 2034: 8b 0d 60 10 00 00 movl 4192, %ecx -// DISASMSHARED-NEXT: 203a: 65 8b 01 movl %gs:(%ecx), %eax -// DISASMSHARED-NEXT: 203d: 03 0d 64 10 00 00 addl 4196, %ecx -// DISASMSHARED-NEXT: 2043: 65 8b 01 movl %gs:(%ecx), %eax +// (.got)[0] = 0x1060 = 4192 +// (.got)[1] = 0x1064 = 4196 +// (.got)[2] = 0x1068 = 4200 +// (.got)[3] = 0x106C = 4204 +// DISASMSHARED-NEXT: 2000: {{.*}} movl 4192, %ecx +// DISASMSHARED-NEXT: 2006: {{.*}} movl %gs:(%ecx), %eax +// DISASMSHARED-NEXT: 2009: {{.*}} movl 4192, %eax +// DISASMSHARED-NEXT: 200e: {{.*}} movl %gs:(%eax), %eax +// DISASMSHARED-NEXT: 2011: {{.*}} addl 4192, %ecx +// DISASMSHARED-NEXT: 2017: {{.*}} movl %gs:(%ecx), %eax +// DISASMSHARED-NEXT: 201a: {{.*}} movl 4196, %ecx +// DISASMSHARED-NEXT: 2020: {{.*}} movl %gs:(%ecx), %eax +// DISASMSHARED-NEXT: 2023: {{.*}} movl 4196, %eax +// DISASMSHARED-NEXT: 2028: {{.*}} movl %gs:(%eax), %eax +// DISASMSHARED-NEXT: 202b: {{.*}} addl 4196, %ecx +// DISASMSHARED-NEXT: 2031: {{.*}} movl %gs:(%ecx), %eax +// DISASMSHARED-NEXT: 2034: {{.*}} movl 4200, %ecx +// DISASMSHARED-NEXT: 203a: {{.*}} movl %gs:(%ecx), %eax +// DISASMSHARED-NEXT: 203d: {{.*}} addl 4204, %ecx +// DISASMSHARED-NEXT: 2043: {{.*}} movl %gs:(%ecx), %eax .type tlslocal0,@object .section .tbss,"awT",@nobits diff --git a/test/ELF/linkerscript/Inputs/compress-debug-sections.s b/test/ELF/linkerscript/Inputs/compress-debug-sections.s new file mode 100644 index 000000000000..703be5949e0d --- /dev/null +++ b/test/ELF/linkerscript/Inputs/compress-debug-sections.s @@ -0,0 +1,3 @@ +.section .debug_str + .asciz "CCC" + .asciz "DDD" diff --git a/test/ELF/linkerscript/compress-debug-sections.s b/test/ELF/linkerscript/compress-debug-sections.s new file mode 100644 index 000000000000..6798a217b5ac --- /dev/null +++ b/test/ELF/linkerscript/compress-debug-sections.s @@ -0,0 +1,36 @@ +# REQUIRES: x86, zlib + +# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux \ +# RUN: %S/Inputs/compress-debug-sections.s -o %t1.o +# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t2.o + +## .debug_str section is mergeable. LLD would combine all of them into single +## mergeable synthetic section. We use -O0 here to disable merging, that +## allows to check that input sections has correctly assigned offsets. + +# RUN: echo "SECTIONS { }" > %t.script +# RUN: ld.lld -O0 %t1.o %t2.o %t.script -o %t1 --compress-debug-sections=zlib +# RUN: llvm-dwarfdump %t1 | FileCheck %s +# RUN: llvm-readobj -s %t1 | FileCheck %s --check-prefix=ZLIBFLAGS + +# RUN: echo "SECTIONS { .debug_str 0 : { *(.debug_str) } }" > %t2.script +# RUN: ld.lld -O0 %t1.o %t2.o %t2.script -o %t2 --compress-debug-sections=zlib +# RUN: llvm-dwarfdump %t2 | FileCheck %s +# RUN: llvm-readobj -s %t2 | FileCheck %s --check-prefix=ZLIBFLAGS + +# CHECK: .debug_str contents: +# CHECK-NEXT: CCC +# CHECK-NEXT: DDD +# CHECK-NEXT: AAA +# CHECK-NEXT: BBB + +# ZLIBFLAGS: Section { +# ZLIBFLAGS: Index: +# ZLIBFLAGS: Name: .debug_str +# ZLIBFLAGS-NEXT: Type: SHT_PROGBITS +# ZLIBFLAGS-NEXT: Flags [ +# ZLIBFLAGS-NEXT: SHF_COMPRESSED + +.section .debug_str + .asciz "AAA" + .asciz "BBB" diff --git a/test/ELF/lto/Inputs/duplicated-name.ll b/test/ELF/lto/Inputs/duplicated-name.ll new file mode 100644 index 000000000000..78678c0c5add --- /dev/null +++ b/test/ELF/lto/Inputs/duplicated-name.ll @@ -0,0 +1,6 @@ +target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-unknown-linux-gnu" + +define void @f2() { + ret void +} diff --git a/test/ELF/lto/archive-no-index.ll b/test/ELF/lto/archive-no-index.ll index 0dca16ba04fb..48cca0aa0794 100644 --- a/test/ELF/lto/archive-no-index.ll +++ b/test/ELF/lto/archive-no-index.ll @@ -4,29 +4,15 @@ ; encountered an empty archive index and undefined references (to prevent ; noisy false alarms). -; RUN: rm -fr %T/archive-no-index -; RUN: mkdir %T/archive-no-index -; RUN: llvm-as %S/Inputs/archive.ll -o %T/archive-no-index/f.o -; RUN: llvm-ar cr %T/archive-no-index/libf.a -; RUN: llvm-ar qS %T/archive-no-index/libf.a %T/archive-no-index/f.o -; RUN: llvm-as %s -o %t.o -; RUN: not ld.lld -emain -m elf_x86_64 %t.o -o %t %T/archive-no-index/libf.a \ -; RUN: 2>&1 | FileCheck --check-prefix=NOTE %s +; RUN: llvm-as -o %t1.o %s +; RUN: llvm-as -o %t2.o %S/Inputs/archive.ll -; RUN: llvm-ar crs %T/archive-no-index/libfs.a %T/archive-no-index/f.o -; RUN: ld.lld -emain -m elf_x86_64 %t.o -o %t %T/archive-no-index/libf.a \ -; RUN: %T/archive-no-index/libfs.a +; RUN: rm -f %t1.a %t2.a +; RUN: llvm-ar crS %t1.a %t2.o +; RUN: llvm-ar crs %t2.a %t2.o -; RUN: llvm-as %S/Inputs/archive-3.ll -o %T/archive-no-index/foo.o -; RUN: llvm-ar crs %T/archive-no-index/libfoo.a %T/archive-no-index/foo.o -; RUN: not ld.lld -emain -m elf_x86_64 %t.o -o %t %T/archive-no-index/libfoo.a \ -; RUN: 2>&1 | FileCheck --check-prefix=NO-NOTE %s - -; NOTE: undefined symbol: f -; NOTE: archive listed no symbols - -; NO-NOTE: undefined symbol: f -; NO-NOTE-NOT: archive listed no symbols +; RUN: ld.lld -o %t -emain -m elf_x86_64 %t1.o %t1.a +; RUN: ld.lld -o %t -emain -m elf_x86_64 %t1.o %t2.a target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-unknown-linux-gnu" diff --git a/test/ELF/lto/duplicated-name.ll b/test/ELF/lto/duplicated-name.ll new file mode 100644 index 000000000000..b9e6c54564bc --- /dev/null +++ b/test/ELF/lto/duplicated-name.ll @@ -0,0 +1,15 @@ +; REQUIRES: x86 +; Cretae two archive with the same member name +; RUN: rm -f %t1.a %t2.a +; RUN: opt -module-summary %s -o %t.o +; RUN: llvm-ar rcS %t1.a %t.o +; RUN: opt -module-summary %p/Inputs/duplicated-name.ll -o %t.o +; RUN: llvm-ar rcS %t2.a %t.o +; RUN: ld.lld -m elf_x86_64 -shared -o %t.so -uf1 -uf2 %t1.a %t2.a + +target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-unknown-linux-gnu" + +define void @f1() { + ret void +} diff --git a/test/ELF/lto/thin-archivecollision.ll b/test/ELF/lto/thin-archivecollision.ll index 4e07187f36a0..f1dd5ae4d85f 100644 --- a/test/ELF/lto/thin-archivecollision.ll +++ b/test/ELF/lto/thin-archivecollision.ll @@ -1,14 +1,21 @@ ; RUN: opt -module-summary %s -o %t.o -; RUN: opt -module-summary %p/Inputs/thin1.ll -o %t.coll.o -; RUN: llvm-ar rcs %t1.a %t.coll.o -; RUN: opt -module-summary %p/Inputs/thin2.ll -o %t.coll.o -; RUN: llvm-ar rcsc %t2.a %t.coll.o +; RUN: mkdir -p %t1 %t2 +; RUN: opt -module-summary %p/Inputs/thin1.ll -o %t1/t.coll.o +; RUN: opt -module-summary %p/Inputs/thin2.ll -o %t2/t.coll.o -; RUN: ld.lld %t.o %t1.a %t2.a -o %t +; RUN: rm -f %t.a +; RUN: llvm-ar rcs %t.a %t1/t.coll.o %t2/t.coll.o +; RUN: ld.lld %t.o %t.a -o %t +; RUN: llvm-nm %t | FileCheck %s + +; Check without a archive symbol table +; RUN: rm -f %t.a +; RUN: llvm-ar rcS %t.a %t1/t.coll.o %t2/t.coll.o +; RUN: ld.lld %t.o %t.a -o %t ; RUN: llvm-nm %t | FileCheck %s ; Check we handle this case correctly even in presence of --whole-archive. -; RUN: ld.lld %t.o --whole-archive %t1.a %t2.a -o %t +; RUN: ld.lld %t.o --whole-archive %t.a -o %t ; RUN: llvm-nm %t | FileCheck %s ; CHECK: T _start diff --git a/test/ELF/tls-dynamic-i686.s b/test/ELF/tls-dynamic-i686.s index ac88e6eaed31..04fd13822530 100644 --- a/test/ELF/tls-dynamic-i686.s +++ b/test/ELF/tls-dynamic-i686.s @@ -56,8 +56,8 @@ addl tls1@gotntpoff(%ebx),%eax // CHECK-NEXT: SHF_ALLOC // CHECK-NEXT: SHF_WRITE // CHECK-NEXT: ] -// CHECK-NEXT: Address: 0x3068 -// CHECK-NEXT: Offset: 0x3068 +// CHECK-NEXT: Address: 0x3070 +// CHECK-NEXT: Offset: 0x3070 // CHECK-NEXT: Size: 32 // CHECK-NEXT: Link: 0 // CHECK-NEXT: Info: 0 @@ -66,13 +66,13 @@ addl tls1@gotntpoff(%ebx),%eax // CHECK: Relocations [ // CHECK: Section ({{.+}}) .rel.dyn { -// CHECK-NEXT: 0x3078 R_386_TLS_DTPMOD32 - 0x0 -// CHECK-NEXT: 0x3068 R_386_TLS_DTPMOD32 tls0 0x0 -// CHECK-NEXT: 0x306C R_386_TLS_DTPOFF32 tls0 0x0 -// CHECK-NEXT: 0x3080 R_386_TLS_TPOFF tls0 0x0 -// CHECK-NEXT: 0x3070 R_386_TLS_DTPMOD32 tls1 0x0 -// CHECK-NEXT: 0x3074 R_386_TLS_DTPOFF32 tls1 0x0 -// CHECK-NEXT: 0x3084 R_386_TLS_TPOFF tls1 0x0 +// CHECK-NEXT: 0x3080 R_386_TLS_DTPMOD32 - 0x0 +// CHECK-NEXT: 0x3070 R_386_TLS_DTPMOD32 tls0 0x0 +// CHECK-NEXT: 0x3074 R_386_TLS_DTPOFF32 tls0 0x0 +// CHECK-NEXT: 0x3088 R_386_TLS_TPOFF tls0 0x0 +// CHECK-NEXT: 0x3078 R_386_TLS_DTPMOD32 tls1 0x0 +// CHECK-NEXT: 0x307C R_386_TLS_DTPOFF32 tls1 0x0 +// CHECK-NEXT: 0x308C R_386_TLS_TPOFF tls1 0x0 // CHECK-NEXT: } // DIS: Disassembly of section .text: @@ -80,20 +80,20 @@ addl tls1@gotntpoff(%ebx),%eax // General dynamic model: // -32 and -24 are first and second GOT entries offsets. // Each one is a pair of records. -// DIS-NEXT: 1000: 8d 04 1d e0 ff ff ff leal -32(,%ebx), %eax -// DIS-NEXT: 1007: e8 64 00 00 00 calll 100 -// DIS-NEXT: 100c: 8d 04 1d e8 ff ff ff leal -24(,%ebx), %eax -// DIS-NEXT: 1013: e8 58 00 00 00 calll 88 +// DIS-NEXT: 1000: {{.*}} leal -32(,%ebx), %eax +// DIS-NEXT: 1007: {{.*}} calll 100 +// DIS-NEXT: 100c: {{.*}} leal -24(,%ebx), %eax +// DIS-NEXT: 1013: {{.*}} calll 88 // Local dynamic model: // -16 is a local module tls index offset. -// DIS-NEXT: 1018: 8d 83 f0 ff ff ff leal -16(%ebx), %eax -// DIS-NEXT: 101e: e8 4d 00 00 00 calll 77 -// DIS-NEXT: 1023: 8d 90 08 00 00 00 leal 8(%eax), %edx -// DIS-NEXT: 1029: 8d 83 f0 ff ff ff leal -16(%ebx), %eax -// DIS-NEXT: 102f: e8 3c 00 00 00 calll 60 -// DIS-NEXT: 1034: 8d 90 0c 00 00 00 leal 12(%eax), %edx +// DIS-NEXT: 1018: {{.*}} leal -16(%ebx), %eax +// DIS-NEXT: 101e: {{.*}} calll 77 +// DIS-NEXT: 1023: {{.*}} leal 8(%eax), %edx +// DIS-NEXT: 1029: {{.*}} leal -16(%ebx), %eax +// DIS-NEXT: 102f: {{.*}} calll 60 +// DIS-NEXT: 1034: {{.*}} leal 12(%eax), %edx // Initial exec model: -// DIS-NEXT: 103a: 65 a1 00 00 00 00 movl %gs:0, %eax -// DIS-NEXT: 1040: 03 83 f8 ff ff ff addl -8(%ebx), %eax -// DIS-NEXT: 1046: 65 a1 00 00 00 00 movl %gs:0, %eax -// DIS-NEXT: 104c: 03 83 fc ff ff ff addl -4(%ebx), %eax +// DIS-NEXT: 103a: {{.*}} movl %gs:0, %eax +// DIS-NEXT: 1040: {{.*}} addl -8(%ebx), %eax +// DIS-NEXT: 1046: {{.*}} movl %gs:0, %eax +// DIS-NEXT: 104c: {{.*}} addl -4(%ebx), %eax diff --git a/test/ELF/tls-offset.s b/test/ELF/tls-offset.s index 062def4e14fc..75d9af7f5b72 100644 --- a/test/ELF/tls-offset.s +++ b/test/ELF/tls-offset.s @@ -10,7 +10,7 @@ // RUN: .tbss : { *(.tbss) } \ // RUN: .data.rel.ro : { *(.data.rel.ro) } \ // RUN: }" > %t.script - // RUN: ld.lld -T %t.script %t -o %tout2 +// RUN: ld.lld -T %t.script %t -o %tout2 // RUN: echo SCRIPT // RUN: llvm-readobj -s %tout2 | FileCheck %s .global _start @@ -61,6 +61,6 @@ _start: // CHECK-NEXT: SHF_ALLOC // CHECK-NEXT: SHF_WRITE // CHECK-NEXT: ] -// CHECK-NEXT: Address: 0x202010 -// CHECK-NEXT: Offset: 0x2010 +// CHECK-NEXT: Address: 0x202004 +// CHECK-NEXT: Offset: 0x2004 // CHECK-NEXT: Size: 4 diff --git a/test/ELF/tls-opt-iele-i686-nopic.s b/test/ELF/tls-opt-iele-i686-nopic.s index b6608c16551c..a883bce511a6 100644 --- a/test/ELF/tls-opt-iele-i686-nopic.s +++ b/test/ELF/tls-opt-iele-i686-nopic.s @@ -13,8 +13,8 @@ // GOTREL-NEXT: SHF_ALLOC // GOTREL-NEXT: SHF_WRITE // GOTREL-NEXT: ] -// GOTREL-NEXT: Address: 0x12058 -// GOTREL-NEXT: Offset: 0x2058 +// GOTREL-NEXT: Address: 0x12060 +// GOTREL-NEXT: Offset: 0x2060 // GOTREL-NEXT: Size: 8 // GOTREL-NEXT: Link: 0 // GOTREL-NEXT: Info: 0 @@ -23,8 +23,8 @@ // GOTREL-NEXT: } // GOTREL: Relocations [ // GOTREL-NEXT: Section ({{.*}}) .rel.dyn { -// GOTREL-NEXT: 0x12058 R_386_TLS_TPOFF tlsshared0 0x0 -// GOTREL-NEXT: 0x1205C R_386_TLS_TPOFF tlsshared1 0x0 +// GOTREL-NEXT: 0x12060 R_386_TLS_TPOFF tlsshared0 0x0 +// GOTREL-NEXT: 0x12064 R_386_TLS_TPOFF tlsshared1 0x0 // GOTREL-NEXT: } // GOTREL-NEXT: ] @@ -32,24 +32,24 @@ // DISASM-NEXT: _start: // 4294967288 = 0xFFFFFFF8 // 4294967292 = 0xFFFFFFFC -// 73808 = (.got)[0] = 0x12058 -// 73812 = (.got)[1] = 0x1205C -// DISASM-NEXT: 11000: c7 c1 f8 ff ff ff movl $4294967288, %ecx -// DISASM-NEXT: 11006: 65 8b 01 movl %gs:(%ecx), %eax -// DISASM-NEXT: 11009: b8 f8 ff ff ff movl $4294967288, %eax -// DISASM-NEXT: 1100e: 65 8b 00 movl %gs:(%eax), %eax -// DISASM-NEXT: 11011: 81 c1 f8 ff ff ff addl $4294967288, %ecx -// DISASM-NEXT: 11017: 65 8b 01 movl %gs:(%ecx), %eax -// DISASM-NEXT: 1101a: c7 c1 fc ff ff ff movl $4294967292, %ecx -// DISASM-NEXT: 11020: 65 8b 01 movl %gs:(%ecx), %eax -// DISASM-NEXT: 11023: b8 fc ff ff ff movl $4294967292, %eax -// DISASM-NEXT: 11028: 65 8b 00 movl %gs:(%eax), %eax -// DISASM-NEXT: 1102b: 81 c1 fc ff ff ff addl $4294967292, %ecx -// DISASM-NEXT: 11031: 65 8b 01 movl %gs:(%ecx), %eax -// DISASM-NEXT: 11034: 8b 0d 58 20 01 00 movl 73816, %ecx -// DISASM-NEXT: 1103a: 65 8b 01 movl %gs:(%ecx), %eax -// DISASM-NEXT: 1103d: 03 0d 5c 20 01 00 addl 73820, %ecx -// DISASM-NEXT: 11043: 65 8b 01 movl %gs:(%ecx), %eax +// 73824 = (.got)[0] = 0x12060 +// 73828 = (.got)[1] = 0x12064 +// DISASM-NEXT: 11000: {{.*}} movl $4294967288, %ecx +// DISASM-NEXT: 11006: {{.*}} movl %gs:(%ecx), %eax +// DISASM-NEXT: 11009: {{.*}} movl $4294967288, %eax +// DISASM-NEXT: 1100e: {{.*}} movl %gs:(%eax), %eax +// DISASM-NEXT: 11011: {{.*}} addl $4294967288, %ecx +// DISASM-NEXT: 11017: {{.*}} movl %gs:(%ecx), %eax +// DISASM-NEXT: 1101a: {{.*}} movl $4294967292, %ecx +// DISASM-NEXT: 11020: {{.*}} movl %gs:(%ecx), %eax +// DISASM-NEXT: 11023: {{.*}} movl $4294967292, %eax +// DISASM-NEXT: 11028: {{.*}} movl %gs:(%eax), %eax +// DISASM-NEXT: 1102b: {{.*}} addl $4294967292, %ecx +// DISASM-NEXT: 11031: {{.*}} movl %gs:(%ecx), %eax +// DISASM-NEXT: 11034: {{.*}} movl 73824, %ecx +// DISASM-NEXT: 1103a: {{.*}} movl %gs:(%ecx), %eax +// DISASM-NEXT: 1103d: {{.*}} addl 73828, %ecx +// DISASM-NEXT: 11043: {{.*}} movl %gs:(%ecx), %eax .type tlslocal0,@object .section .tbss,"awT",@nobits |