[PATCH 01/11] s390: Cleanup linker TLS tests
Jens Remus
jremus@linux.ibm.com
Thu Nov 13 13:21:34 GMT 2025
ld/testsuite/
* ld-s390/s390.exp: Prefix "TLS" to "TLS helper shared library"
test names.
* ld-s390/tlsbin.dd: Align case of comments (mostly lower case).
* ld-s390/tlsbin_64.dd: Add missing comment to test.
* ld-s390/tlsbinpic.s: Remove duplicate .hidden directive.
Remove trailing spaces.
* ld-s390/tlsbinpic_64.s: Likewise.
* ld-s390/tlslib.s: Remove trailing comma from .globl directive.
* ld-s390/tlslib_64.s: Likewise.
* ld-s390/tlspic1.s: Remove trailing spaces.
* ld-s390/tlspic1_64.s: Likewise.
Signed-off-by: Jens Remus <jremus@linux.ibm.com>
---
ld/testsuite/ld-s390/s390.exp | 4 ++--
ld/testsuite/ld-s390/tlsbin.dd | 4 ++--
ld/testsuite/ld-s390/tlsbin_64.dd | 1 +
ld/testsuite/ld-s390/tlsbinpic.s | 3 +--
ld/testsuite/ld-s390/tlsbinpic_64.s | 3 +--
ld/testsuite/ld-s390/tlslib.s | 2 +-
ld/testsuite/ld-s390/tlslib_64.s | 2 +-
ld/testsuite/ld-s390/tlspic1.s | 9 ++++-----
ld/testsuite/ld-s390/tlspic1_64.s | 9 ++++-----
9 files changed, 17 insertions(+), 20 deletions(-)
diff --git a/ld/testsuite/ld-s390/s390.exp b/ld/testsuite/ld-s390/s390.exp
index 014754f94862..74dd20b7d43c 100644
--- a/ld/testsuite/ld-s390/s390.exp
+++ b/ld/testsuite/ld-s390/s390.exp
@@ -41,7 +41,7 @@ set s390tests {
{{readelf -Ssrl tlspic.rd} {objdump -dzrj.text tlspic.dd}
{objdump -sj.got tlspic.sd} {objdump -sj.tdata tlspic.td}}
"libtlspic.so"}
- {"Helper shared library" "-shared -melf_s390" ""
+ {"TLS helper shared library" "-shared -melf_s390" ""
"-m31" {tlslib.s} {} "libtlslib.so"}
{"TLS -fpic and -fno-pic exec transitions"
"-melf_s390 tmpdir/libtlslib.so --hash-style=sysv" ""
@@ -89,7 +89,7 @@ set s390xtests {
{{readelf -WSsrl tlspic_64.rd} {objdump -dzrj.text tlspic_64.dd}
{objdump -sj.got tlspic_64.sd} {objdump -sj.tdata tlspic_64.td}}
"libtlspic_64.so"}
- {"Helper shared library" "-shared -melf64_s390" ""
+ {"TLS helper shared library" "-shared -melf64_s390" ""
"-m64 -Aesame" {tlslib_64.s} {} "libtlslib_64.so"}
{"TLS -fpic and -fno-pic exec transitions"
"-melf64_s390 tmpdir/libtlslib_64.so --hash-style=sysv --no-ld-generated-unwind-info" ""
diff --git a/ld/testsuite/ld-s390/tlsbin.dd b/ld/testsuite/ld-s390/tlsbin.dd
index 2d6a34ef2c47..bfa4a17c7f36 100644
--- a/ld/testsuite/ld-s390/tlsbin.dd
+++ b/ld/testsuite/ld-s390/tlsbin.dd
@@ -62,7 +62,7 @@ Disassembly of section .text:
+[0-9a-f]+: a7 fa ff a0 ahi %r15,-96
+[0-9a-f]+: 41 cc d0 00 la %r12,0\(%r12,%r13\)
+[0-9a-f]+: 50 e0 e0 00 st %r14,0\(%r14\)
-# Extract TCB and load branch offset
+# extract TCB and load branch offset
+[0-9a-f]+: b2 4f 00 90 ear %r9,%a0
+[0-9a-f]+: 58 70 d0 04 l %r7,4\(%r13\)
# GD -> IE because variable is not defined in executable
@@ -164,7 +164,7 @@ Disassembly of section .text:
+[0-9a-f]+: 18 ef lr %r14,%r15
+[0-9a-f]+: a7 fa ff a0 ahi %r15,-96
+[0-9a-f]+: 50 e0 e0 00 st %r14,0\(%r14\)
-# Extract TCB
+# extract TCB
+[0-9a-f]+: b2 4f 00 90 ear %r9,%a0
# IE against global var
+[0-9a-f]+: 58 30 d0 00 l %r3,0\(%r13\)
diff --git a/ld/testsuite/ld-s390/tlsbin_64.dd b/ld/testsuite/ld-s390/tlsbin_64.dd
index 124c268b5646..7f820e587e0b 100644
--- a/ld/testsuite/ld-s390/tlsbin_64.dd
+++ b/ld/testsuite/ld-s390/tlsbin_64.dd
@@ -105,6 +105,7 @@ Disassembly of section .text:
+[0-9a-f]+: 41 54 30 00 la %r5,0\(%r4,%r3\)
+[0-9a-f]+: e3 40 d0 38 00 04 lg %r4,56\(%r13\)
+[0-9a-f]+: 41 54 30 00 la %r5,0\(%r4,%r3\)
+# LD -> LE against hidden variables
+[0-9a-f]+: e3 20 d0 40 00 04 lg %r2,64\(%r13\)
+[0-9a-f]+: c0 04 00 00 00 00 jgnop [0-9a-f]+ <fn2\+0x11e>
+[0-9a-f]+: 41 32 90 00 la %r3,0\(%r2,%r9\)
diff --git a/ld/testsuite/ld-s390/tlsbinpic.s b/ld/testsuite/ld-s390/tlsbinpic.s
index e52e3a4a064b..8600fa6ad958 100644
--- a/ld/testsuite/ld-s390/tlsbinpic.s
+++ b/ld/testsuite/ld-s390/tlsbinpic.s
@@ -3,7 +3,6 @@
.globl sg1, sg2, sg3, sg4, sg5, sg6, sg7, sg8
.globl sh1, sh2, sh3, sh4, sh5, sh6, sh7, sh8
.hidden sh1, sh2, sh3, sh4, sh5, sh6, sh7, sh8
- .hidden sh1, sh2
sg1: .long 17
sg2: .long 18
sg3: .long 19
@@ -83,7 +82,7 @@ fn2:
/* Extract TCB and load branch offset */
ear %r9,%a0
l %r7,.LC1-.LT1(%r13)
-
+
/* GD -> IE because variable is not defined in executable */
l %r2,.LC2-.LT1(%r13)
bas %r14,0(%r7,%r13):tls_gdcall:sG1
diff --git a/ld/testsuite/ld-s390/tlsbinpic_64.s b/ld/testsuite/ld-s390/tlsbinpic_64.s
index eeda6caaa133..99bca2437276 100644
--- a/ld/testsuite/ld-s390/tlsbinpic_64.s
+++ b/ld/testsuite/ld-s390/tlsbinpic_64.s
@@ -3,7 +3,6 @@
.globl sg1, sg2, sg3, sg4, sg5, sg6, sg7, sg8
.globl sh1, sh2, sh3, sh4, sh5, sh6, sh7, sh8
.hidden sh1, sh2, sh3, sh4, sh5, sh6, sh7, sh8
- .hidden sh1, sh2
sg1: .long 17
sg2: .long 18
sg3: .long 19
@@ -158,7 +157,7 @@ fn2:
larl %r3,sl3@indntpoff
lg %r4,0(%r3,%r12):tls_load:sl3
la %r5,0(%r4,%r9)
-
+
/* IE against hidden var with larl got access */
larl %r3,sh3@indntpoff
lg %r4,0(%r3,%r12):tls_load:sh3
diff --git a/ld/testsuite/ld-s390/tlslib.s b/ld/testsuite/ld-s390/tlslib.s
index 3ec87c22f9d4..301f15f60de2 100644
--- a/ld/testsuite/ld-s390/tlslib.s
+++ b/ld/testsuite/ld-s390/tlslib.s
@@ -1,5 +1,5 @@
.section ".tdata", "awT", @progbits
- .globl sG1, sG2, sG3, sG4, sG5, sG6, sG7, sG8,
+ .globl sG1, sG2, sG3, sG4, sG5, sG6, sG7, sG8
sG1: .long 513
sG2: .long 514
sG3: .long 515
diff --git a/ld/testsuite/ld-s390/tlslib_64.s b/ld/testsuite/ld-s390/tlslib_64.s
index 3ec87c22f9d4..301f15f60de2 100644
--- a/ld/testsuite/ld-s390/tlslib_64.s
+++ b/ld/testsuite/ld-s390/tlslib_64.s
@@ -1,5 +1,5 @@
.section ".tdata", "awT", @progbits
- .globl sG1, sG2, sG3, sG4, sG5, sG6, sG7, sG8,
+ .globl sG1, sG2, sG3, sG4, sG5, sG6, sG7, sG8
sG1: .long 513
sG2: .long 514
sG3: .long 515
diff --git a/ld/testsuite/ld-s390/tlspic1.s b/ld/testsuite/ld-s390/tlspic1.s
index e423985ae00b..ba64e99ea907 100644
--- a/ld/testsuite/ld-s390/tlspic1.s
+++ b/ld/testsuite/ld-s390/tlspic1.s
@@ -109,7 +109,7 @@ fn1:
l %r2,.LC4-.LT1(%r13)
bas %r14,0(%r7,%r13):tls_gdcall:sl1
la %r2,0(%r2,%r9)
-
+
/* GD -> IE against local variable referenced through IE too */
l %r2,.LC5-.LT1(%r13)
bas %r14,0(%r7,%r13):tls_gdcall:sl2
@@ -119,7 +119,7 @@ fn1:
l %r2,.LC6-.LT1(%r13)
bas %r14,0(%r7,%r13):tls_gdcall:sh1
la %r2,0(%r2,%r9)
-
+
/* GD -> IE against hidden and local variable referenced through
IE too */
l %r2,.LC7-.LT1(%r13)
@@ -154,7 +154,7 @@ fn1:
la %r5,0(%r4,%r3)
l %r4,.LC13-.LT1(%r13)
la %r5,0(%r5,%r3)
-
+
/* LD against hidden but not local variables */
l %r2,.LC16-.LT1(%r13)
bas %r14,0(%r7,%r13):tls_ldcall:sH1
@@ -178,7 +178,7 @@ fn1:
l %r3,.LC21-.LT1(%r13)
l %r4,0(%r3,%r12):tls_load:sh2
la %r5,0(%r4,%r3)
-
+
/* IE against hidden but not local var */
l %r3,.LC22-.LT1(%r13)
l %r4,0(%r3,%r12):tls_load:sH2
@@ -205,4 +205,3 @@ fn1:
/* Function epilog */
lm %r6,%r14,120(%r15)
br %r14
-
diff --git a/ld/testsuite/ld-s390/tlspic1_64.s b/ld/testsuite/ld-s390/tlspic1_64.s
index 31abd78f8a74..ad0e691ac334 100644
--- a/ld/testsuite/ld-s390/tlspic1_64.s
+++ b/ld/testsuite/ld-s390/tlspic1_64.s
@@ -115,7 +115,7 @@ fn1:
lg %r2,.LC6-.LT1(%r13)
brasl %r14,__tls_get_offset@plt:tls_gdcall:sh1
la %r2,0(%r2,%r9)
-
+
/* GD -> IE against hidden and local variable referenced through
IE too */
lg %r2,.LC7-.LT1(%r13)
@@ -150,7 +150,7 @@ fn1:
la %r5,0(%r4,%r3)
lg %r4,.LC15-.LT1(%r13)
la %r5,0(%r4,%r3)
-
+
/* LD against hidden but not local variables */
lg %r2,.LC16-.LT1(%r13)
brasl %r14,__tls_get_offset@plt:tls_ldcall:sH1
@@ -174,7 +174,7 @@ fn1:
lg %r3,.LC21-.LT1(%r13)
lg %r4,0(%r3,%r12):tls_load:sh2
la %r5,0(%r4,%r9)
-
+
/* IE against hidden but not local var */
lg %r3,.LC22-.LT1(%r13)
lg %r4,0(%r3,%r12):tls_load:sH2
@@ -194,7 +194,7 @@ fn1:
larl %r3,sh5@indntpoff
lg %r4,0(%r3,%r12):tls_load:sh2
la %r5,0(%r4,%r9)
-
+
/* IE against hidden but not local var with larl got access */
larl %r3,sH5@indntpoff
lg %r4,0(%r3,%r12):tls_load:sH2
@@ -221,4 +221,3 @@ fn1:
/* Function epilog */
lmg %r6,%r14,208(%r15)
br %r14
-
--
2.48.1
More information about the Binutils
mailing list