diff options
Diffstat (limited to 'binutils-2.21/ld/testsuite/ld-s390')
27 files changed, 2580 insertions, 0 deletions
diff --git a/binutils-2.21/ld/testsuite/ld-s390/s390.exp b/binutils-2.21/ld/testsuite/ld-s390/s390.exp new file mode 100644 index 0000000..fe0a6c1 --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-s390/s390.exp @@ -0,0 +1,75 @@ +# Expect script for ld-s390 tests +# Copyright (C) 2003, 2005, 2007 Free Software Foundation +# +# This file is part of the GNU Binutils. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, +# MA 02110-1301, USA. +# + +# Test s390 linking; all types of relocs. This tests the assembler and +# tools like objdump as well as the linker. + +if { !([istarget "s390-*-*"] || [istarget "s390x-*-*"]) } { + return +} + +# List contains test-items with 3 items followed by 2 lists: +# 0:name 1:ld options 2:assembler options +# 3:filenames of assembler files 4: action and options. 5: name of output file + +# Actions: +# objdump: Apply objdump options on result. Compare with regex (last arg). +# nm: Apply nm options on result. Compare with regex (last arg). +# readelf: Apply readelf options on result. Compare with regex (last arg). + +set s390tests { + {"TLS -fpic -shared transitions" "-shared -melf_s390" + "-m31" {tlspic1.s tlspic2.s} + {{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" + "-m31" {tlslib.s} {} "libtlslib.so"} + {"TLS -fpic and -fno-pic exec transitions" + "-melf_s390 tmpdir/libtlslib.so" "-m31" {tlsbinpic.s tlsbin.s} + {{readelf -Ssrl tlsbin.rd} {objdump -dzrj.text tlsbin.dd} + {objdump -sj.got tlsbin.sd} {objdump -sj.tdata tlsbin.td}} + "tlsbin"} +} + +set s390xtests { + {"TLS -fpic -shared transitions" "-shared -melf64_s390" + "-m64 -Aesame" {tlspic1_64.s tlspic2_64.s} + {{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" + "-m64 -Aesame" {tlslib_64.s} {} "libtlslib_64.so"} + {"TLS -fpic and -fno-pic exec transitions" + "-melf64_s390 tmpdir/libtlslib_64.so" "-m64 -Aesame" + {tlsbinpic_64.s tlsbin_64.s} + {{readelf -WSsrl tlsbin_64.rd} {objdump -dzrj.text tlsbin_64.dd} + {objdump -sj.got tlsbin_64.sd} {objdump -sj.tdata tlsbin_64.td}} + "tlsbin_64"} +} + +if [istarget "s390-*-*"] { + run_ld_link_tests $s390tests +} + +if [istarget "s390x-*-*"] { + run_ld_link_tests $s390xtests +} diff --git a/binutils-2.21/ld/testsuite/ld-s390/tlsbin.dd b/binutils-2.21/ld/testsuite/ld-s390/tlsbin.dd new file mode 100644 index 0000000..0e824da --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-s390/tlsbin.dd @@ -0,0 +1,193 @@ +#source: tlsbinpic.s +#source: tlsbin.s +#as: -m31 +#ld: -shared -melf_s390 +#objdump: -dzrj.text +#target: s390-*-* + +# PT_TLS layout is: +# Offset from Offset from Name +# TCB base TCB end +# 0x00 -0xa0 sg1..sg2 +# 0x20 -0x80 sl1..sl2 +# 0x40 -0x60 sh1..sh2 +# 0x60 -0x40 bg1..bg2 +# 0x80 -0x20 bl1..bl2 + +.*: +file format elf32-s390 + +Disassembly of section .text: + +0+[0-9a-f]+ <fn2>: +# function prolog + +[0-9a-f]+: 90 6e f0 18 stm %r6,%r14,24\(%r15\) + +[0-9a-f]+: a7 d5 00 24 bras %r13,[0-9a-f]+ <fn2\+0x4c> +# _GLOBAL_OFFSET_TABLE_ + +[0-9a-f]+: [0-9a-f ]+ .long 0x[0-9a-f]+ +# __tls_get_addr@plt-.LT1 + +[0-9a-f]+: [0-9a-f ]+ .long 0x[0-9a-f]+ +# sG1@tlsgd + +[0-9a-f]+: 00 00 00 28 .long 0x00000028 +# sG2@tlsgd + +[0-9a-f]+: 00 00 00 20 .long 0x00000020 +# sg1@tlsgd + +[0-9a-f]+: ff ff ff 60 .long 0xffffff60 +# sl1@tlsgd + +[0-9a-f]+: ff ff ff 80 .long 0xffffff80 +# sh1@tlsgd + +[0-9a-f]+: ff ff ff a0 .long 0xffffffa0 +# sl1@tlsldm + +[0-9a-f]+: 00 00 00 00 .long 0x00000000 +# sl1@dtpoff + +[0-9a-f]+: ff ff ff 80 .long 0xffffff80 +# sl2@dtpoff + +[0-9a-f]+: ff ff ff 84 .long 0xffffff84 +# sh1@tlsldm + +[0-9a-f]+: 00 00 00 00 .long 0x00000000 +# sh1@dtpoff + +[0-9a-f]+: ff ff ff a0 .long 0xffffffa0 +# sh2@dtpoff + +[0-9a-f]+: ff ff ff a4 .long 0xffffffa4 +# sG2@gotntpoff + +[0-9a-f]+: 00 00 00 20 .long 0x00000020 +# sg1@gotntpoff + +[0-9a-f]+: ff ff ff 60 .long 0xffffff60 +# sl1@gotntpoff + +[0-9a-f]+: ff ff ff 80 .long 0xffffff80 +# sh1@gotntpoff + +[0-9a-f]+: ff ff ff a0 .long 0xffffffa0 +# function prolog + +[0-9a-f]+: 18 ef lr %r14,%r15 + +[0-9a-f]+: 58 c0 d0 00 l %r12,0\(%r13\) + +[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 + +[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 + +[0-9a-f]+: 58 20 d0 08 l %r2,8\(%r13\) + +[0-9a-f]+: 58 22 c0 00 l %r2,0\(%r2,%r12\) + +[0-9a-f]+: 41 22 90 00 la %r2,0\(%r2,%r9\) +# GD -> IE because variable is not defined in executable where +# the variable is referenced through IE too + +[0-9a-f]+: 58 20 d0 0c l %r2,12\(%r13\) + +[0-9a-f]+: 58 22 c0 00 l %r2,0\(%r2,%r12\) + +[0-9a-f]+: 41 22 90 00 la %r2,0\(%r2,%r9\) +# GD -> LE with global variable defined in executable + +[0-9a-f]+: 58 20 d0 10 l %r2,16\(%r13\) + +[0-9a-f]+: 47 00 00 00 nop 0 + +[0-9a-f]+: 41 22 90 00 la %r2,0\(%r2,%r9\) +# GD -> LE with local variable defined in executable + +[0-9a-f]+: 58 20 d0 14 l %r2,20\(%r13\) + +[0-9a-f]+: 47 00 00 00 nop 0 + +[0-9a-f]+: 41 22 90 00 la %r2,0\(%r2,%r9\) +# GD -> LE with hidden variable defined in executable + +[0-9a-f]+: 58 20 d0 18 l %r2,24\(%r13\) + +[0-9a-f]+: 47 00 00 00 nop 0 + +[0-9a-f]+: 41 22 90 00 la %r2,0\(%r2,%r9\) +# LD -> LE + +[0-9a-f]+: 58 20 d0 1c l %r2,28\(%r13\) + +[0-9a-f]+: 47 00 00 00 nop 0 + +[0-9a-f]+: 41 32 90 00 la %r3,0\(%r2,%r9\) + +[0-9a-f]+: 58 40 d0 20 l %r4,32\(%r13\) + +[0-9a-f]+: 41 54 30 00 la %r5,0\(%r4,%r3\) + +[0-9a-f]+: 58 40 d0 24 l %r4,36\(%r13\) + +[0-9a-f]+: 41 54 30 00 la %r5,0\(%r4,%r3\) +# LD -> LE against hidden variables + +[0-9a-f]+: 58 20 d0 28 l %r2,40\(%r13\) + +[0-9a-f]+: 47 00 00 00 nop 0 + +[0-9a-f]+: 41 32 90 00 la %r3,0\(%r2,%r9\) + +[0-9a-f]+: 58 40 d0 2c l %r4,44\(%r13\) + +[0-9a-f]+: 41 54 30 00 la %r5,0\(%r4,%r3\) + +[0-9a-f]+: 58 40 d0 30 l %r4,48\(%r13\) + +[0-9a-f]+: 41 54 30 00 la %r5,0\(%r4,%r3\) +# IE against global var + +[0-9a-f]+: 58 30 d0 34 l %r3,52\(%r13\) + +[0-9a-f]+: 58 33 c0 00 l %r3,0\(%r3,%r12\) + +[0-9a-f]+: 58 33 90 00 l %r3,0\(%r3,%r9\) +# IE -> LE against global var defined in exec + +[0-9a-f]+: 58 30 d0 38 l %r3,56\(%r13\) + +[0-9a-f]+: 18 43 lr %r4,%r3 + +[0-9a-f]+: 07 00 nopr %r0 + +[0-9a-f]+: 41 54 90 00 la %r5,0\(%r4,%r9\) +# IE -> LE against local var + +[0-9a-f]+: 58 30 d0 3c l %r3,60\(%r13\) + +[0-9a-f]+: 18 43 lr %r4,%r3 + +[0-9a-f]+: 07 00 nopr %r0 + +[0-9a-f]+: 41 54 90 00 la %r5,0\(%r4,%r9\) +# IE -> LE against hidden var + +[0-9a-f]+: 58 30 d0 40 l %r3,64\(%r13\) + +[0-9a-f]+: 18 43 lr %r4,%r3 + +[0-9a-f]+: 07 00 nopr %r0 + +[0-9a-f]+: 41 54 90 00 la %r5,0\(%r4,%r9\) +# IE against global var with small got access (no optimization) + +[0-9a-f]+: 58 30 c0 14 l %r3,20\(%r12\) + +[0-9a-f]+: 41 33 90 00 la %r3,0\(%r3,%r9\) +# IE against global var defined in exec with small got access +# (no optimization) + +[0-9a-f]+: 58 30 c0 18 l %r3,24\(%r12\) + +[0-9a-f]+: 41 33 90 00 la %r3,0\(%r3,%r9\) +# IE against local var with small got access (no optimization) + +[0-9a-f]+: 58 30 c0 10 l %r3,16\(%r12\) + +[0-9a-f]+: 41 33 90 00 la %r3,0\(%r3,%r9\) +# IE against hidden var with small got access (no optimization) + +[0-9a-f]+: 58 30 c0 1c l %r3,28\(%r12\) + +[0-9a-f]+: 41 33 90 00 la %r3,0\(%r3,%r9\) +# function epilog + +[0-9a-f]+: 98 6e f0 78 lm %r6,%r14,120\(%r15\) + +[0-9a-f]+: 07 fe br %r14 + +[0-9a-f]+: 07 07 nopr %r7 + +[0-9a-f]+: 07 07 nopr %r7 + +[0-9a-f]+: 07 07 nopr %r7 + +[0-9a-f]+: 07 07 nopr %r7 + +[0-9a-f]+: 07 07 nopr %r7 + +[0-9a-f]+: 07 07 nopr %r7 + +[0-9a-f]+: 07 07 nopr %r7 + +[0-9a-f]+: 07 07 nopr %r7 + +0+[0-9a-f]+ <_start>: +# function prolog + +[0-9a-f]+: 90 6e f0 18 stm %r6,%r14,24\(%r15\) + +[0-9a-f]+: a7 d5 00 0c bras %r13,[0-9a-f]+ <_start\+0x1c> +# sG6@indntpoff + +[0-9a-f]+: 00 40 15 a4 .long 0x004015a4 +# bg6@indntpoff + +[0-9a-f]+: ff ff ff d4 .long 0xffffffd4 +# bl6@indntpoff + +[0-9a-f]+: ff ff ff f4 .long 0xfffffff4 +# sh6@indntpoff + +[0-9a-f]+: ff ff ff b4 .long 0xffffffb4 +# sg3@indntpoff + +[0-9a-f]+: ff ff ff 68 .long 0xffffff68 +# function prolog + +[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 + +[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\) + +[0-9a-f]+: 58 33 c0 00 l %r3,0\(%r3,%r12\) + +[0-9a-f]+: 41 33 90 00 la %r3,0\(%r3,%r9\) +# IE -> LE against global var defined in exec + +[0-9a-f]+: 58 30 d0 04 l %r3,4\(%r13\) + +[0-9a-f]+: 18 43 lr %r4,%r3 + +[0-9a-f]+: 07 00 nopr %r0 + +[0-9a-f]+: 41 54 90 00 la %r5,0\(%r4,%r9\) +# IE -> LE against local var + +[0-9a-f]+: 58 30 d0 08 l %r3,8\(%r13\) + +[0-9a-f]+: 18 43 lr %r4,%r3 + +[0-9a-f]+: 07 00 nopr %r0 + +[0-9a-f]+: 41 54 90 00 la %r5,0\(%r4,%r9\) +# IE -> LE against hidden but not local var + +[0-9a-f]+: 58 30 d0 0c l %r3,12\(%r13\) + +[0-9a-f]+: 18 43 lr %r4,%r3 + +[0-9a-f]+: 07 00 nopr %r0 + +[0-9a-f]+: 41 54 90 00 la %r5,0\(%r4,%r9\) +# LE, global var defined in exec + +[0-9a-f]+: 58 40 d0 10 l %r4,16\(%r13\) + +[0-9a-f]+: 41 54 90 00 la %r5,0\(%r4,%r9\) +# function epilog + +[0-9a-f]+: 98 6e f0 78 lm %r6,%r14,120\(%r15\) + +[0-9a-f]+: 07 fe br %r14 diff --git a/binutils-2.21/ld/testsuite/ld-s390/tlsbin.rd b/binutils-2.21/ld/testsuite/ld-s390/tlsbin.rd new file mode 100644 index 0000000..678d92c --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-s390/tlsbin.rd @@ -0,0 +1,145 @@ +#source: tlsbinpic.s +#source: tlsbin.s +#as: -m31 +#ld: -shared -melf_s390 +#readelf: -Ssrl +#target: s390-*-* + +There are [0-9]+ section headers, starting at offset 0x[0-9a-f]+: + +Section Headers: + +\[Nr\] Name +Type +Addr +Off +Size +ES Flg Lk Inf Al + +\[[ 0-9]+\] +NULL +0+ 0+ 0+ 00 +0 +0 +0 + +\[[ 0-9]+\] .interp .* + +\[[ 0-9]+\] .hash .* + +\[[ 0-9]+\] .dynsym .* + +\[[ 0-9]+\] .dynstr .* + +\[[ 0-9]+\] .rela.dyn .* + +\[[ 0-9]+\] .rela.plt .* + +\[[ 0-9]+\] .plt .* + +\[[ 0-9]+\] .text +PROGBITS .* + +\[[ 0-9]+\] .tdata +PROGBITS .* 0+60 00 WAT +0 +0 +32 + +\[[ 0-9]+\] .tbss +NOBITS .* 0+40 00 WAT +0 +0 +1 + +\[[ 0-9]+\] .dynamic +DYNAMIC .* + +\[[ 0-9]+\] .got +PROGBITS .* + +\[[ 0-9]+\] .shstrtab .* + +\[[ 0-9]+\] .symtab .* + +\[[ 0-9]+\] .strtab .* +Key to Flags: +.* +.* +.* + +Elf file type is EXEC \(Executable file\) +Entry point 0x[0-9a-f]+ +There are [0-9]+ program headers, starting at offset [0-9]+ + +Program Headers: + +Type +Offset +VirtAddr +PhysAddr +FileSiz +MemSiz +Flg Align + +PHDR +0x0+34 0x0+400034 0x0+400034 0x0+c0 0x0+c0 R E 0x4 + +INTERP +0x0+f4 0x0+4000f4 0x0+4000f4 0x0+11 0x0+11 R +0x1 +.*Requesting program interpreter.* + +LOAD .* R E 0x1000 + +LOAD .* RW +0x1000 + +DYNAMIC .* RW +0x4 + +TLS .* 0x0+60 0x0+a0 R +0x20 + + Section to Segment mapping: + +Segment Sections... + +00 * + +01 +.interp * + +02 +.interp .hash .dynsym .dynstr .rela.dyn .rela.plt .plt .text * + +03 +.tdata .dynamic .got * + +04 +.dynamic * + +05 +.tdata .tbss * + +Relocation section '.rela.dyn' at offset .* contains 4 entries: + Offset +Info +Type +Sym.Value +Sym. Name \+ Addend +[0-9a-f ]+R_390_TLS_TPOFF +0+ +sG3 \+ 0 +[0-9a-f ]+R_390_TLS_TPOFF +0+ +sG2 \+ 0 +[0-9a-f ]+R_390_TLS_TPOFF +0+ +sG6 \+ 0 +[0-9a-f ]+R_390_TLS_TPOFF +0+ +sG1 \+ 0 + +Relocation section '.rela.plt' at offset 0x[0-9a-f]+ contains 1 entries: + Offset +Info +Type +Sym.Value +Sym. Name \+ Addend +[0-9a-f ]+R_390_JMP_SLOT[0-9a-f ]+__tls_get_offset \+ 0 + +Symbol table '\.dynsym' contains [0-9]+ entries: + +Num: +Value +Size +Type +Bind +Vis +Ndx +Name +.* NOTYPE +LOCAL +DEFAULT +UND +.* TLS +GLOBAL +DEFAULT +UND sG3 +.* TLS +GLOBAL +DEFAULT +UND sG2 +.* FUNC +GLOBAL +DEFAULT +UND __tls_get_offset +.* NOTYPE +GLOBAL +DEFAULT +ABS __bss_start +.* TLS +GLOBAL +DEFAULT +UND sG6 +.* TLS +GLOBAL +DEFAULT +UND sG1 +.* NOTYPE +GLOBAL +DEFAULT +ABS _edata +.* NOTYPE +GLOBAL +DEFAULT +ABS _end + +Symbol table '\.symtab' contains [0-9]+ entries: + +Num: +Value +Size +Type +Bind +Vis +Ndx +Name +.* NOTYPE +LOCAL +DEFAULT +UND +.* SECTION +LOCAL +DEFAULT +1 +.* SECTION +LOCAL +DEFAULT +2 +.* SECTION +LOCAL +DEFAULT +3 +.* SECTION +LOCAL +DEFAULT +4 +.* SECTION +LOCAL +DEFAULT +5 +.* SECTION +LOCAL +DEFAULT +6 +.* SECTION +LOCAL +DEFAULT +7 +.* SECTION +LOCAL +DEFAULT +8 +.* SECTION +LOCAL +DEFAULT +9 +.* SECTION +LOCAL +DEFAULT +10 +.* SECTION +LOCAL +DEFAULT +11 +.* SECTION +LOCAL +DEFAULT +12 +.* TLS +LOCAL +DEFAULT +9 sl1 +.* TLS +LOCAL +DEFAULT +9 sl2 +.* TLS +LOCAL +DEFAULT +9 sl3 +.* TLS +LOCAL +DEFAULT +9 sl4 +.* TLS +LOCAL +DEFAULT +9 sl5 +.* TLS +LOCAL +DEFAULT +9 sl6 +.* TLS +LOCAL +DEFAULT +9 sl7 +.* TLS +LOCAL +DEFAULT +9 sl8 +.* TLS +LOCAL +DEFAULT +10 bl1 +.* TLS +LOCAL +DEFAULT +10 bl2 +.* TLS +LOCAL +DEFAULT +10 bl3 +.* TLS +LOCAL +DEFAULT +10 bl4 +.* TLS +LOCAL +DEFAULT +10 bl5 +.* TLS +LOCAL +DEFAULT +10 bl6 +.* TLS +LOCAL +DEFAULT +10 bl7 +.* TLS +LOCAL +DEFAULT +10 bl8 +.* OBJECT +LOCAL +DEFAULT +11 _DYNAMIC +.* OBJECT +LOCAL +DEFAULT +12 _GLOBAL_OFFSET_TABLE_ +.* TLS +GLOBAL +DEFAULT +UND sG3 +.* TLS +GLOBAL +DEFAULT +9 sg8 +.* TLS +GLOBAL +DEFAULT +10 bg8 +.* TLS +GLOBAL +DEFAULT +10 bg6 +.* TLS +GLOBAL +DEFAULT +10 bg3 +.* TLS +GLOBAL +DEFAULT +9 sg3 +.* TLS +GLOBAL +HIDDEN +9 sh3 +.* TLS +GLOBAL +DEFAULT +UND sG2 +.* TLS +GLOBAL +DEFAULT +9 sg4 +.* TLS +GLOBAL +DEFAULT +9 sg5 +.* TLS +GLOBAL +DEFAULT +10 bg5 +.* TLS +GLOBAL +HIDDEN +9 sh7 +.* TLS +GLOBAL +HIDDEN +9 sh8 +.* FUNC +GLOBAL +DEFAULT +UND __tls_get_offset +.* TLS +GLOBAL +DEFAULT +9 sg1 +.* FUNC +GLOBAL +DEFAULT +8 _start +.* TLS +GLOBAL +HIDDEN +9 sh4 +.* TLS +GLOBAL +DEFAULT +10 bg7 +.* TLS +GLOBAL +HIDDEN +9 sh5 +.* NOTYPE +GLOBAL +DEFAULT +ABS __bss_start +.* TLS +GLOBAL +DEFAULT +UND sG6 +.* FUNC +GLOBAL +DEFAULT +8 fn2 +.* TLS +GLOBAL +DEFAULT +9 sg2 +.* TLS +GLOBAL +DEFAULT +UND sG1 +.* TLS +GLOBAL +HIDDEN +9 sh1 +.* TLS +GLOBAL +DEFAULT +9 sg6 +.* TLS +GLOBAL +DEFAULT +9 sg7 +.* NOTYPE +GLOBAL +DEFAULT +ABS _edata +.* NOTYPE +GLOBAL +DEFAULT +ABS _end +.* TLS +GLOBAL +HIDDEN +9 sh2 +.* TLS +GLOBAL +HIDDEN +9 sh6 +.* TLS +GLOBAL +DEFAULT +10 bg2 +.* TLS +GLOBAL +DEFAULT +10 bg1 +.* TLS +GLOBAL +DEFAULT +10 bg4 diff --git a/binutils-2.21/ld/testsuite/ld-s390/tlsbin.s b/binutils-2.21/ld/testsuite/ld-s390/tlsbin.s new file mode 100644 index 0000000..4da50e7 --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-s390/tlsbin.s @@ -0,0 +1,73 @@ + .section ".tbss", "awT", @nobits + .globl bg1, bg2, bg3, bg4, bg5, bg6, bg7, bg8 +bg1: .space 4 +bg2: .space 4 +bg3: .space 4 +bg4: .space 4 +bg5: .space 4 +bg6: .space 4 +bg7: .space 4 +bg8: .space 4 +bl1: .space 4 +bl2: .space 4 +bl3: .space 4 +bl4: .space 4 +bl5: .space 4 +bl6: .space 4 +bl7: .space 4 +bl8: .space 4 + .text + .globl _start + .type _start,@function +_start: + /* Function prolog */ + stm %r6,%r14,24(%r15) + bras %r13,.LTN1 + /* Literal pool */ +.LT1: +.LC0: + .long sG6@indntpoff +.LC1: + .long bg6@indntpoff +.LC2: + .long bl6@indntpoff +.LC3: + .long sh6@indntpoff +.LC4: + .long sg3@indntpoff +.LTN1: + /* Function prolog */ + lr %r14,%r15 + ahi %r15,-96 + st %r14,0(%r14) + + /* Extract TCB */ + ear %r9,%a0 + + /* IE against global var */ + l %r3,.LC0-.LT1(%r13) + l %r3,0(%r3,%r12):tls_load:sG6 + la %r3,0(%r3,%r9) + + /* IE -> LE against global var defined in exec */ + l %r3,.LC1-.LT1(%r13) + l %r4,0(%r3,%r12):tls_load:bg6 + la %r5,0(%r4,%r9) + + /* IE -> LE against local var */ + l %r3,.LC2-.LT1(%r13) + l %r4,0(%r3,%r12):tls_load:bl6 + la %r5,0(%r4,%r9) + + /* IE -> LE against hidden but not local var */ + l %r3,.LC3-.LT1(%r13) + l %r4,0(%r3,%r12):tls_load:sh6 + la %r5,0(%r4,%r9) + + /* LE, global var defined in exec */ + l %r4,.LC4-.LT1(%r13) + la %r5,0(%r4,%r9) + + /* Function epilog */ + lm %r6,%r14,120(%r15) + br %r14 diff --git a/binutils-2.21/ld/testsuite/ld-s390/tlsbin.sd b/binutils-2.21/ld/testsuite/ld-s390/tlsbin.sd new file mode 100644 index 0000000..b1ecbf0 --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-s390/tlsbin.sd @@ -0,0 +1,13 @@ +#source: tlsbinpic.s +#source: tlsbin.s +#as: -m31 +#ld: -shared -melf_s390 +#objdump: -sj.got +#target: s390-*-* + +.*: file format elf32-s390 + +Contents of section .got: + [0-9a-f]+ [0-9a-f]+ 00000000 00000000 [0-9a-f]+ .@...........@.. + [0-9a-f]+ ffffff88 00000000 ffffff68 ffffffa8 ...........h.... + [0-9a-f]+ 00000000 00000000 00000000 ............ diff --git a/binutils-2.21/ld/testsuite/ld-s390/tlsbin.td b/binutils-2.21/ld/testsuite/ld-s390/tlsbin.td new file mode 100644 index 0000000..f0a61b8 --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-s390/tlsbin.td @@ -0,0 +1,16 @@ +#source: tlsbinpic.s +#source: tlsbin.s +#as: -m31 +#ld: -shared -melf_s390 +#objdump: -sj.tdata +#target: s390-*-* + +.*: file format elf32-s390 + +Contents of section .tdata: + [0-9a-f]+ 00000011 00000012 00000013 00000014 .* + [0-9a-f]+ 00000015 00000016 00000017 00000018 .* + [0-9a-f]+ 00000041 00000042 00000043 00000044 .* + [0-9a-f]+ 00000045 00000046 00000047 00000048 .* + [0-9a-f]+ 00000101 00000102 00000103 00000104 .* + [0-9a-f]+ 00000105 00000106 00000107 00000108 .* diff --git a/binutils-2.21/ld/testsuite/ld-s390/tlsbin_64.dd b/binutils-2.21/ld/testsuite/ld-s390/tlsbin_64.dd new file mode 100644 index 0000000..c5c3ba0 --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-s390/tlsbin_64.dd @@ -0,0 +1,223 @@ +#source: tlsbinpic_64.s +#source: tlsbin_64.s +#as: -m64 -Aesame +#ld: -shared -melf64_s390 +#objdump: -dzrj.text +#target: s390x-*-* + +# PT_TLS layout is: +# Offset from Offset from Name +# TCB base TCB end +# 0x00 -0xa0 sg1..sg2 +# 0x20 -0x80 sl1..sl2 +# 0x40 -0x60 sh1..sh2 +# 0x60 -0x40 bg1..bg2 +# 0x80 -0x20 bl1..bl2 + +.*: +file format elf64-s390 + +Disassembly of section .text: + +0+[0-9a-f]+ <fn2>: +# function prolog + +[0-9a-f]+: eb 6e f0 30 00 24 stmg %r6,%r14,48\(%r15\) + +[0-9a-f]+: a7 d5 00 3e bras %r13,[0-9a-f]+ <fn2\+0x82> +# sG1@tlsgd + +[0-9a-f]+: 00 00 00 00 .long 0x00000000 + +[0-9a-f]+: 00 00 00 60 .long 0x00000060 +# sG2@tlsgd + +[0-9a-f]+: 00 00 00 00 .long 0x00000000 + +[0-9a-f]+: 00 00 00 48 .long 0x00000048 +# sg1@tlsgd + +[0-9a-f]+: ff ff ff ff .long 0xffffffff + +[0-9a-f]+: ff ff ff 60 .long 0xffffff60 +# sl1@tlsgd + +[0-9a-f]+: ff ff ff ff .long 0xffffffff + +[0-9a-f]+: ff ff ff 80 .long 0xffffff80 +# sh1@tlsgd + +[0-9a-f]+: ff ff ff ff .long 0xffffffff + +[0-9a-f]+: ff ff ff a0 .long 0xffffffa0 +# sl1@tlsldm + +[0-9a-f]+: 00 00 00 00 .long 0x00000000 + +[0-9a-f]+: 00 00 00 00 .long 0x00000000 +# sl1@dtpoff + +[0-9a-f]+: ff ff ff ff .long 0xffffffff + +[0-9a-f]+: ff ff ff 80 .long 0xffffff80 +# sl2@dtpoff + +[0-9a-f]+: ff ff ff ff .long 0xffffffff + +[0-9a-f]+: ff ff ff 84 .long 0xffffff84 +# sh1@tlsldm + +[0-9a-f]+: 00 00 00 00 .long 0x00000000 + +[0-9a-f]+: 00 00 00 00 .long 0x00000000 +# sh1@dtpoff + +[0-9a-f]+: ff ff ff ff .long 0xffffffff + +[0-9a-f]+: ff ff ff a0 .long 0xffffffa0 +# sh2@dtpoff + +[0-9a-f]+: ff ff ff ff .long 0xffffffff + +[0-9a-f]+: ff ff ff a4 .long 0xffffffa4 +# sG2@gotntpoff + +[0-9a-f]+: 00 00 00 00 .long 0x00000000 + +[0-9a-f]+: 00 00 00 48 .long 0x00000048 +# sg1@gotntpoff + +[0-9a-f]+: ff ff ff ff .long 0xffffffff + +[0-9a-f]+: ff ff ff 60 .long 0xffffff60 +# sl1@gotntpoff + +[0-9a-f]+: ff ff ff ff .long 0xffffffff + +[0-9a-f]+: ff ff ff 80 .long 0xffffff80 +# sh1@gotntpoff + +[0-9a-f]+: ff ff ff ff .long 0xffffffff + +[0-9a-f]+: ff ff ff a0 .long 0xffffffa0 +# function prolog + +[0-9a-f]+: b9 04 00 ef lgr %r14,%r15 + +[0-9a-f]+: a7 fb ff 60 aghi %r15,-160 + +[0-9a-f]+: c0 c0 [0-9a-f ]+ larl %r12,[0-9a-f]+ <_GLOBAL_OFFSET_TABLE_> + +[0-9a-f]+: e3 e0 e0 00 00 24 stg %r14,0\(%r14\) +# extract TCB + +[0-9a-f]+: b2 4f 00 90 ear %r9,%a0 + +[0-9a-f]+: eb 94 00 20 00 0d sllg %r9,%r4,32 + +[0-9a-f]+: b2 4f 00 91 ear %r9,%a1 +# GD -> IE because variable is not defined in executable + +[0-9a-f]+: e3 c0 d0 00 00 04 lg %r12,0\(%r13\) + +[0-9a-f]+: e3 22 c0 00 00 04 lg %r2,0\(%r2,%r12\) + +[0-9a-f]+: 41 22 90 00 la %r2,0\(%r2,%r9\) +# GD -> IE because variable is not defined in executable where +# the variable is referenced through IE too + +[0-9a-f]+: e3 20 d0 08 00 04 lg %r2,8\(%r13\) + +[0-9a-f]+: e3 22 c0 00 00 04 lg %r2,0\(%r2,%r12\) + +[0-9a-f]+: 41 22 90 00 la %r2,0\(%r2,%r9\) +# GD -> LE with global variable defined in executable + +[0-9a-f]+: e3 20 d0 10 00 04 lg %r2,16\(%r13\) + +[0-9a-f]+: c0 04 00 00 00 00 brcl 0,[0-9a-f]+ <fn2\+0xca> + +[0-9a-f]+: 41 22 90 00 la %r2,0\(%r2,%r9\) +# GD -> LE with local variable defined in executable + +[0-9a-f]+: e3 20 d0 18 00 04 lg %r2,24\(%r13\) + +[0-9a-f]+: c0 04 00 00 00 00 brcl 0,[0-9a-f]+ <fn2\+0xda> + +[0-9a-f]+: 41 22 90 00 la %r2,0\(%r2,%r9\) +# GD -> LE with hidden variable defined in executable + +[0-9a-f]+: e3 20 d0 20 00 04 lg %r2,32\(%r13\) + +[0-9a-f]+: c0 04 00 00 00 00 brcl 0,[0-9a-f]+ <fn2\+0xea> + +[0-9a-f]+: 41 22 90 00 la %r2,0\(%r2,%r9\) +# LD -> LE + +[0-9a-f]+: e3 20 d0 28 00 04 lg %r2,40\(%r13\) + +[0-9a-f]+: c0 04 00 00 00 00 brcl 0,[0-9a-f]+ <fn2\+0xfa> + +[0-9a-f]+: 41 32 90 00 la %r3,0\(%r2,%r9\) + +[0-9a-f]+: e3 40 d0 30 00 04 lg %r4,48\(%r13\) + +[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\) + +[0-9a-f]+: e3 20 d0 40 00 04 lg %r2,64\(%r13\) + +[0-9a-f]+: c0 04 00 00 00 00 brcl 0,[0-9a-f]+ <fn2\+0x11e> + +[0-9a-f]+: 41 32 90 00 la %r3,0\(%r2,%r9\) + +[0-9a-f]+: e3 40 d0 48 00 04 lg %r4,72\(%r13\) + +[0-9a-f]+: 41 54 30 00 la %r5,0\(%r4,%r3\) + +[0-9a-f]+: e3 40 d0 50 00 04 lg %r4,80\(%r13\) + +[0-9a-f]+: 41 54 30 00 la %r5,0\(%r4,%r3\) +# IE against global var + +[0-9a-f]+: e3 30 d0 58 00 04 lg %r3,88\(%r13\) + +[0-9a-f]+: e3 33 c0 00 00 04 lg %r3,0\(%r3,%r12\) + +[0-9a-f]+: 41 33 90 00 la %r3,0\(%r3,%r9\) +# IE -> LE against global var defined in exec + +[0-9a-f]+: e3 30 d0 60 00 04 lg %r3,96\(%r13\) + +[0-9a-f]+: eb 43 00 00 00 0d sllg %r4,%r3,0 + +[0-9a-f]+: 41 54 90 00 la %r5,0\(%r4,%r9\) +# IE -> LE against local var + +[0-9a-f]+: e3 30 d0 68 00 04 lg %r3,104\(%r13\) + +[0-9a-f]+: eb 43 00 00 00 0d sllg %r4,%r3,0 + +[0-9a-f]+: 41 54 90 00 la %r5,0\(%r4,%r9\) +# IE -> LE against hidden var + +[0-9a-f]+: e3 30 d0 70 00 04 lg %r3,112\(%r13\) + +[0-9a-f]+: eb 43 00 00 00 0d sllg %r4,%r3,0 + +[0-9a-f]+: 41 54 90 00 la %r5,0\(%r4,%r9\) +# IE against global var with larl got access + +[0-9a-f]+: c0 30 [0-9a-f ]+ larl %r3,[0-9a-f]+ <_GLOBAL_OFFSET_TABLE_\+0x28> + +[0-9a-f]+: e3 33 c0 00 00 04 lg %r3,0\(%r3,%r12\) + +[0-9a-f]+: 41 33 90 00 la %r3,0\(%r3,%r9\) +# IE against global var defined in exec with larl got access + +[0-9a-f]+: c0 30 [0-9a-f ]+ larl %r3,[0-9a-f]+ <_GLOBAL_OFFSET_TABLE_\+0x38> + +[0-9a-f]+: eb 43 00 00 00 0d sllg %r4,%r3,0 + +[0-9a-f]+: 41 54 90 00 la %r5,0\(%r4,%r9\) +# IE against local var with larl got access + +[0-9a-f]+: c0 30 [0-9a-f ]+ larl %r3,[0-9a-f]+ <_GLOBAL_OFFSET_TABLE_\+0x20> + +[0-9a-f]+: eb 43 00 00 00 0d sllg %r4,%r3,0 + +[0-9a-f]+: 41 54 90 00 la %r5,0\(%r4,%r9\) +# IE against hidden var with larl got access + +[0-9a-f]+: c0 30 [0-9a-f ]+ larl %r3,[0-9a-f]+ <_GLOBAL_OFFSET_TABLE_\+0x40> + +[0-9a-f]+: eb 43 00 00 00 0d sllg %r4,%r3,0 + +[0-9a-f]+: 41 54 90 00 la %r5,0\(%r4,%r9\) +# IE against global var with small got access (no optimization) + +[0-9a-f]+: e3 30 c0 28 00 04 lg %r3,40\(%r12\) + +[0-9a-f]+: 41 33 90 00 la %r3,0\(%r3,%r9\) +# IE against global var defined in exec with small got access +# (no optimization) + +[0-9a-f]+: e3 30 c0 38 00 04 lg %r3,56\(%r12\) + +[0-9a-f]+: 41 33 90 00 la %r3,0\(%r3,%r9\) +# IE against local var with small got access (no optimization) + +[0-9a-f]+: e3 30 c0 20 00 04 lg %r3,32\(%r12\) + +[0-9a-f]+: 41 33 90 00 la %r3,0\(%r3,%r9\) +# IE against hidden var with small got access (no optimization) + +[0-9a-f]+: e3 30 c0 40 00 04 lg %r3,64\(%r12\) + +[0-9a-f]+: 41 33 90 00 la %r3,0\(%r3,%r9\) +# function epilog + +[0-9a-f]+: eb 6e f0 d0 00 04 lmg %r6,%r14,208\(%r15\) + +[0-9a-f]+: 07 fe br %r14 + +[0-9a-f]+: 07 07 nopr %r7 + +[0-9a-f]+: 07 07 nopr %r7 + +[0-9a-f]+: 07 07 nopr %r7 + +[0-9a-f]+: 07 07 nopr %r7 + +[0-9a-f]+: 07 07 nopr %r7 + +[0-9a-f]+: 07 07 nopr %r7 + +[0-9a-f]+: 07 07 nopr %r7 + +[0-9a-f]+: 07 07 nopr %r7 + +[0-9a-f]+: 07 07 nopr %r7 + +[0-9a-f]+: 07 07 nopr %r7 + +0+[0-9a-f]+ <_start>: +# function prolog + +[0-9a-f]+: 90 6e f0 18 stm %r6,%r14,24\(%r15\) + +[0-9a-f]+: a7 d5 00 16 bras %r13,[0-9a-f]+ <_start\+0x30> +# sG6@indntpoff + +[0-9a-f]+: 00 00 00 00 .long 0x00000000 + +[0-9a-f]+: 80 00 [0-9a-f ]+ ssm [0-9]+\(%r1\) +# bg6@indntpoff + +[0-9a-f]+: ff ff ff ff .long 0xffffffff + +[0-9a-f]+: ff ff ff d4 .long 0xffffffd4 +# bl6@indntpoff + +[0-9a-f]+: ff ff ff ff .long 0xffffffff + +[0-9a-f]+: ff ff ff f4 .long 0xfffffff4 +# sh6@indntpoff + +[0-9a-f]+: ff ff ff ff .long 0xffffffff + +[0-9a-f]+: ff ff ff b4 .long 0xffffffb4 +# sg3@indntpoff + +[0-9a-f]+: ff ff ff ff .long 0xffffffff + +[0-9a-f]+: ff ff ff 68 .long 0xffffff68 +# function prolog + +[0-9a-f]+: b9 04 00 ef lgr %r14,%r15 + +[0-9a-f]+: a7 fb ff 60 aghi %r15,-160 + +[0-9a-f]+: e3 e0 e0 00 00 24 stg %r14,0\(%r14\) +# extract TCB + +[0-9a-f]+: b2 4f 00 90 ear %r9,%a0 + +[0-9a-f]+: eb 94 00 20 00 0d sllg %r9,%r4,32 + +[0-9a-f]+: b2 4f 00 91 ear %r9,%a1 +# IE against global var + +[0-9a-f]+: e3 30 d0 00 00 04 lg %r3,0\(%r13\) + +[0-9a-f]+: e3 33 c0 00 00 04 lg %r3,0\(%r3,%r12\) + +[0-9a-f]+: 41 33 90 00 la %r3,0\(%r3,%r9\) +# IE -> LE against global var defined in exec + +[0-9a-f]+: e3 30 d0 08 00 04 lg %r3,8\(%r13\) + +[0-9a-f]+: eb 43 00 00 00 0d sllg %r4,%r3,0 + +[0-9a-f]+: 41 54 90 00 la %r5,0\(%r4,%r9\) +# IE -> LE against local var + +[0-9a-f]+: e3 30 d0 10 00 04 lg %r3,16\(%r13\) + +[0-9a-f]+: eb 43 00 00 00 0d sllg %r4,%r3,0 + +[0-9a-f]+: 41 54 90 00 la %r5,0\(%r4,%r9\) +# IE -> LE against hidden but not local var + +[0-9a-f]+: e3 30 d0 18 00 04 lg %r3,24\(%r13\) + +[0-9a-f]+: eb 43 00 00 00 0d sllg %r4,%r3,0 + +[0-9a-f]+: 41 54 90 00 la %r5,0\(%r4,%r9\) +# LE, global var defined in exec + +[0-9a-f]+: e3 40 d0 20 00 04 lg %r4,32\(%r13\) + +[0-9a-f]+: 41 54 90 00 la %r5,0\(%r4,%r9\) +# function epilog + +[0-9a-f]+: eb 6e f0 d0 00 04 lmg %r6,%r14,208\(%r15\) + +[0-9a-f]+: 07 fe br %r14 + +[0-9a-f]+: 07 07 nopr %r7 diff --git a/binutils-2.21/ld/testsuite/ld-s390/tlsbin_64.rd b/binutils-2.21/ld/testsuite/ld-s390/tlsbin_64.rd new file mode 100644 index 0000000..1dcb6b7 --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-s390/tlsbin_64.rd @@ -0,0 +1,145 @@ +#source: tlsbinpic.s +#source: tlsbin.s +#as: -m64 -Aesame +#ld: -shared -melf64_s390 +#readelf: -Ssrl +#target: s390x-*-* + +There are [0-9]+ section headers, starting at offset 0x[0-9a-f]+: + +Section Headers: + +\[Nr\] Name +Type +Address +Off +Size +ES Flg Lk Inf Al + +\[[ 0-9]+\] +NULL +0+ 0+ 0+ 00 +0 +0 +0 + +\[[ 0-9]+\] .interp .* + +\[[ 0-9]+\] .hash .* + +\[[ 0-9]+\] .dynsym .* + +\[[ 0-9]+\] .dynstr .* + +\[[ 0-9]+\] .rela.dyn .* + +\[[ 0-9]+\] .rela.plt .* + +\[[ 0-9]+\] .plt .* + +\[[ 0-9]+\] .text +PROGBITS .* + +\[[ 0-9]+\] .tdata +PROGBITS .* 0+60 00 WAT +0 +0 +32 + +\[[ 0-9]+\] .tbss +NOBITS .* 0+40 00 WAT +0 +0 +1 + +\[[ 0-9]+\] .dynamic +DYNAMIC .* + +\[[ 0-9]+\] .got +PROGBITS .* + +\[[ 0-9]+\] .shstrtab .* + +\[[ 0-9]+\] .symtab .* + +\[[ 0-9]+\] .strtab .* +Key to Flags: +.* +.* +.* + +Elf file type is EXEC \(Executable file\) +Entry point 0x[0-9a-f]+ +There are [0-9]+ program headers, starting at offset [0-9]+ + +Program Headers: + +Type +Offset +VirtAddr +PhysAddr +FileSiz +MemSiz +Flg Align + +PHDR +0x0+40 0x0+80000040 0x0+80000040 0x0+150 0x0+150 R E 0x8 + +INTERP +0x0+190 0x0+80000190 0x0+80000190 0x0+11 0x0+11 R +0x1 +.*Requesting program interpreter.* + +LOAD .* R E 0x1000 + +LOAD .* RW +0x1000 + +DYNAMIC .* RW +0x8 + +TLS .* 0x0+60 0x0+a0 R +0x20 + + Section to Segment mapping: + +Segment Sections... + +00 * + +01 +.interp * + +02 +.interp .hash .dynsym .dynstr .rela.dyn .rela.plt .plt .text * + +03 +.tdata .dynamic .got * + +04 +.dynamic * + +05 +.tdata .tbss * + +Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 4 entries: + +Offset +Info +Type +Symbol's Value +Symbol's Name \+ Addend +[0-9a-f ]+R_390_TLS_TPOFF +0+ sG3 \+ 0 +[0-9a-f ]+R_390_TLS_TPOFF +0+ sG2 \+ 0 +[0-9a-f ]+R_390_TLS_TPOFF +0+ sG6 \+ 0 +[0-9a-f ]+R_390_TLS_TPOFF +0+ sG1 \+ 0 + +Relocation section '.rela.plt' at offset 0x[0-9a-f]+ contains 1 entries: + +Offset +Info +Type +Symbol's Value +Symbol's Name \+ Addend +[0-9a-f ]+R_390_JMP_SLOT[0-9a-f ]+__tls_get_offset \+ 0 + +Symbol table '\.dynsym' contains [0-9]+ entries: + +Num: +Value +Size +Type +Bind +Vis +Ndx +Name +.* NOTYPE +LOCAL +DEFAULT +UND +.* TLS +GLOBAL +DEFAULT +UND sG3 +.* TLS +GLOBAL +DEFAULT +UND sG2 +.* FUNC +GLOBAL +DEFAULT +UND __tls_get_offset +.* NOTYPE +GLOBAL +DEFAULT +ABS __bss_start +.* TLS +GLOBAL +DEFAULT +UND sG6 +.* TLS +GLOBAL +DEFAULT +UND sG1 +.* NOTYPE +GLOBAL +DEFAULT +ABS _edata +.* NOTYPE +GLOBAL +DEFAULT +ABS _end + +Symbol table '\.symtab' contains [0-9]+ entries: + +Num: +Value +Size +Type +Bind +Vis +Ndx +Name +.* NOTYPE +LOCAL +DEFAULT +UND +.* SECTION +LOCAL +DEFAULT +1 +.* SECTION +LOCAL +DEFAULT +2 +.* SECTION +LOCAL +DEFAULT +3 +.* SECTION +LOCAL +DEFAULT +4 +.* SECTION +LOCAL +DEFAULT +5 +.* SECTION +LOCAL +DEFAULT +6 +.* SECTION +LOCAL +DEFAULT +7 +.* SECTION +LOCAL +DEFAULT +8 +.* SECTION +LOCAL +DEFAULT +9 +.* SECTION +LOCAL +DEFAULT +10 +.* SECTION +LOCAL +DEFAULT +11 +.* SECTION +LOCAL +DEFAULT +12 +.* TLS +LOCAL +DEFAULT +9 sl1 +.* TLS +LOCAL +DEFAULT +9 sl2 +.* TLS +LOCAL +DEFAULT +9 sl3 +.* TLS +LOCAL +DEFAULT +9 sl4 +.* TLS +LOCAL +DEFAULT +9 sl5 +.* TLS +LOCAL +DEFAULT +9 sl6 +.* TLS +LOCAL +DEFAULT +9 sl7 +.* TLS +LOCAL +DEFAULT +9 sl8 +.* TLS +LOCAL +DEFAULT +10 bl1 +.* TLS +LOCAL +DEFAULT +10 bl2 +.* TLS +LOCAL +DEFAULT +10 bl3 +.* TLS +LOCAL +DEFAULT +10 bl4 +.* TLS +LOCAL +DEFAULT +10 bl5 +.* TLS +LOCAL +DEFAULT +10 bl6 +.* TLS +LOCAL +DEFAULT +10 bl7 +.* TLS +LOCAL +DEFAULT +10 bl8 +.* OBJECT +LOCAL +DEFAULT +11 _DYNAMIC +.* OBJECT +LOCAL +DEFAULT +12 _GLOBAL_OFFSET_TABLE_ +.* TLS +GLOBAL +DEFAULT +UND sG3 +.* TLS +GLOBAL +DEFAULT +9 sg8 +.* TLS +GLOBAL +DEFAULT +10 bg8 +.* TLS +GLOBAL +DEFAULT +10 bg6 +.* TLS +GLOBAL +DEFAULT +10 bg3 +.* TLS +GLOBAL +DEFAULT +9 sg3 +.* TLS +GLOBAL +HIDDEN +9 sh3 +.* TLS +GLOBAL +DEFAULT +UND sG2 +.* TLS +GLOBAL +DEFAULT +9 sg4 +.* TLS +GLOBAL +DEFAULT +9 sg5 +.* TLS +GLOBAL +DEFAULT +10 bg5 +.* TLS +GLOBAL +HIDDEN +9 sh7 +.* TLS +GLOBAL +HIDDEN +9 sh8 +.* FUNC +GLOBAL +DEFAULT +UND __tls_get_offset +.* TLS +GLOBAL +DEFAULT +9 sg1 +.* FUNC +GLOBAL +DEFAULT +8 _start +.* TLS +GLOBAL +HIDDEN +9 sh4 +.* TLS +GLOBAL +DEFAULT +10 bg7 +.* TLS +GLOBAL +HIDDEN +9 sh5 +.* NOTYPE +GLOBAL +DEFAULT +ABS __bss_start +.* TLS +GLOBAL +DEFAULT +UND sG6 +.* FUNC +GLOBAL +DEFAULT +8 fn2 +.* TLS +GLOBAL +DEFAULT +9 sg2 +.* TLS +GLOBAL +DEFAULT +UND sG1 +.* TLS +GLOBAL +HIDDEN +9 sh1 +.* TLS +GLOBAL +DEFAULT +9 sg6 +.* TLS +GLOBAL +DEFAULT +9 sg7 +.* NOTYPE +GLOBAL +DEFAULT +ABS _edata +.* NOTYPE +GLOBAL +DEFAULT +ABS _end +.* TLS +GLOBAL +HIDDEN +9 sh2 +.* TLS +GLOBAL +HIDDEN +9 sh6 +.* TLS +GLOBAL +DEFAULT +10 bg2 +.* TLS +GLOBAL +DEFAULT +10 bg1 +.* TLS +GLOBAL +DEFAULT +10 bg4 diff --git a/binutils-2.21/ld/testsuite/ld-s390/tlsbin_64.s b/binutils-2.21/ld/testsuite/ld-s390/tlsbin_64.s new file mode 100644 index 0000000..c40fcfc --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-s390/tlsbin_64.s @@ -0,0 +1,75 @@ + .section ".tbss", "awT", @nobits + .globl bg1, bg2, bg3, bg4, bg5, bg6, bg7, bg8 +bg1: .space 4 +bg2: .space 4 +bg3: .space 4 +bg4: .space 4 +bg5: .space 4 +bg6: .space 4 +bg7: .space 4 +bg8: .space 4 +bl1: .space 4 +bl2: .space 4 +bl3: .space 4 +bl4: .space 4 +bl5: .space 4 +bl6: .space 4 +bl7: .space 4 +bl8: .space 4 + .text + .globl _start + .type _start,@function +_start: + /* Function prolog */ + stm %r6,%r14,24(%r15) + bras %r13,.LTN1 + /* Literal pool */ +.LT1: +.LC0: + .quad sG6@indntpoff +.LC1: + .quad bg6@indntpoff +.LC2: + .quad bl6@indntpoff +.LC3: + .quad sh6@indntpoff +.LC4: + .quad sg3@indntpoff +.LTN1: + /* Function prolog */ + lgr %r14,%r15 + aghi %r15,-160 + stg %r14,0(%r14) + + /* Extract TCB */ + ear %r9,%a0 + sllg %r9,%r4,32 + ear %r9,%a1 + + /* IE against global var */ + lg %r3,.LC0-.LT1(%r13) + lg %r3,0(%r3,%r12):tls_load:sG6 + la %r3,0(%r3,%r9) + + /* IE -> LE against global var defined in exec */ + lg %r3,.LC1-.LT1(%r13) + lg %r4,0(%r3,%r12):tls_load:bg6 + la %r5,0(%r4,%r9) + + /* IE -> LE against local var */ + lg %r3,.LC2-.LT1(%r13) + lg %r4,0(%r3,%r12):tls_load:bl6 + la %r5,0(%r4,%r9) + + /* IE -> LE against hidden but not local var */ + lg %r3,.LC3-.LT1(%r13) + lg %r4,0(%r3,%r12):tls_load:sh6 + la %r5,0(%r4,%r9) + + /* LE, global var defined in exec */ + lg %r4,.LC4-.LT1(%r13) + la %r5,0(%r4,%r9) + + /* Function epilog */ + lmg %r6,%r14,208(%r15) + br %r14 diff --git a/binutils-2.21/ld/testsuite/ld-s390/tlsbin_64.sd b/binutils-2.21/ld/testsuite/ld-s390/tlsbin_64.sd new file mode 100644 index 0000000..6618e45 --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-s390/tlsbin_64.sd @@ -0,0 +1,18 @@ +#source: tlsbinpic_64.s +#source: tlsbin_64.s +#as: -m64 -Aesame +#ld: -shared -melf64_s390 +#objdump: -sj.got +#target: s390x-*-* + +.*: file format elf64-s390 + +Contents of section .got: + [0-9a-f]+ [0-9a-f]+ [0-9a-f]+ 00000000 00000000 .* + [0-9a-f]+ 00000000 00000000 [0-9a-f]+ [0-9a-f]+ .* + [0-9a-f]+ ffffffff ffffff88 00000000 00000000 .* + [0-9a-f]+ 00000000 00000000 ffffffff ffffff68 .* + [0-9a-f]+ ffffffff ffffffa8 00000000 00000000 .* + [0-9a-f]+ 00000000 00000000 00000000 00000000 .* + [0-9a-f]+ 00000000 00000000 00000000 00000000 .* + [0-9a-f]+ 00000000 00000000 .* diff --git a/binutils-2.21/ld/testsuite/ld-s390/tlsbin_64.td b/binutils-2.21/ld/testsuite/ld-s390/tlsbin_64.td new file mode 100644 index 0000000..dfa7e8d --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-s390/tlsbin_64.td @@ -0,0 +1,16 @@ +#source: tlsbinpic_64.s +#source: tlsbin_64.s +#as: -m64 -Aesame +#ld: -shared -melf64_s390 +#objdump: -sj.tdata +#target: s390x-*-* + +.*: file format elf64-s390 + +Contents of section .tdata: + [0-9a-f]+ 00000011 00000012 00000013 00000014 .* + [0-9a-f]+ 00000015 00000016 00000017 00000018 .* + [0-9a-f]+ 00000041 00000042 00000043 00000044 .* + [0-9a-f]+ 00000045 00000046 00000047 00000048 .* + [0-9a-f]+ 00000101 00000102 00000103 00000104 .* + [0-9a-f]+ 00000105 00000106 00000107 00000108 .* diff --git a/binutils-2.21/ld/testsuite/ld-s390/tlsbinpic.s b/binutils-2.21/ld/testsuite/ld-s390/tlsbinpic.s new file mode 100644 index 0000000..e52e3a4 --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-s390/tlsbinpic.s @@ -0,0 +1,170 @@ + .section ".tdata", "awT", @progbits + .balign 32 + .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 +sg4: .long 20 +sg5: .long 21 +sg6: .long 22 +sg7: .long 23 +sg8: .long 24 +sl1: .long 65 +sl2: .long 66 +sl3: .long 67 +sl4: .long 68 +sl5: .long 69 +sl6: .long 70 +sl7: .long 71 +sl8: .long 72 +sh1: .long 257 +sh2: .long 258 +sh3: .long 259 +sh4: .long 260 +sh5: .long 261 +sh6: .long 262 +sh7: .long 263 +sh8: .long 264 + .text + .globl fn2 + .type fn2,@function + .balign 64 +fn2: + /* Function prolog */ + stm %r6,%r14,24(%r15) + bras %r13,.LTN1 + /* Literal pool */ +.LT1: +.LC0: + .long _GLOBAL_OFFSET_TABLE_-.LT1 +.LC1: + .long __tls_get_offset@plt-.LT1 +.LC2: + .long sG1@tlsgd +.LC3: + .long sG2@tlsgd +.LC4: + .long sg1@tlsgd +.LC5: + .long sl1@tlsgd +.LC6: + .long sh1@tlsgd +.LC7: + .long sl1@tlsldm +.LC8: + .long sl1@dtpoff +.LC9: + .long sl2@dtpoff +.LC10: + .long sh1@tlsldm +.LC11: + .long sh1@dtpoff +.LC12: + .long sh2@dtpoff +.LC13: + .long sG2@gotntpoff +.LC14: + .long sg1@gotntpoff +.LC15: + .long sl1@gotntpoff +.LC16: + .long sh1@gotntpoff +.LTN1: + /* Function prolog */ + lr %r14,%r15 + l %r12,.LC0-.LT1(%r13) + ahi %r15,-96 + la %r12,0(%r12,%r13) + st %r14,0(%r14) + + /* 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 + la %r2,0(%r2,%r9) + + /* GD -> IE because variable is not defined in executable where + the variable is referenced through IE too */ + l %r2,.LC3-.LT1(%r13) + bas %r14,0(%r7,%r13):tls_gdcall:sG2 + la %r2,0(%r2,%r9) + + /* GD -> LE with global variable defined in executable */ + l %r2,.LC4-.LT1(%r13) + bas %r14,0(%r7,%r13):tls_gdcall:sg1 + la %r2,0(%r2,%r9) + + /* GD -> LE with local variable defined in executable */ + l %r2,.LC5-.LT1(%r13) + bas %r14,0(%r7,%r13):tls_gdcall:sl1 + la %r2,0(%r2,%r9) + + /* GD -> LE with hidden variable defined in executable */ + l %r2,.LC6-.LT1(%r13) + bas %r14,0(%r7,%r13):tls_gdcall:sh1 + la %r2,0(%r2,%r9) + + /* LD -> LE */ + l %r2,.LC7-.LT1(%r13) + bas %r14,0(%r7,%r13):tls_ldcall:sl1 + la %r3,0(%r2,%r9) + l %r4,.LC8-.LT1(%r13) + la %r5,0(%r4,%r3) + l %r4,.LC9-.LT1(%r13) + la %r5,0(%r4,%r3) + + /* LD -> LE against hidden variables */ + l %r2,.LC10-.LT1(%r13) + bas %r14,0(%r7,%r13):tls_ldcall:sh1 + la %r3,0(%r2,%r9) + l %r4,.LC11-.LT1(%r13) + la %r5,0(%r4,%r3) + l %r4,.LC12-.LT1(%r13) + la %r5,0(%r4,%r3) + + /* IE against global var */ + l %r3,.LC13-.LT1(%r13) + l %r3,0(%r3,%r12):tls_load:sG2 + l %r3,0(%r3,%r9) + + /* IE -> LE against global var defined in exec */ + l %r3,.LC14-.LT1(%r13) + l %r4,0(%r3,%r12):tls_load:sg1 + la %r5,0(%r4,%r9) + + /* IE -> LE against local var */ + l %r3,.LC15-.LT1(%r13) + l %r4,0(%r3,%r12):tls_load:sl1 + la %r5,0(%r4,%r9) + + /* IE -> LE against hidden var */ + l %r3,.LC16-.LT1(%r13) + l %r4,0(%r3,%r12):tls_load:sh1 + la %r5,0(%r4,%r9) + + /* IE against global var with small got access (no optimization) */ + l %r3,sG3@gotntpoff(%r12) + la %r3,0(%r3,%r9) + + /* IE against global var defined in exec with small got access + (no optimization) */ + l %r3,sg3@gotntpoff(%r12) + la %r3,0(%r3,%r9) + + /* IE against local var with small got access (no optimization) */ + l %r3,sl3@gotntpoff(%r12) + la %r3,0(%r3,%r9) + + /* IE against hidden var with small got access (no optimization) */ + l %r3,sh3@gotntpoff(%r12) + la %r3,0(%r3,%r9) + + /* Function epilog */ + lm %r6,%r14,120(%r15) + br %r14 diff --git a/binutils-2.21/ld/testsuite/ld-s390/tlsbinpic_64.s b/binutils-2.21/ld/testsuite/ld-s390/tlsbinpic_64.s new file mode 100644 index 0000000..eeda6ca --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-s390/tlsbinpic_64.s @@ -0,0 +1,186 @@ + .section ".tdata", "awT", @progbits + .balign 32 + .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 +sg4: .long 20 +sg5: .long 21 +sg6: .long 22 +sg7: .long 23 +sg8: .long 24 +sl1: .long 65 +sl2: .long 66 +sl3: .long 67 +sl4: .long 68 +sl5: .long 69 +sl6: .long 70 +sl7: .long 71 +sl8: .long 72 +sh1: .long 257 +sh2: .long 258 +sh3: .long 259 +sh4: .long 260 +sh5: .long 261 +sh6: .long 262 +sh7: .long 263 +sh8: .long 264 + .text + .globl fn2 + .type fn2,@function + .balign 64 +fn2: + /* Function prolog */ + stmg %r6,%r14,48(%r15) + bras %r13,.LTN1 + /* Literal pool */ +.LT1: +.LC2: + .quad sG1@tlsgd +.LC3: + .quad sG2@tlsgd +.LC4: + .quad sg1@tlsgd +.LC5: + .quad sl1@tlsgd +.LC6: + .quad sh1@tlsgd +.LC7: + .quad sl1@tlsldm +.LC8: + .quad sl1@dtpoff +.LC9: + .quad sl2@dtpoff +.LC10: + .quad sh1@tlsldm +.LC11: + .quad sh1@dtpoff +.LC12: + .quad sh2@dtpoff +.LC13: + .quad sG2@gotntpoff +.LC14: + .quad sg1@gotntpoff +.LC15: + .quad sl1@gotntpoff +.LC16: + .quad sh1@gotntpoff +.LTN1: + /* Function prolog */ + lgr %r14,%r15 + aghi %r15,-160 + larl %r12,_GLOBAL_OFFSET_TABLE_ + stg %r14,0(%r14) + + /* Extract TCB */ + ear %r9,%a0 + sllg %r9,%r4,32 + ear %r9,%a1 + + /* GD -> IE because variable is not defined in executable */ + lg %r12,.LC2-.LT1(%r13) + brasl %r14,__tls_get_offset@plt:tls_gdcall:sG1 + la %r2,0(%r2,%r9) + + /* GD -> IE because variable is not defined in executable where + the variable is referenced through IE too */ + lg %r2,.LC3-.LT1(%r13) + brasl %r14,__tls_get_offset@plt:tls_gdcall:sG2 + la %r2,0(%r2,%r9) + + /* GD -> LE with global variable defined in executable */ + lg %r2,.LC4-.LT1(%r13) + brasl %r14,__tls_get_offset@plt:tls_gdcall:sg1 + la %r2,0(%r2,%r9) + + /* GD -> LE with local variable defined in executable */ + lg %r2,.LC5-.LT1(%r13) + brasl %r14,__tls_get_offset@plt:tls_gdcall:sl1 + la %r2,0(%r2,%r9) + + /* GD -> LE with hidden variable defined in executable */ + lg %r2,.LC6-.LT1(%r13) + brasl %r14,__tls_get_offset@plt:tls_gdcall:sh1 + la %r2,0(%r2,%r9) + + /* LD -> LE */ + lg %r2,.LC7-.LT1(%r13) + brasl %r14,__tls_get_offset@plt:tls_ldcall:sl1 + la %r3,0(%r2,%r9) + lg %r4,.LC8-.LT1(%r13) + la %r5,0(%r4,%r3) + lg %r4,.LC9-.LT1(%r13) + la %r5,0(%r4,%r3) + + /* LD -> LE against hidden variables */ + lg %r2,.LC10-.LT1(%r13) + brasl %r14,__tls_get_offset@plt:tls_ldcall:sh1 + la %r3,0(%r2,%r9) + lg %r4,.LC11-.LT1(%r13) + la %r5,0(%r4,%r3) + lg %r4,.LC12-.LT1(%r13) + la %r5,0(%r4,%r3) + + /* IE against global var */ + lg %r3,.LC13-.LT1(%r13) + lg %r3,0(%r3,%r12):tls_load:sG2 + la %r3,0(%r3,%r9) + + /* IE -> LE against global var defined in exec */ + lg %r3,.LC14-.LT1(%r13) + lg %r4,0(%r3,%r12):tls_load:sg1 + la %r5,0(%r4,%r9) + + /* IE -> LE against local var */ + lg %r3,.LC15-.LT1(%r13) + lg %r4,0(%r3,%r12):tls_load:sl2 + la %r5,0(%r4,%r9) + + /* IE -> LE against hidden var */ + lg %r3,.LC16-.LT1(%r13) + lg %r4,0(%r3,%r12):tls_load:sh1 + la %r5,0(%r4,%r9) + + /* IE against global var with larl got access */ + larl %r3,sG3@indntpoff + lg %r3,0(%r3,%r12):tls_load:sG3 + la %r3,0(%r3,%r9) + + /* IE against global var defined in exec with larl got access */ + larl %r3,sg3@indntpoff + lg %r4,0(%r3,%r12):tls_load:sg3 + la %r5,0(%r4,%r9) + + /* IE against local var with larl got access */ + 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 + la %r5,0(%r4,%r9) + + /* IE against global var with small got access (no optimization) */ + lg %r3,sG3@gotntpoff(%r12) + la %r3,0(%r3,%r9) + + /* IE against global var defined in exec with small got access + (no optimization) */ + lg %r3,sg3@gotntpoff(%r12) + la %r3,0(%r3,%r9) + + /* IE against local var with small got access (no optimization) */ + lg %r3,sl3@gotntpoff(%r12) + la %r3,0(%r3,%r9) + + /* IE against hidden var with small got access (no optimization) */ + lg %r3,sh3@gotntpoff(%r12) + la %r3,0(%r3,%r9) + + /* Function epilog */ + lmg %r6,%r14,208(%r15) + br %r14 diff --git a/binutils-2.21/ld/testsuite/ld-s390/tlslib.s b/binutils-2.21/ld/testsuite/ld-s390/tlslib.s new file mode 100644 index 0000000..3ec87c2 --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-s390/tlslib.s @@ -0,0 +1,17 @@ + .section ".tdata", "awT", @progbits + .globl sG1, sG2, sG3, sG4, sG5, sG6, sG7, sG8, +sG1: .long 513 +sG2: .long 514 +sG3: .long 515 +sG4: .long 516 +sG5: .long 517 +sG6: .long 518 +sG7: .long 519 +sG8: .long 520 + + .text + /* Dummy. */ + .globl __tls_get_offset + .type __tls_get_offset,@function +__tls_get_offset: + br %r14 diff --git a/binutils-2.21/ld/testsuite/ld-s390/tlslib_64.s b/binutils-2.21/ld/testsuite/ld-s390/tlslib_64.s new file mode 100644 index 0000000..3ec87c2 --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-s390/tlslib_64.s @@ -0,0 +1,17 @@ + .section ".tdata", "awT", @progbits + .globl sG1, sG2, sG3, sG4, sG5, sG6, sG7, sG8, +sG1: .long 513 +sG2: .long 514 +sG3: .long 515 +sG4: .long 516 +sG5: .long 517 +sG6: .long 518 +sG7: .long 519 +sG8: .long 520 + + .text + /* Dummy. */ + .globl __tls_get_offset + .type __tls_get_offset,@function +__tls_get_offset: + br %r14 diff --git a/binutils-2.21/ld/testsuite/ld-s390/tlspic.dd b/binutils-2.21/ld/testsuite/ld-s390/tlspic.dd new file mode 100644 index 0000000..d5caeaf --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-s390/tlspic.dd @@ -0,0 +1,189 @@ +#source: tlspic1.s +#source: tlspic2.s +#as: -m31 +#ld: -shared -melf_s390 +#objdump: -dzrj.text +#target: s390-*-* + +.*: +file format elf32-s390 + +Disassembly of section .text: + +0+[0-9a-f]+ <fn1>: +# function prolog + +[0-9a-f]+: 90 6e f0 18 stm %r6,%r14,24\(%r15\) + +[0-9a-f]+: a7 d5 00 30 bras %r13,[0-9a-f]+ <fn1\+0x64> +# _GLOBAL_OFFSET_TABLE_-.LT1 + +[0-9a-f]+: [0-9a-f ]+ .long 0x[0-9a-f]+ +# __tls_get_addr@plt-.LT1 + +[0-9a-f]+: [0-9a-f ]+ .long 0x[0-9a-f]+ +# sg1@tlsgd + +[0-9a-f]+: 00 00 00 38 .long 0x00000038 +# sg2@tlsgd + +[0-9a-f]+: 00 00 00 48 .long 0x00000048 +# sl1@tlsgd + +[0-9a-f]+: 00 00 00 10 .long 0x00000010 +# sl2@tlsgd + +[0-9a-f]+: 00 00 00 18 .long 0x00000018 +# sh1@tlsgd + +[0-9a-f]+: 00 00 00 4c .long 0x0000004c +# sh2@tlsgd + +[0-9a-f]+: 00 00 00 54 .long 0x00000054 +# sH1@tlsgd + +[0-9a-f]+: 00 00 00 28 .long 0x00000028 +# sH2@tlsgd + +[0-9a-f]+: 00 00 00 30 .long 0x00000030 +# sl1@tlsldm + +[0-9a-f]+: 00 00 00 20 .long 0x00000020 +# sl1@dtpoff + +[0-9a-f]+: 00 00 00 20 .long 0x00000020 +# sl2@dtpoff + +[0-9a-f]+: 00 00 00 24 .long 0x00000024 +# sh1@tlsldm + +[0-9a-f]+: 00 00 00 20 .long 0x00000020 +# sh1@dtpoff + +[0-9a-f]+: 00 00 00 40 .long 0x00000040 +# sh2@dtpoff + +[0-9a-f]+: 00 00 00 44 .long 0x00000044 +# sH1@tlsldm + +[0-9a-f]+: 00 00 00 20 .long 0x00000020 +# sH1@dtpoff + +[0-9a-f]+: 00 00 00 60 .long 0x00000060 +# sH2@dtpoff + +[0-9a-f]+: 00 00 00 64 .long 0x00000064 +# sg2@gotntpoff + +[0-9a-f]+: 00 00 00 48 .long 0x00000048 +# sl2@gotntpoff + +[0-9a-f]+: 00 00 00 18 .long 0x00000018 +# sh2@gotntpoff + +[0-9a-f]+: 00 00 00 54 .long 0x00000054 +# sH2@gotntpoff + +[0-9a-f]+: 00 00 00 30 .long 0x00000030 +# function prolog + +[0-9a-f]+: 18 ef lr %r14,%r15 + +[0-9a-f]+: 58 c0 d0 00 l %r12,0\(%r13\) + +[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 + +[0-9a-f]+: b2 4f 00 90 ear %r9,%a0 + +[0-9a-f]+: 58 70 d0 04 l %r7,4\(%r13\) +# GD + +[0-9a-f]+: 58 20 d0 08 l %r2,8\(%r13\) + +[0-9a-f]+: 4d e7 d0 00 bas %r14,0\(%r7,%r13\) + +[0-9a-f]+: 41 22 90 00 la %r2,0\(%r2,%r9\) +# GD -> IE because variable is referenced through IE too + +[0-9a-f]+: 58 20 d0 0c l %r2,12\(%r13\) + +[0-9a-f]+: 58 22 c0 00 l %r2,0\(%r2,%r12\) + +[0-9a-f]+: 41 22 90 00 la %r2,0\(%r2,%r9\) +# GD against local variable + +[0-9a-f]+: 58 20 d0 10 l %r2,16\(%r13\) + +[0-9a-f]+: 4d e7 d0 00 bas %r14,0\(%r7,%r13\) + +[0-9a-f]+: 41 22 90 00 la %r2,0\(%r2,%r9\) +# GD -> IE against local variable referenced through IE too + +[0-9a-f]+: 58 20 d0 14 l %r2,20\(%r13\) + +[0-9a-f]+: 58 22 c0 00 l %r2,0\(%r2,%r12\) + +[0-9a-f]+: 41 22 90 00 la %r2,0\(%r2,%r9\) +# GD against hidden and local variable + +[0-9a-f]+: 58 20 d0 18 l %r2,24\(%r13\) + +[0-9a-f]+: 4d e7 d0 00 bas %r14,0\(%r7,%r13\) + +[0-9a-f]+: 41 22 90 00 la %r2,0\(%r2,%r9\) +# GD -> IE against hidden and local variable referenced through +# IE too + +[0-9a-f]+: 58 20 d0 1c l %r2,28\(%r13\) + +[0-9a-f]+: 58 22 c0 00 l %r2,0\(%r2,%r12\) + +[0-9a-f]+: 41 22 90 00 la %r2,0\(%r2,%r9\) +# GD against hidden but not local variable + +[0-9a-f]+: 58 20 d0 20 l %r2,32\(%r13\) + +[0-9a-f]+: 4d e7 d0 00 bas %r14,0\(%r7,%r13\) + +[0-9a-f]+: 41 22 90 00 la %r2,0\(%r2,%r9\) +# GD -> IE against hidden but not local variable referenced through +# IE too + +[0-9a-f]+: 58 20 d0 24 l %r2,36\(%r13\) + +[0-9a-f]+: 58 22 c0 00 l %r2,0\(%r2,%r12\) + +[0-9a-f]+: 41 22 90 00 la %r2,0\(%r2,%r9\) +# LD + +[0-9a-f]+: 58 20 d0 28 l %r2,40\(%r13\) + +[0-9a-f]+: 4d e7 d0 00 bas %r14,0\(%r7,%r13\) + +[0-9a-f]+: 41 32 90 00 la %r3,0\(%r2,%r9\) + +[0-9a-f]+: 58 40 d0 2c l %r4,44\(%r13\) + +[0-9a-f]+: 41 54 30 00 la %r5,0\(%r4,%r3\) + +[0-9a-f]+: 58 40 d0 30 l %r4,48\(%r13\) + +[0-9a-f]+: 41 54 30 00 la %r5,0\(%r4,%r3\) +# LD against hidden and local variables + +[0-9a-f]+: 58 20 d0 34 l %r2,52\(%r13\) + +[0-9a-f]+: 4d e7 d0 00 bas %r14,0\(%r7,%r13\) + +[0-9a-f]+: 41 32 90 00 la %r3,0\(%r2,%r9\) + +[0-9a-f]+: 58 40 d0 38 l %r4,56\(%r13\) + +[0-9a-f]+: 41 54 30 00 la %r5,0\(%r4,%r3\) + +[0-9a-f]+: 58 40 d0 34 l %r4,52\(%r13\) + +[0-9a-f]+: 41 55 30 00 la %r5,0\(%r5,%r3\) +# LD against hidden but not local variables + +[0-9a-f]+: 58 20 d0 40 l %r2,64\(%r13\) + +[0-9a-f]+: 4d e7 d0 00 bas %r14,0\(%r7,%r13\) + +[0-9a-f]+: 41 32 90 00 la %r3,0\(%r2,%r9\) + +[0-9a-f]+: 58 30 d0 44 l %r3,68\(%r13\) + +[0-9a-f]+: 41 54 30 00 la %r5,0\(%r4,%r3\) + +[0-9a-f]+: 58 40 d0 48 l %r4,72\(%r13\) + +[0-9a-f]+: 41 54 30 00 la %r5,0\(%r4,%r3\) +# IE against global var + +[0-9a-f]+: 58 30 d0 4c l %r3,76\(%r13\) + +[0-9a-f]+: 58 33 c0 00 l %r3,0\(%r3,%r12\) + +[0-9a-f]+: 41 33 30 00 la %r3,0\(%r3,%r3\) +# IE against local var + +[0-9a-f]+: 58 30 d0 50 l %r3,80\(%r13\) + +[0-9a-f]+: 58 43 c0 00 l %r4,0\(%r3,%r12\) + +[0-9a-f]+: 41 54 30 00 la %r5,0\(%r4,%r3\) +# IE against hidden and local var + +[0-9a-f]+: 58 30 d0 54 l %r3,84\(%r13\) + +[0-9a-f]+: 58 43 c0 00 l %r4,0\(%r3,%r12\) + +[0-9a-f]+: 41 54 30 00 la %r5,0\(%r4,%r3\) +# IE against hidden but not local var + +[0-9a-f]+: 58 30 d0 58 l %r3,88\(%r13\) + +[0-9a-f]+: 58 43 c0 00 l %r4,0\(%r3,%r12\) + +[0-9a-f]+: 41 54 30 00 la %r5,0\(%r4,%r3\) +# IE against global var with small got access (no optimization) + +[0-9a-f]+: 58 30 c0 34 l %r3,52\(%r12\) + +[0-9a-f]+: 41 33 90 00 la %r3,0\(%r3,%r9\) +# IE against local var with small got access (no optimization) + +[0-9a-f]+: 58 30 c0 1c l %r3,28\(%r12\) + +[0-9a-f]+: 41 33 90 00 la %r3,0\(%r3,%r9\) +# IE against hidden and local var with small got access +# (no optimization) + +[0-9a-f]+: 58 30 c0 40 l %r3,64\(%r12\) + +[0-9a-f]+: 41 33 90 00 la %r3,0\(%r3,%r9\) +# IE against hidden but not local var with small got access +# (no optimization) + +[0-9a-f]+: 58 30 c0 44 l %r3,68\(%r12\) + +[0-9a-f]+: 41 33 90 00 la %r3,0\(%r3,%r9\) +# function prolog + +[0-9a-f]+: 98 6e f0 78 lm %r6,%r14,120\(%r15\) + +[0-9a-f]+: 07 fe br %r14 + +[0-9a-f]+: 07 07 nopr %r7 + +[0-9a-f]+: 07 07 nopr %r7 + +[0-9a-f]+: 07 07 nopr %r7 + +[0-9a-f]+: 07 07 nopr %r7 + +[0-9a-f]+: 07 07 nopr %r7 + +[0-9a-f]+: 07 07 nopr %r7 + +[0-9a-f]+: 07 07 nopr %r7 + +[0-9a-f]+: 07 07 nopr %r7 + +[0-9a-f]+: 07 07 nopr %r7 + +[0-9a-f]+: 07 07 nopr %r7 + +[0-9a-f]+: 07 07 nopr %r7 + +[0-9a-f]+: 07 07 nopr %r7 + +[0-9a-f]+: 07 07 nopr %r7 + +[0-9a-f]+: 07 07 nopr %r7 + +[0-9a-f]+: 07 07 nopr %r7 + +[0-9a-f]+: 07 07 nopr %r7 + +[0-9a-f]+: 07 07 nopr %r7 + +[0-9a-f]+: 07 07 nopr %r7 + +[0-9a-f]+: 07 07 nopr %r7 + +[0-9a-f]+: 07 07 nopr %r7 + +[0-9a-f]+: 07 07 nopr %r7 + +[0-9a-f]+: 07 07 nopr %r7 + +[0-9a-f]+: 07 07 nopr %r7 + +[0-9a-f]+: 07 07 nopr %r7 + +[0-9a-f]+: 07 07 nopr %r7 + +[0-9a-f]+: 07 07 nopr %r7 + +[0-9a-f]+: 07 07 nopr %r7 + +[0-9a-f]+: 07 07 nopr %r7 diff --git a/binutils-2.21/ld/testsuite/ld-s390/tlspic.rd b/binutils-2.21/ld/testsuite/ld-s390/tlspic.rd new file mode 100644 index 0000000..ec63e3d --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-s390/tlspic.rd @@ -0,0 +1,142 @@ +#source: tlspic1.s +#source: tlspic2.s +#as: -m31 +#ld: -shared -melf_s390 +#readelf: -Ssrl +#target: s390-*-* + +There are [0-9]+ section headers, starting at offset 0x[0-9a-f]+: + +Section Headers: + +\[Nr\] Name +Type +Addr +Off +Size +ES Flg Lk Inf Al + +\[[ 0-9]+\] +NULL +0+ 0+ 0+ 00 +0 +0 +0 + +\[[ 0-9]+\] .hash .* + +\[[ 0-9]+\] .dynsym .* + +\[[ 0-9]+\] .dynstr .* + +\[[ 0-9]+\] .rela.dyn .* + +\[[ 0-9]+\] .rela.plt .* + +\[[ 0-9]+\] .plt .* + +\[[ 0-9]+\] .text +PROGBITS .* + +\[[ 0-9]+\] .tdata +PROGBITS .* 0+60 00 WAT +0 +0 32 + +\[[ 0-9]+\] .tbss +NOBITS .* 0+20 00 WAT +0 +0 +1 + +\[[ 0-9]+\] .dynamic +DYNAMIC .* + +\[[ 0-9]+\] .got +PROGBITS .* + +\[[ 0-9]+\] .shstrtab .* + +\[[ 0-9]+\] .symtab .* + +\[[ 0-9]+\] .strtab .* +Key to Flags: +.* +.* +.* + +Elf file type is DYN \(Shared object file\) +Entry point 0x[0-9a-f]+ +There are [0-9]+ program headers, starting at offset [0-9]+ + +Program Headers: + +Type +Offset +VirtAddr +PhysAddr +FileSiz MemSiz +Flg Align + +LOAD .* R E 0x1000 + +LOAD .* RW +0x1000 + +DYNAMIC .* RW +0x4 + +TLS .* 0x0+60 0x0+80 R +0x20 + + Section to Segment mapping: + +Segment Sections... + +00 +.hash .dynsym .dynstr .rela.dyn .rela.plt .plt .text + +01 +.tdata .dynamic .got + +02 +.dynamic + +03 +.tdata .tbss + +Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 14 entries: + Offset +Info +Type +Sym.Value +Sym. Name \+ Addend +[0-9a-f ]+R_390_TLS_DTPMOD +0+ +[0-9a-f ]+R_390_TLS_TPOFF +0+24 +[0-9a-f ]+R_390_TLS_TPOFF +0+30 +[0-9a-f ]+R_390_TLS_DTPMOD +0+ +[0-9a-f ]+R_390_TLS_DTPMOD +0+ +[0-9a-f ]+R_390_TLS_TPOFF +0+64 +[0-9a-f ]+R_390_TLS_TPOFF +0+50 +[0-9a-f ]+R_390_TLS_TPOFF +0+70 +[0-9a-f ]+R_390_TLS_DTPMOD +0+ +[0-9a-f ]+R_390_TLS_TPOFF +0+44 +[0-9a-f ]+R_390_TLS_TPOFF +0+10 +sg5 \+ 0 +[0-9a-f ]+R_390_TLS_DTPMOD +0+ +sg1 \+ 0 +[0-9a-f ]+R_390_TLS_DTPOFF +0+ +sg1 \+ 0 +[0-9a-f ]+R_390_TLS_TPOFF +0+4 +sg2 \+ 0 + +Relocation section '.rela.plt' at offset 0x[0-9a-f]+ contains 1 entries: + Offset +Info +Type +Sym.Value +Sym. Name \+ Addend +[0-9a-f ]+R_390_JMP_SLOT +0+ +__tls_get_offset \+ 0 + +Symbol table '\.dynsym' contains [0-9]+ entries: + +Num: +Value +Size +Type +Bind +Vis +Ndx +Name +.* NOTYPE +LOCAL +DEFAULT +UND +.* SECTION +LOCAL +DEFAULT +7 +.* SECTION +LOCAL +DEFAULT +8 +.* TLS +GLOBAL +DEFAULT +8 sg8 +.* TLS +GLOBAL +DEFAULT +8 sg3 +.* TLS +GLOBAL +DEFAULT +8 sg4 +.* TLS +GLOBAL +DEFAULT +8 sg5 +.* NOTYPE +GLOBAL +DEFAULT +UND __tls_get_offset +.* TLS +GLOBAL +DEFAULT +8 sg1 +.* FUNC +GLOBAL +DEFAULT +7 fn1 +.* NOTYPE +GLOBAL +DEFAULT +ABS __bss_start +.* TLS +GLOBAL +DEFAULT +8 sg2 +.* TLS +GLOBAL +DEFAULT +8 sg6 +.* TLS +GLOBAL +DEFAULT +8 sg7 +.* NOTYPE +GLOBAL +DEFAULT +ABS _edata +.* NOTYPE +GLOBAL +DEFAULT +ABS _end + +Symbol table '\.symtab' contains [0-9]+ entries: + +Num: +Value +Size +Type +Bind +Vis +Ndx +Name +.* NOTYPE +LOCAL +DEFAULT +UND +.* SECTION +LOCAL +DEFAULT +1 +.* SECTION +LOCAL +DEFAULT +2 +.* SECTION +LOCAL +DEFAULT +3 +.* SECTION +LOCAL +DEFAULT +4 +.* SECTION +LOCAL +DEFAULT +5 +.* SECTION +LOCAL +DEFAULT +6 +.* SECTION +LOCAL +DEFAULT +7 +.* SECTION +LOCAL +DEFAULT +8 +.* SECTION +LOCAL +DEFAULT +9 +.* SECTION +LOCAL +DEFAULT +10 +.* SECTION +LOCAL +DEFAULT +11 +.* TLS +LOCAL +DEFAULT +8 sl1 +.* TLS +LOCAL +DEFAULT +8 sl2 +.* TLS +LOCAL +DEFAULT +8 sl3 +.* TLS +LOCAL +DEFAULT +8 sl4 +.* TLS +LOCAL +DEFAULT +8 sl5 +.* TLS +LOCAL +DEFAULT +8 sl6 +.* TLS +LOCAL +DEFAULT +8 sl7 +.* TLS +LOCAL +DEFAULT +8 sl8 +.* TLS +LOCAL +DEFAULT +9 sH1 +.* OBJECT +LOCAL +DEFAULT +ABS _DYNAMIC +.* TLS +LOCAL +DEFAULT +8 sh3 +.* TLS +LOCAL +DEFAULT +9 sH2 +.* TLS +LOCAL +DEFAULT +9 sH7 +.* TLS +LOCAL +DEFAULT +8 sh7 +.* TLS +LOCAL +DEFAULT +8 sh8 +.* TLS +LOCAL +DEFAULT +9 sH4 +.* TLS +LOCAL +DEFAULT +8 sh4 +.* TLS +LOCAL +DEFAULT +9 sH3 +.* TLS +LOCAL +DEFAULT +8 sh5 +.* TLS +LOCAL +DEFAULT +9 sH5 +.* TLS +LOCAL +DEFAULT +9 sH6 +.* TLS +LOCAL +DEFAULT +9 sH8 +.* TLS +LOCAL +DEFAULT +8 sh1 +.* OBJECT +LOCAL +DEFAULT +ABS _GLOBAL_OFFSET_TABLE_ +.* TLS +LOCAL +DEFAULT +8 sh2 +.* TLS +LOCAL +DEFAULT +8 sh6 +.* TLS +GLOBAL +DEFAULT +8 sg8 +.* TLS +GLOBAL +DEFAULT +8 sg3 +.* TLS +GLOBAL +DEFAULT +8 sg4 +.* TLS +GLOBAL +DEFAULT +8 sg5 +.* NOTYPE +GLOBAL +DEFAULT +UND __tls_get_offset +.* TLS +GLOBAL +DEFAULT +8 sg1 +.* FUNC +GLOBAL +DEFAULT +7 fn1 +.* NOTYPE +GLOBAL +DEFAULT +ABS __bss_start +.* TLS +GLOBAL +DEFAULT +8 sg2 +.* TLS +GLOBAL +DEFAULT +8 sg6 +.* TLS +GLOBAL +DEFAULT +8 sg7 +.* NOTYPE +GLOBAL +DEFAULT +ABS _edata +.* NOTYPE +GLOBAL +DEFAULT +ABS _end diff --git a/binutils-2.21/ld/testsuite/ld-s390/tlspic.sd b/binutils-2.21/ld/testsuite/ld-s390/tlspic.sd new file mode 100644 index 0000000..6e32dea --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-s390/tlspic.sd @@ -0,0 +1,16 @@ +#source: tlspic1.s +#source: tlspic2.s +#as: -m31 +#ld: -shared -melf_s390 +#objdump: -sj.got +#target: s390-*-* + +.*: +file format elf32-s390 + +Contents of section .got: + [0-9a-f]+ [0-9a-f]+ 00000000 00000000 [0-9a-f]+ .* + [0-9a-f]+ 00000000 00000020 00000000 00000000 .* + [0-9a-f]+ 00000000 00000000 00000000 00000060 .* + [0-9a-f]+ 00000000 00000000 00000000 00000000 .* + [0-9a-f]+ 00000000 00000000 00000000 00000000 .* + [0-9a-f]+ 00000040 00000000 +.* diff --git a/binutils-2.21/ld/testsuite/ld-s390/tlspic.td b/binutils-2.21/ld/testsuite/ld-s390/tlspic.td new file mode 100644 index 0000000..265dbe2 --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-s390/tlspic.td @@ -0,0 +1,16 @@ +#source: tlspic1.s +#source: tlspic2.s +#as: -m31 +#ld: -shared -melf_s390 +#objdump: -sj.tdata +#target: s390-*-* + +.*: +file format elf32-s390 + +Contents of section .tdata: + [0-9a-f]+ 00000011 00000012 00000013 00000014 .* + [0-9a-f]+ 00000015 00000016 00000017 00000018 .* + [0-9a-f]+ 00000041 00000042 00000043 00000044 .* + [0-9a-f]+ 00000045 00000046 00000047 00000048 .* + [0-9a-f]+ 00000101 00000102 00000103 00000104 .* + [0-9a-f]+ 00000105 00000106 00000107 00000108 .* diff --git a/binutils-2.21/ld/testsuite/ld-s390/tlspic1.s b/binutils-2.21/ld/testsuite/ld-s390/tlspic1.s new file mode 100644 index 0000000..28b9c3a --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-s390/tlspic1.s @@ -0,0 +1,208 @@ + .section ".tdata", "awT", @progbits + .balign 32 + .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 +sg1: .long 17 +sg2: .long 18 +sg3: .long 19 +sg4: .long 20 +sg5: .long 21 +sg6: .long 22 +sg7: .long 23 +sg8: .long 24 +sl1: .long 65 +sl2: .long 66 +sl3: .long 67 +sl4: .long 68 +sl5: .long 69 +sl6: .long 70 +sl7: .long 71 +sl8: .long 72 +sh1: .long 257 +sh2: .long 258 +sh3: .long 259 +sh4: .long 260 +sh5: .long 261 +sh6: .long 262 +sh7: .long 263 +sh8: .long 264 + .text + .globl fn1 + .type fn1,@function + .balign 64 +fn1: + /* Funtion prolog */ + stm %r6,%r14,24(%r15) + bras %r13,.LTN1 + /* Literal pool */ +.LT1: +.LC0: + .long _GLOBAL_OFFSET_TABLE_-.LT1 +.LC1: + .long __tls_get_offset@plt-.LT1 +.LC2: + .long sg1@tlsgd +.LC3: + .long sg2@tlsgd +.LC4: + .long sl1@tlsgd +.LC5: + .long sl2@tlsgd +.LC6: + .long sh1@tlsgd +.LC7: + .long sh2@tlsgd +.LC8: + .long sH1@tlsgd +.LC9: + .long sH2@tlsgd +.LC10: + .long sl1@tlsldm +.LC11: + .long sl1@dtpoff +.LC12: + .long sl2@dtpoff +.LC13: + .long sh1@tlsldm +.LC14: + .long sh1@dtpoff +.LC15: + .long sh2@dtpoff +.LC16: + .long sH1@tlsldm +.LC17: + .long sH1@dtpoff +.LC18: + .long sH2@dtpoff +.LC19: + .long sg2@gotntpoff +.LC20: + .long sl2@gotntpoff +.LC21: + .long sh2@gotntpoff +.LC22: + .long sH2@gotntpoff +.LTN1: + /* Funtion prolog */ + lr %r14,%r15 + l %r12,.LC0-.LT1(%r13) + ahi %r15,-96 + la %r12,0(%r12,%r13) + st %r14,0(%r14) + + /* Extract TCB and load branch offset */ + ear %r9,%a0 + l %r7,.LC1-.LT1(%r13) + + /* GD */ + l %r2,.LC2-.LT1(%r13) + bas %r14,0(%r7,%r13):tls_gdcall:sg1 + la %r2,0(%r2,%r9) + + /* GD -> IE because variable is referenced through IE too */ + l %r2,.LC3-.LT1(%r13) + bas %r14,0(%r7,%r13):tls_gdcall:sg2 + la %r2,0(%r2,%r9) + + /* GD against local variable */ + 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 + la %r2,0(%r2,%r9) + + /* GD against hidden and local variable */ + 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) + bas %r14,0(%r7,%r13):tls_gdcall:sh2 + la %r2,0(%r2,%r9) + + /* GD against hidden but not local variable */ + l %r2,.LC8-.LT1(%r13) + bas %r14,0(%r7,%r13):tls_gdcall:sH1 + la %r2,0(%r2,%r9) + + /* GD -> IE against hidden but not local variable referenced through + IE too */ + l %r2,.LC9-.LT1(%r13) + bas %r14,0(%r7,%r13):tls_gdcall:sH2 + la %r2,0(%r2,%r9) + + /* LD */ + l %r2,.LC10-.LT1(%r13) + bas %r14,0(%r7,%r13):tls_ldcall:sl1 + la %r3,0(%r2,%r9) + l %r4,.LC11-.LT1(%r13) + la %r5,0(%r4,%r3) + l %r4,.LC12-.LT1(%r13) + la %r5,0(%r4,%r3) + + /* LD against hidden and local variables */ + l %r2,.LC13-.LT1(%r13) + bas %r14,0(%r7,%r13):tls_ldcall:sh1 + la %r3,0(%r2,%r9) + l %r4,.LC14-.LT1(%r13) + 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 + la %r3,0(%r2,%r9) + l %r3,.LC17-.LT1(%r13) + la %r5,0(%r4,%r3) + l %r4,.LC18-.LT1(%r13) + la %r5,0(%r4,%r3) + + /* IE against global var */ + l %r3,.LC19-.LT1(%r13) + l %r3,0(%r3,%r12):tls_load:sg2 + la %r3,0(%r3,%r3) + + /* IE against local var */ + l %r3,.LC20-.LT1(%r13) + l %r4,0(%r3,%r12):tls_load:sl2 + la %r5,0(%r4,%r3) + + /* IE against hidden and local var */ + 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 + la %r5,0(%r4,%r3) + + /* IE against global var with small got access (no optimization) */ + l %r3,sg5@gotntpoff(%r12) + la %r3,0(%r3,%r9) + + /* IE against local var with small got access (no optimization) */ + l %r3,sl5@gotntpoff(%r12) + la %r3,0(%r3,%r9) + + /* IE against hidden and local var with small got access + (no optimization) */ + l %r3,sh5@gotntpoff(%r12) + la %r3,0(%r3,%r9) + + /* IE against hidden but not local var with small got access + (no optimization) */ + l %r3,sH5@gotntpoff(%r12) + la %r3,0(%r3,%r9) + + /* Function epilog */ + lm %r6,%r14,120(%r15) + br %r14 + diff --git a/binutils-2.21/ld/testsuite/ld-s390/tlspic1_64.s b/binutils-2.21/ld/testsuite/ld-s390/tlspic1_64.s new file mode 100644 index 0000000..4e50008 --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-s390/tlspic1_64.s @@ -0,0 +1,224 @@ + .section ".tdata", "awT", @progbits + .balign 32 + .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 +sg1: .long 17 +sg2: .long 18 +sg3: .long 19 +sg4: .long 20 +sg5: .long 21 +sg6: .long 22 +sg7: .long 23 +sg8: .long 24 +sl1: .long 65 +sl2: .long 66 +sl3: .long 67 +sl4: .long 68 +sl5: .long 69 +sl6: .long 70 +sl7: .long 71 +sl8: .long 72 +sh1: .long 257 +sh2: .long 258 +sh3: .long 259 +sh4: .long 260 +sh5: .long 261 +sh6: .long 262 +sh7: .long 263 +sh8: .long 264 + .text + .globl fn1 + .type fn1,@function + .balign 64 +fn1: + /* Funtion prolog */ + stmg %r6,%r14,48(%r15) + bras %r13,.LTN1 + /* Literal pool */ +.LT1: +.LC2: + .quad sg1@tlsgd +.LC3: + .quad sg2@tlsgd +.LC4: + .quad sl1@tlsgd +.LC5: + .quad sl2@tlsgd +.LC6: + .quad sh1@tlsgd +.LC7: + .quad sh2@tlsgd +.LC8: + .quad sH1@tlsgd +.LC9: + .quad sH2@tlsgd +.LC10: + .quad sl1@tlsldm +.LC11: + .quad sl1@dtpoff +.LC12: + .quad sl2@dtpoff +.LC13: + .quad sh1@tlsldm +.LC14: + .quad sh1@dtpoff +.LC15: + .quad sh2@dtpoff +.LC16: + .quad sH1@tlsldm +.LC17: + .quad sH1@dtpoff +.LC18: + .quad sH2@dtpoff +.LC19: + .quad sg2@gotntpoff +.LC20: + .quad sl2@gotntpoff +.LC21: + .quad sh2@gotntpoff +.LC22: + .quad sH2@gotntpoff +.LTN1: + /* Funtion prolog */ + lgr %r14,%r15 + larl %r12,_GLOBAL_OFFSET_TABLE_ + aghi %r15,-160 + stg %r14,0(%r14) + + /* Extract TCB */ + ear %r9,%a0 + sllg %r9,%r4,32 + ear %r9,%a1 + + /* GD */ + lg %r2,.LC2-.LT1(%r13) + brasl %r14,__tls_get_offset@plt:tls_gdcall:sg1 + la %r2,0(%r2,%r9) + + /* GD -> IE because variable is referenced through IE too */ + lg %r2,.LC3-.LT1(%r13) + brasl %r14,__tls_get_offset@plt:tls_gdcall:sg2 + la %r2,0(%r2,%r9) + + /* GD against local variable */ + lg %r2,.LC4-.LT1(%r13) + brasl %r14,__tls_get_offset@plt:tls_gdcall:sl1 + la %r2,0(%r2,%r9) + + /* GD -> IE against local variable referenced through IE too */ + lg %r2,.LC5-.LT1(%r13) + brasl %r14,__tls_get_offset@plt:tls_gdcall:sl2 + la %r2,0(%r2,%r9) + + /* GD against hidden and local variable */ + 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) + brasl %r14,__tls_get_offset@plt:tls_gdcall:sh2 + la %r2,0(%r2,%r9) + + /* GD against hidden but not local variable */ + lg %r2,.LC8-.LT1(%r13) + brasl %r14,__tls_get_offset@plt:tls_gdcall:sH1 + la %r2,0(%r2,%r9) + + /* GD -> IE against hidden but not local variable referenced through + IE too */ + lg %r2,.LC9-.LT1(%r13) + brasl %r14,__tls_get_offset@plt:tls_gdcall:sH2 + la %r2,0(%r2,%r9) + + /* LD */ + lg %r2,.LC10-.LT1(%r13) + brasl %r14,__tls_get_offset@plt:tls_ldcall:sl1 + la %r3,0(%r2,%r9) + lg %r4,.LC11-.LT1(%r13) + la %r5,0(%r4,%r3) + lg %r4,.LC12-.LT1(%r13) + la %r5,0(%r4,%r3) + + /* LD against hidden and local variables */ + lg %r2,.LC13-.LT1(%r13) + brasl %r14,__tls_get_offset@plt:tls_ldcall:sh1 + la %r3,0(%r2,%r9) + lg %r4,.LC14-.LT1(%r13) + 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 + la %r3,0(%r2,%r9) + lg %r4,.LC17-.LT1(%r13) + la %r5,0(%r4,%r3) + lg %r4,.LC18-.LT1(%r13) + la %r5,0(%r4,%r3) + + /* IE against global var */ + lg %r3,.LC19-.LT1(%r13) + lg %r3,0(%r3,%r12):tls_load:sg2 + la %r3,0(%r3,%r9) + + /* IE against local var */ + lg %r3,.LC20-.LT1(%r13) + lg %r4,0(%r3,%r12):tls_load:sl2 + la %r5,0(%r4,%r9) + + /* IE against hidden and local var */ + 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 + la %r5,0(%r4,%r9) + + /* IE against global var with larl got access */ + larl %r3,sg5@indntpoff + lg %r3,0(%r3,%r12):tls_load:sg2 + la %r3,0(%r3,%r9) + + /* IE against local var with larl got access */ + larl %r3,sl5@indntpoff + lg %r4,0(%r3,%r12):tls_load:sl2 + la %r5,0(%r4,%r9) + + /* IE against hidden and local var with larl got access */ + 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 + la %r5,0(%r4,%r9) + + /* IE against global var with small got access (no optimization) */ + lg %r3,sg5@gotntpoff(%r12) + la %r3,0(%r3,%r9) + + /* IE against local var with small got access (no optimization) */ + lg %r3,sl5@gotntpoff(%r12) + la %r3,0(%r3,%r9) + + /* IE against hidden and local var with small got access + (no optimization) */ + lg %r3,sh5@gotntpoff(%r12) + la %r3,0(%r3,%r9) + + /* IE against hidden but not local var with small got access + (no optimization) */ + lg %r3,sH5@gotntpoff(%r12) + la %r3,0(%r3,%r9) + + /* Function epilog */ + lmg %r6,%r14,208(%r15) + br %r14 + diff --git a/binutils-2.21/ld/testsuite/ld-s390/tlspic2.s b/binutils-2.21/ld/testsuite/ld-s390/tlspic2.s new file mode 100644 index 0000000..5513f9b --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-s390/tlspic2.s @@ -0,0 +1,11 @@ + .section ".tbss", "awT", @nobits + .globl sH1, sH2, sH3, sH4, sH5, sH6, sH7, sH8 + .hidden sH1, sH2, sH3, sH4, sH5, sH6, sH7, sH8 +sH1: .space 4 +sH2: .space 4 +sH3: .space 4 +sH4: .space 4 +sH5: .space 4 +sH6: .space 4 +sH7: .space 4 +sH8: .space 4 diff --git a/binutils-2.21/ld/testsuite/ld-s390/tlspic2_64.s b/binutils-2.21/ld/testsuite/ld-s390/tlspic2_64.s new file mode 100644 index 0000000..5513f9b --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-s390/tlspic2_64.s @@ -0,0 +1,11 @@ + .section ".tbss", "awT", @nobits + .globl sH1, sH2, sH3, sH4, sH5, sH6, sH7, sH8 + .hidden sH1, sH2, sH3, sH4, sH5, sH6, sH7, sH8 +sH1: .space 4 +sH2: .space 4 +sH3: .space 4 +sH4: .space 4 +sH5: .space 4 +sH6: .space 4 +sH7: .space 4 +sH8: .space 4 diff --git a/binutils-2.21/ld/testsuite/ld-s390/tlspic_64.dd b/binutils-2.21/ld/testsuite/ld-s390/tlspic_64.dd new file mode 100644 index 0000000..274cd16 --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-s390/tlspic_64.dd @@ -0,0 +1,202 @@ +#source: tlspic1.s +#source: tlspic2.s +#as: -m64 -Aesame +#ld: -shared -melf64_s390 +#objdump: -dzrj.text +#target: s390x-*-* + +.*: +file format elf64-s390 + +Disassembly of section .text: + +0+[0-9a-f]+ <fn1>: +# function prolog + +[0-9a-f]+: eb 6e f0 30 00 24 stmg %r6,%r14,48\(%r15\) + +[0-9a-f]+: a7 d5 00 56 bras %r13,[0-9a-f]+ <fn1\+0xb2> +# sg1@tlsgd + +[0-9a-f]+: 00 00 00 00 .long 0x00000000 + +[0-9a-f]+: 00 00 00 70 .long 0x00000070 +# sg2@tlsgd + +[0-9a-f]+: 00 00 00 00 .long 0x00000000 + +[0-9a-f]+: 00 00 00 90 .long 0x00000090 +# sl1@tlsgd + +[0-9a-f]+: 00 00 00 00 .long 0x00000000 + +[0-9a-f]+: 00 00 00 20 .long 0x00000020 +# sl2@tlsgd + +[0-9a-f]+: 00 00 00 00 .long 0x00000000 + +[0-9a-f]+: 00 00 00 30 .long 0x00000030 +# sh1@tlsgd + +[0-9a-f]+: 00 00 00 00 .long 0x00000000 + +[0-9a-f]+: 00 00 00 98 .long 0x00000098 +# sh2@tlsgd + +[0-9a-f]+: 00 00 00 00 .long 0x00000000 + +[0-9a-f]+: 00 00 00 a8 .long 0x000000a8 +# sH1@tlsgd + +[0-9a-f]+: 00 00 00 00 .long 0x00000000 + +[0-9a-f]+: 00 00 00 50 .long 0x00000050 +# sH2@tlsgd + +[0-9a-f]+: 00 00 00 00 .long 0x00000000 + +[0-9a-f]+: 00 00 00 60 .long 0x00000060 +# sl1@tlsldm + +[0-9a-f]+: 00 00 00 00 .long 0x00000000 + +[0-9a-f]+: 00 00 00 40 .long 0x00000040 +# sl1@dtpoff + +[0-9a-f]+: 00 00 00 00 .long 0x00000000 + +[0-9a-f]+: 00 00 00 20 .long 0x00000020 +# sl2@dtpoff + +[0-9a-f]+: 00 00 00 00 .long 0x00000000 + +[0-9a-f]+: 00 00 00 24 .long 0x00000024 +# sh1@tlsldm + +[0-9a-f]+: 00 00 00 00 .long 0x00000000 + +[0-9a-f]+: 00 00 00 40 .long 0x00000040 +# sh1@dtpoff + +[0-9a-f]+: 00 00 00 00 .long 0x00000000 + +[0-9a-f]+: 00 00 00 40 .long 0x00000040 +# sh2@dtpoff + +[0-9a-f]+: 00 00 00 00 .long 0x00000000 + +[0-9a-f]+: 00 00 00 44 .long 0x00000044 +# sH1@tlsldm + +[0-9a-f]+: 00 00 00 00 .long 0x00000000 + +[0-9a-f]+: 00 00 00 40 .long 0x00000040 +# sH1@dtpoff + +[0-9a-f]+: 00 00 00 00 .long 0x00000000 + +[0-9a-f]+: 00 00 00 60 .long 0x00000060 +# sH2@dtpoff + +[0-9a-f]+: 00 00 00 00 .long 0x00000000 + +[0-9a-f]+: 00 00 00 64 .long 0x00000064 +# sg2@gotntpoff + +[0-9a-f]+: 00 00 00 00 .long 0x00000000 + +[0-9a-f]+: 00 00 00 90 .long 0x00000090 +# sl2@gotntpoff + +[0-9a-f]+: 00 00 00 00 .long 0x00000000 + +[0-9a-f]+: 00 00 00 30 .long 0x00000030 +# sh2@gotntpoff + +[0-9a-f]+: 00 00 00 00 .long 0x00000000 + +[0-9a-f]+: 00 00 00 a8 .long 0x000000a8 +# sH2@gotntpoff + +[0-9a-f]+: 00 00 00 00 .long 0x00000000 + +[0-9a-f]+: 00 00 00 60 .long 0x00000060 +# function prolog + +[0-9a-f]+: b9 04 00 ef lgr %r14,%r15 + +[0-9a-f]+: c0 c0 [0-9a-f ]+ larl %r12,[0-9a-f]+ <_GLOBAL_OFFSET_TABLE_> + +[0-9a-f]+: a7 fb ff 60 aghi %r15,-160 + +[0-9a-f]+: e3 e0 e0 00 00 24 stg %r14,0\(%r14\) +# extract TCB + +[0-9a-f]+: b2 4f 00 90 ear %r9,%a0 + +[0-9a-f]+: eb 94 00 20 00 0d sllg %r9,%r4,32 + +[0-9a-f]+: b2 4f 00 91 ear %r9,%a1 +# GD + +[0-9a-f]+: e3 20 d0 00 00 04 lg %r2,0\(%r13\) + +[0-9a-f]+: c0 e5 [0-9a-f ]+ brasl %r14,[0-9a-f]+ <.*> + +[0-9a-f]+: 41 22 90 00 la %r2,0\(%r2,%r9\) +# GD -> IE because variable is referenced through IE too + +[0-9a-f]+: e3 20 d0 08 00 04 lg %r2,8\(%r13\) + +[0-9a-f]+: e3 22 c0 00 00 04 lg %r2,0\(%r2,%r12\) + +[0-9a-f]+: 41 22 90 00 la %r2,0\(%r2,%r9\) +# GD against local variable + +[0-9a-f]+: e3 20 d0 10 00 04 lg %r2,16\(%r13\) + +[0-9a-f]+: c0 e5 [0-9a-f ]+ brasl %r14,[0-9a-f]+ <.*> + +[0-9a-f]+: 41 22 90 00 la %r2,0\(%r2,%r9\) +# GD -> IE against local variable referenced through IE too + +[0-9a-f]+: e3 20 d0 18 00 04 lg %r2,24\(%r13\) + +[0-9a-f]+: e3 22 c0 00 00 04 lg %r2,0\(%r2,%r12\) + +[0-9a-f]+: 41 22 90 00 la %r2,0\(%r2,%r9\) +# GD against hidden and local variable + +[0-9a-f]+: e3 20 d0 20 00 04 lg %r2,32\(%r13\) + +[0-9a-f]+: c0 e5 [0-9a-f ]+ brasl %r14,[0-9a-f]+ <.*> + +[0-9a-f]+: 41 22 90 00 la %r2,0\(%r2,%r9\) +# GD -> IE against hidden and local variable referenced through +# IE too + +[0-9a-f]+: e3 20 d0 28 00 04 lg %r2,40\(%r13\) + +[0-9a-f]+: e3 22 c0 00 00 04 lg %r2,0\(%r2,%r12\) + +[0-9a-f]+: 41 22 90 00 la %r2,0\(%r2,%r9\) +# GD against hidden but not local variable + +[0-9a-f]+: e3 20 d0 30 00 04 lg %r2,48\(%r13\) + +[0-9a-f]+: c0 e5 [0-9a-f ]+ brasl %r14,[0-9a-f]+ <.*> + +[0-9a-f]+: 41 22 90 00 la %r2,0\(%r2,%r9\) +# GD -> IE against hidden but not local variable referenced through +# IE too + +[0-9a-f]+: e3 20 d0 38 00 04 lg %r2,56\(%r13\) + +[0-9a-f]+: e3 22 c0 00 00 04 lg %r2,0\(%r2,%r12\) + +[0-9a-f]+: 41 22 90 00 la %r2,0\(%r2,%r9\) +# LD + +[0-9a-f]+: e3 20 d0 40 00 04 lg %r2,64\(%r13\) + +[0-9a-f]+: c0 e5 [0-9a-f ]+ brasl %r14,[0-9a-f]+ <.*> + +[0-9a-f]+: 41 32 90 00 la %r3,0\(%r2,%r9\) + +[0-9a-f]+: e3 40 d0 48 00 04 lg %r4,72\(%r13\) + +[0-9a-f]+: 41 54 30 00 la %r5,0\(%r4,%r3\) + +[0-9a-f]+: e3 40 d0 50 00 04 lg %r4,80\(%r13\) + +[0-9a-f]+: 41 54 30 00 la %r5,0\(%r4,%r3\) +# LD against hidden and local variables + +[0-9a-f]+: e3 20 d0 58 00 04 lg %r2,88\(%r13\) + +[0-9a-f]+: c0 e5 [0-9a-f ]+ brasl %r14,[0-9a-f]+ <.*> + +[0-9a-f]+: 41 32 90 00 la %r3,0\(%r2,%r9\) + +[0-9a-f]+: e3 40 d0 60 00 04 lg %r4,96\(%r13\) + +[0-9a-f]+: 41 54 30 00 la %r5,0\(%r4,%r3\) + +[0-9a-f]+: e3 40 d0 68 00 04 lg %r4,104\(%r13\) + +[0-9a-f]+: 41 54 30 00 la %r5,0\(%r4,%r3\) +# LD against hidden but not local variables + +[0-9a-f]+: e3 20 d0 70 00 04 lg %r2,112\(%r13\) + +[0-9a-f]+: c0 e5 [0-9a-f ]+ brasl %r14,[0-9a-f]+ <.*> + +[0-9a-f]+: 41 32 90 00 la %r3,0\(%r2,%r9\) + +[0-9a-f]+: e3 40 d0 78 00 04 lg %r4,120\(%r13\) + +[0-9a-f]+: 41 54 30 00 la %r5,0\(%r4,%r3\) + +[0-9a-f]+: e3 40 d0 80 00 04 lg %r4,128\(%r13\) + +[0-9a-f]+: 41 54 30 00 la %r5,0\(%r4,%r3\) +# IE against global var + +[0-9a-f]+: e3 30 d0 88 00 04 lg %r3,136\(%r13\) + +[0-9a-f]+: e3 33 c0 00 00 04 lg %r3,0\(%r3,%r12\) + +[0-9a-f]+: 41 33 90 00 la %r3,0\(%r3,%r9\) +# IE against local var + +[0-9a-f]+: e3 30 d0 90 00 04 lg %r3,144\(%r13\) + +[0-9a-f]+: e3 43 c0 00 00 04 lg %r4,0\(%r3,%r12\) + +[0-9a-f]+: 41 54 90 00 la %r5,0\(%r4,%r9\) +# IE against hidden and local var + +[0-9a-f]+: e3 30 d0 98 00 04 lg %r3,152\(%r13\) + +[0-9a-f]+: e3 43 c0 00 00 04 lg %r4,0\(%r3,%r12\) + +[0-9a-f]+: 41 54 90 00 la %r5,0\(%r4,%r9\) +# IE against hidden but not local var + +[0-9a-f]+: e3 30 d0 a0 00 04 lg %r3,160\(%r13\) + +[0-9a-f]+: e3 43 c0 00 00 04 lg %r4,0\(%r3,%r12\) + +[0-9a-f]+: 41 54 90 00 la %r5,0\(%r4,%r9\) +# IE against global var with larl got access + +[0-9a-f]+: c0 30 [0-9a-f ]+ larl %r3,[0-9a-f]+ <\_GLOBAL\_OFFSET\_TABLE\_\+0x68> + +[0-9a-f]+: e3 33 c0 00 00 04 lg %r3,0\(%r3,%r12\) + +[0-9a-f]+: 41 33 90 00 la %r3,0\(%r3,%r9\) +# IE against local var with larl got access + +[0-9a-f]+: c0 30 [0-9a-f ]+ larl %r3,[0-9a-f]+ <\_GLOBAL\_OFFSET\_TABLE\_\+0x38> + +[0-9a-f]+: e3 43 c0 00 00 04 lg %r4,0\(%r3,%r12\) + +[0-9a-f]+: 41 54 90 00 la %r5,0\(%r4,%r9\) +# IE against hidden and local var with larl got access + +[0-9a-f]+: c0 30 [0-9a-f ]+ larl %r3,[0-9a-f]+ <\_GLOBAL\_OFFSET\_TABLE\_\+0x80> + +[0-9a-f]+: e3 43 c0 00 00 04 lg %r4,0\(%r3,%r12\) + +[0-9a-f]+: 41 54 90 00 la %r5,0\(%r4,%r9\) +# IE against hidden but not local var with larl got access + +[0-9a-f]+: c0 30 [0-9a-f ]+ larl %r3,[0-9a-f]+ <\_GLOBAL\_OFFSET\_TABLE\_\+0x88> + +[0-9a-f]+: e3 43 c0 00 00 04 lg %r4,0\(%r3,%r12\) + +[0-9a-f]+: 41 54 90 00 la %r5,0\(%r4,%r9\) +# IE against global var with small got access (no optimization) + +[0-9a-f]+: e3 30 c0 68 00 04 lg %r3,104\(%r12\) + +[0-9a-f]+: 41 33 90 00 la %r3,0\(%r3,%r9\) +# IE against local var with small got access (no optimization) + +[0-9a-f]+: e3 30 c0 38 00 04 lg %r3,56\(%r12\) + +[0-9a-f]+: 41 33 90 00 la %r3,0\(%r3,%r9\) +# IE against hidden and local var with small got access +# (no optimization) + +[0-9a-f]+: e3 30 c0 80 00 04 lg %r3,128\(%r12\) + +[0-9a-f]+: 41 33 90 00 la %r3,0\(%r3,%r9\) +# IE against hidden but not local var with small got access +# (no optimization) + +[0-9a-f]+: e3 30 c0 88 00 04 lg %r3,136\(%r12\) + +[0-9a-f]+: 41 33 90 00 la %r3,0\(%r3,%r9\) +# function epilog + +[0-9a-f]+: eb 6e f0 d0 00 04 lmg %r6,%r14,208\(%r15\) + +[0-9a-f]+: 07 fe br %r14 + +[0-9a-f]+: 07 07 nopr %r7 + +[0-9a-f]+: 07 07 nopr %r7 + +[0-9a-f]+: 07 07 nopr %r7 + +[0-9a-f]+: 07 07 nopr %r7 + +[0-9a-f]+: 07 07 nopr %r7 + +[0-9a-f]+: 07 07 nopr %r7 + +[0-9a-f]+: 07 07 nopr %r7 + +[0-9a-f]+: 07 07 nopr %r7 diff --git a/binutils-2.21/ld/testsuite/ld-s390/tlspic_64.rd b/binutils-2.21/ld/testsuite/ld-s390/tlspic_64.rd new file mode 100644 index 0000000..da8c9bf --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-s390/tlspic_64.rd @@ -0,0 +1,142 @@ +#source: tlspic1.s +#source: tlspic2.s +#as: -m64 -Aesame +#ld: -shared -melf64_s390 +#readelf: -WSsrl +#target: s390x-*-* + +There are [0-9]+ section headers, starting at offset 0x[0-9a-f]+: + +Section Headers: + +\[Nr\] Name +Type +Address +Off +Size +ES Flg Lk Inf Al + +\[[ 0-9]+\] +NULL +0+ 0+ 0+ 0+ +0 +0 +0 + +\[[ 0-9]+\] .hash .* + +\[[ 0-9]+\] .dynsym .* + +\[[ 0-9]+\] .dynstr .* + +\[[ 0-9]+\] .rela.dyn .* + +\[[ 0-9]+\] .rela.plt .* + +\[[ 0-9]+\] .plt .* + +\[[ 0-9]+\] .text +PROGBITS .* + +\[[ 0-9]+\] .tdata +PROGBITS .* 0+60 00 WAT +0 +0 +32 + +\[[ 0-9]+\] .tbss +NOBITS .* 0+20 00 WAT +0 +0 +1 + +\[[ 0-9]+\] .dynamic +DYNAMIC .* + +\[[ 0-9]+\] .got +PROGBITS .* + +\[[ 0-9]+\] .shstrtab .* + +\[[ 0-9]+\] .symtab .* + +\[[ 0-9]+\] .strtab .* +Key to Flags: +.* +.* +.* + +Elf file type is DYN \(Shared object file\) +Entry point 0x[0-9a-f]+ +There are [0-9]+ program headers, starting at offset [0-9]+ + +Program Headers: + +Type +Offset +VirtAddr +PhysAddr +FileSiz +MemSiz +Flg Align + +LOAD .* R E 0x1000 + +LOAD .* RW +0x1000 + +DYNAMIC .* RW +0x8 + +TLS .* 0x0+60 0x0+80 R +0x20 + + Section to Segment mapping: + +Segment Sections... + +00 +.hash .dynsym .dynstr .rela.dyn .rela.plt .plt .text * + +01 +.tdata .dynamic .got * + +02 +.dynamic * + +03 +.tdata .tbss * + +Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 14 entries: + +Offset +Info +Type +Symbol's Value +Symbol's Name \+ Addend +[0-9a-f ]+R_390_TLS_DTPMOD +0+ +[0-9a-f ]+R_390_TLS_TPOFF +0+24 +[0-9a-f ]+R_390_TLS_TPOFF +0+30 +[0-9a-f ]+R_390_TLS_DTPMOD +0+ +[0-9a-f ]+R_390_TLS_DTPMOD +0+ +[0-9a-f ]+R_390_TLS_TPOFF +0+64 +[0-9a-f ]+R_390_TLS_TPOFF +0+50 +[0-9a-f ]+R_390_TLS_TPOFF +0+70 +[0-9a-f ]+R_390_TLS_DTPMOD +0+ +[0-9a-f ]+R_390_TLS_TPOFF +0+44 +[0-9a-f ]+R_390_TLS_TPOFF +0+10 sg5 \+ 0 +[0-9a-f ]+R_390_TLS_DTPMOD +0+ sg1 \+ 0 +[0-9a-f ]+R_390_TLS_DTPOFF +0+ sg1 \+ 0 +[0-9a-f ]+R_390_TLS_TPOFF +0+4 sg2 \+ 0 + +Relocation section '.rela.plt' at offset 0x[0-9a-f]+ contains 1 entries: + +Offset +Info +Type +Symbol's Value +Symbol's Name \+ Addend +[0-9a-f ]+R_390_JMP_SLOT +0+ __tls_get_offset \+ 0 + +Symbol table '\.dynsym' contains [0-9]+ entries: + +Num: +Value +Size +Type +Bind +Vis +Ndx +Name +.* NOTYPE +LOCAL +DEFAULT +UND +.* SECTION +LOCAL +DEFAULT +7 +.* SECTION +LOCAL +DEFAULT +8 +.* TLS +GLOBAL +DEFAULT +8 sg8 +.* TLS +GLOBAL +DEFAULT +8 sg3 +.* TLS +GLOBAL +DEFAULT +8 sg4 +.* TLS +GLOBAL +DEFAULT +8 sg5 +.* NOTYPE +GLOBAL +DEFAULT +UND __tls_get_offset +.* TLS +GLOBAL +DEFAULT +8 sg1 +.* FUNC +GLOBAL +DEFAULT +7 fn1 +.* NOTYPE +GLOBAL +DEFAULT +ABS __bss_start +.* TLS +GLOBAL +DEFAULT +8 sg2 +.* TLS +GLOBAL +DEFAULT +8 sg6 +.* TLS +GLOBAL +DEFAULT +8 sg7 +.* NOTYPE +GLOBAL +DEFAULT +ABS _edata +.* NOTYPE +GLOBAL +DEFAULT +ABS _end + +Symbol table '\.symtab' contains [0-9]+ entries: + +Num: +Value +Size +Type +Bind +Vis +Ndx +Name +.* NOTYPE +LOCAL +DEFAULT +UND +.* SECTION +LOCAL +DEFAULT +1 +.* SECTION +LOCAL +DEFAULT +2 +.* SECTION +LOCAL +DEFAULT +3 +.* SECTION +LOCAL +DEFAULT +4 +.* SECTION +LOCAL +DEFAULT +5 +.* SECTION +LOCAL +DEFAULT +6 +.* SECTION +LOCAL +DEFAULT +7 +.* SECTION +LOCAL +DEFAULT +8 +.* SECTION +LOCAL +DEFAULT +9 +.* SECTION +LOCAL +DEFAULT +10 +.* SECTION +LOCAL +DEFAULT +11 +.* TLS +LOCAL +DEFAULT +8 sl1 +.* TLS +LOCAL +DEFAULT +8 sl2 +.* TLS +LOCAL +DEFAULT +8 sl3 +.* TLS +LOCAL +DEFAULT +8 sl4 +.* TLS +LOCAL +DEFAULT +8 sl5 +.* TLS +LOCAL +DEFAULT +8 sl6 +.* TLS +LOCAL +DEFAULT +8 sl7 +.* TLS +LOCAL +DEFAULT +8 sl8 +.* TLS +LOCAL +DEFAULT +9 sH1 +.* OBJECT +LOCAL +DEFAULT +ABS _DYNAMIC +.* TLS +LOCAL +DEFAULT +8 sh3 +.* TLS +LOCAL +DEFAULT +9 sH2 +.* TLS +LOCAL +DEFAULT +9 sH7 +.* TLS +LOCAL +DEFAULT +8 sh7 +.* TLS +LOCAL +DEFAULT +8 sh8 +.* TLS +LOCAL +DEFAULT +9 sH4 +.* TLS +LOCAL +DEFAULT +8 sh4 +.* TLS +LOCAL +DEFAULT +9 sH3 +.* TLS +LOCAL +DEFAULT +8 sh5 +.* TLS +LOCAL +DEFAULT +9 sH5 +.* TLS +LOCAL +DEFAULT +9 sH6 +.* TLS +LOCAL +DEFAULT +9 sH8 +.* TLS +LOCAL +DEFAULT +8 sh1 +.* OBJECT +LOCAL +DEFAULT +ABS _GLOBAL_OFFSET_TABLE_ +.* TLS +LOCAL +DEFAULT +8 sh2 +.* TLS +LOCAL +DEFAULT +8 sh6 +.* TLS +GLOBAL +DEFAULT +8 sg8 +.* TLS +GLOBAL +DEFAULT +8 sg3 +.* TLS +GLOBAL +DEFAULT +8 sg4 +.* TLS +GLOBAL +DEFAULT +8 sg5 +.* NOTYPE +GLOBAL +DEFAULT +UND __tls_get_offset +.* TLS +GLOBAL +DEFAULT +8 sg1 +.* FUNC +GLOBAL +DEFAULT +7 fn1 +.* NOTYPE +GLOBAL +DEFAULT +ABS __bss_start +.* TLS +GLOBAL +DEFAULT +8 sg2 +.* TLS +GLOBAL +DEFAULT +8 sg6 +.* TLS +GLOBAL +DEFAULT +8 sg7 +.* NOTYPE +GLOBAL +DEFAULT +ABS _edata +.* NOTYPE +GLOBAL +DEFAULT +ABS _end diff --git a/binutils-2.21/ld/testsuite/ld-s390/tlspic_64.sd b/binutils-2.21/ld/testsuite/ld-s390/tlspic_64.sd new file mode 100644 index 0000000..267416e --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-s390/tlspic_64.sd @@ -0,0 +1,21 @@ +#source: tlspic1.s +#source: tlspic2.s +#as: -m64 -Aesame +#ld: -shared -melf64_s390 +#objdump: -sj.got +#target: s390x-*-* + +.*: +file format elf64-s390 + +Contents of section .got: + [0-9a-f]+ [0-9a-f]+ [0-9a-f]+ 00000000 00000000 .* + [0-9a-f]+ 00000000 00000000 [0-9a-f]+ [0-9a-f]+ .* + [0-9a-f]+ 00000000 00000000 00000000 00000020 .* + [0-9a-f]+ 00000000 00000000 00000000 00000000 .* + [0-9a-f]+ 00000000 00000000 00000000 00000000 .* + [0-9a-f]+ 00000000 00000000 00000000 00000060 .* + [0-9a-f]+ 00000000 00000000 00000000 00000000 .* + [0-9a-f]+ 00000000 00000000 00000000 00000000 .* + [0-9a-f]+ 00000000 00000000 00000000 00000000 .* + [0-9a-f]+ 00000000 00000000 00000000 00000000 .* + [0-9a-f]+ 00000000 00000040 00000000 00000000 .* diff --git a/binutils-2.21/ld/testsuite/ld-s390/tlspic_64.td b/binutils-2.21/ld/testsuite/ld-s390/tlspic_64.td new file mode 100644 index 0000000..36623bb --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-s390/tlspic_64.td @@ -0,0 +1,16 @@ +#source: tlspic1.s +#source: tlspic2.s +#as: -m64 -Aesame +#ld: -shared -melf64_s390 +#objdump: -sj.tdata +#target: s390x-*-* + +.*: +file format elf64-s390 + +Contents of section .tdata: + [0-9a-f]+ 00000011 00000012 00000013 00000014 .* + [0-9a-f]+ 00000015 00000016 00000017 00000018 .* + [0-9a-f]+ 00000041 00000042 00000043 00000044 .* + [0-9a-f]+ 00000045 00000046 00000047 00000048 .* + [0-9a-f]+ 00000101 00000102 00000103 00000104 .* + [0-9a-f]+ 00000105 00000106 00000107 00000108 .* |