diff options
Diffstat (limited to 'binutils-2.21/ld/testsuite/ld-alpha')
20 files changed, 983 insertions, 0 deletions
diff --git a/binutils-2.21/ld/testsuite/ld-alpha/align.s b/binutils-2.21/ld/testsuite/ld-alpha/align.s new file mode 100644 index 0000000..6c48ba9 --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-alpha/align.s @@ -0,0 +1,9 @@ + /* Force .data aligned to 4K, so that .got very likely gets + placed at 0x1200131d0. */ + .data + .balign 4096 + + /* Force .text aligned to 4K, so it very likely gets placed at + 0x120001000. */ + .text + .balign 4096 diff --git a/binutils-2.21/ld/testsuite/ld-alpha/alpha.exp b/binutils-2.21/ld/testsuite/ld-alpha/alpha.exp new file mode 100644 index 0000000..dce2f45 --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-alpha/alpha.exp @@ -0,0 +1,64 @@ +# Expect script for ld-alpha 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 Alpha ELF linking; all types of relocs. This tests the +# assembler and tools like objdump as well as the linker. + +if { !([istarget "alpha*-*-elf*"] + || [istarget "alpha*-*-linux*"]) } { + 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 alphatests { + {"TLS -fpic -shared" "-shared -melf64alpha" + "" {align.s tlspic1.s tlspic2.s} + {{readelf -WSsrl tlspic.rd} {objdump -drj.text tlspic.dd} + {objdump -sj.got tlspic.sd} {objdump -sj.tdata tlspic.td}} + "libtlspic.so"} + {"Helper shared library" "-shared -melf64alpha" + "" {tlslib.s} {} "libtlslib.so"} + {"TLS -fpic and -fno-pic exec" + "-melf64alpha tmpdir/libtlslib.so" "" {align.s tlsbinpic.s tlsbin.s} + {{readelf -WSsrl tlsbin.rd} {objdump -drj.text tlsbin.dd} + {objdump -sj.got tlsbin.sd} {objdump -sj.tdata tlsbin.td}} + "tlsbin"} + {"TLS -fpic and -fno-pic exec -relax" + "-relax -melf64alpha tmpdir/libtlslib.so" "" {align.s tlsbinpic.s tlsbin.s} + {{readelf -WSsrl tlsbinr.rd} {objdump -drj.text tlsbinr.dd} + {objdump -sj.got tlsbinr.sd}} + "tlsbinr"} +} + +# Not implemented yet +# {"TLS in debug sections" "-melf64alpha" +# "" {tlsg.s} +# {{objdump -sj.debug_foobar tlsg.sd}} "tlsg"} + +run_ld_link_tests $alphatests diff --git a/binutils-2.21/ld/testsuite/ld-alpha/tlsbin.dd b/binutils-2.21/ld/testsuite/ld-alpha/tlsbin.dd new file mode 100644 index 0000000..674ec37 --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-alpha/tlsbin.dd @@ -0,0 +1,62 @@ +#source: align.s +#source: tlsbinpic.s +#source: tlsbin.s +#as: +#ld: -melf64alpha +#objdump: -drj.text +#target: alpha*-*-* + +.*: +file format elf64-alpha + +Disassembly of section \.text: + +0+120001000 <fn2>: + 120001000: 02 00 bb 27 ldah gp,2\(t12\) + 120001004: c0 82 bd 23 lda gp,-32064\(gp\) + 120001008: 3e 15 c2 43 subq sp,0x10,sp + 12000100c: 00 00 5e b7 stq ra,0\(sp\) + 120001010: 18 80 1d 22 lda a0,-32744\(gp\) + 120001014: 08 80 7d a7 ldq t12,-32760\(gp\) + 120001018: 00 40 5b 6b jsr ra,\(t12\),12000101c <.*> + 12000101c: 02 00 ba 27 ldah gp,2\(ra\) + 120001020: a4 82 bd 23 lda gp,-32092\(gp\) + 120001024: 38 80 1d 22 lda a0,-32712\(gp\) + 120001028: 08 80 7d a7 ldq t12,-32760\(gp\) + 12000102c: 00 40 5b 6b jsr ra,\(t12\),120001030 <.*> + 120001030: 02 00 ba 27 ldah gp,2\(ra\) + 120001034: 90 82 bd 23 lda gp,-32112\(gp\) + 120001038: 28 80 1d 22 lda a0,-32728\(gp\) + 12000103c: 08 80 7d a7 ldq t12,-32760\(gp\) + 120001040: 00 40 5b 6b jsr ra,\(t12\),120001044 <.*> + 120001044: 02 00 ba 27 ldah gp,2\(ra\) + 120001048: 7c 82 bd 23 lda gp,-32132\(gp\) + 12000104c: 21 00 20 20 lda t0,33\(v0\) + 120001050: 28 80 1d 22 lda a0,-32728\(gp\) + 120001054: 08 80 7d a7 ldq t12,-32760\(gp\) + 120001058: 00 40 5b 6b jsr ra,\(t12\),12000105c <.*> + 12000105c: 02 00 ba 27 ldah gp,2\(ra\) + 120001060: 64 82 bd 23 lda gp,-32156\(gp\) + 120001064: 40 00 20 20 lda t0,64\(v0\) + 120001068: 46 00 20 20 lda t0,70\(v0\) + 12000106c: 00 00 20 24 ldah t0,0\(v0\) + 120001070: 4b 00 21 20 lda t0,75\(t0\) + 120001074: 10 80 3d a4 ldq t0,-32752\(gp\) + 120001078: 01 04 20 40 addq t0,v0,t0 + 12000107c: 00 00 5e a7 ldq ra,0\(sp\) + 120001080: 1e 14 c2 43 addq sp,0x10,sp + 120001084: 01 80 fa 6b ret + +0+120001088 <_start>: + 120001088: 9e 00 00 00 rduniq + 12000108c: 09 04 e0 47 mov v0,s0 + 120001090: 00 80 3d a4 ldq t0,-32768\(gp\) + 120001094: 01 04 29 40 addq t0,s0,t0 + 120001098: 48 80 3d a4 ldq t0,-32696\(gp\) + 12000109c: 01 04 29 40 addq t0,s0,t0 + 1200010a0: 10 00 29 20 lda t0,16\(s0\) + 1200010a4: 96 00 29 20 lda t0,150\(s0\) + 1200010a8: 00 00 29 24 ldah t0,0\(s0\) + 1200010ac: 57 00 21 20 lda t0,87\(t0\) + 1200010b0: 50 80 3d a4 ldq t0,-32688\(gp\) + 1200010b4: 01 04 29 40 addq t0,s0,t0 + 1200010b8: 01 80 fa 6b ret diff --git a/binutils-2.21/ld/testsuite/ld-alpha/tlsbin.rd b/binutils-2.21/ld/testsuite/ld-alpha/tlsbin.rd new file mode 100644 index 0000000..44633ac --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-alpha/tlsbin.rd @@ -0,0 +1,133 @@ +#source: align.s +#source: tlsbinpic.s +#source: tlsbin.s +#as: +#ld: -melf64alpha +#readelf: -WSsrl +#target: alpha*-*-* + +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]+\] .text +PROGBITS +[0-9a-f]+ [0-9a-f]+ [0-9a-f]+ 00 +AX +0 +0 4096 + +\[[ 0-9]+\] .eh_frame +PROGBITS +[0-9a-f]+ [0-9a-f]+ [0-9a-f]+ 00 +A +0 +0 +8 + +\[[ 0-9]+\] .tdata +PROGBITS +[0-9a-f]+ [0-9a-f]+ [0-9a-f]+ 00 WAT +0 +0 +4 + +\[[ 0-9]+\] .tbss +NOBITS +[0-9a-f]+ [0-9a-f]+ [0-9a-f]+ 00 WAT +0 +0 +1 + +\[[ 0-9]+\] .dynamic +DYNAMIC +[0-9a-f]+ [0-9a-f]+ [0-9a-f]+ 10 +WA +4 +0 +8 + +\[[ 0-9]+\] .plt +.* + +\[[ 0-9]+\] .got +PROGBITS +[0-9a-f]+ [0-9a-f]+ [0-9a-f]+ 00 +WA +0 +0 +8 + +\[[ 0-9]+\] .shstrtab +.* + +\[[ 0-9]+\] .symtab +.* + +\[[ 0-9]+\] .strtab +.* +#... + +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 +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x0+150 R E 0x8 + INTERP +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ R +0x1 +.*Requesting program interpreter.* + LOAD +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ R E 0x10000 + LOAD +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ RWE 0x10000 + DYNAMIC +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ RW +0x8 + TLS +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ R +0x4 +#... + +Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 3 entries: + +Offset +Info +Type +Symbol's Value Symbol's Name \+ Addend +[0-9a-f]+ [0-9a-f]+ R_ALPHA_TPREL64 +0+ sG2 \+ 0 +[0-9a-f]+ [0-9a-f]+ R_ALPHA_DTPMOD64 +0+ sG1 \+ 0 +[0-9a-f]+ [0-9a-f]+ R_ALPHA_DTPREL64 +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]+ [0-9a-f]+ R_ALPHA_JMP_SLOT +[0-9a-f]+ __tls_get_addr \+ 0 + +Symbol table '\.dynsym' contains [0-9]+ entries: + +Num: +Value +Size +Type +Bind +Vis +Ndx +Name +[0-9 ]+: [0-9a-f]+ +0 +NOTYPE +LOCAL +DEFAULT +UND * +[0-9 ]+: [0-9a-f]+ +0 +TLS +GLOBAL +DEFAULT +UND sG2 +[0-9 ]+: [0-9a-f]+ +0 +FUNC +GLOBAL +DEFAULT +UND __tls_get_addr +[0-9 ]+: [0-9a-f]+ +0 +NOTYPE +GLOBAL +DEFAULT +ABS __bss_start +[0-9 ]+: [0-9a-f]+ +0 +TLS +GLOBAL +DEFAULT +UND sG1 +[0-9 ]+: [0-9a-f]+ +0 +NOTYPE +GLOBAL +DEFAULT +ABS _edata +[0-9 ]+: [0-9a-f]+ +0 +NOTYPE +GLOBAL +DEFAULT +ABS _end + +Symbol table '\.symtab' contains [0-9]+ entries: + +Num: +Value +Size +Type +Bind +Vis +Ndx +Name +[0-9 ]+: 0+ +0 +NOTYPE +LOCAL +DEFAULT +UND +[0-9 ]+: [0-9a-f]+ +0 +SECTION +LOCAL +DEFAULT +1 +[0-9 ]+: [0-9a-f]+ +0 +SECTION +LOCAL +DEFAULT +2 +[0-9 ]+: [0-9a-f]+ +0 +SECTION +LOCAL +DEFAULT +3 +[0-9 ]+: [0-9a-f]+ +0 +SECTION +LOCAL +DEFAULT +4 +[0-9 ]+: [0-9a-f]+ +0 +SECTION +LOCAL +DEFAULT +5 +[0-9 ]+: [0-9a-f]+ +0 +SECTION +LOCAL +DEFAULT +6 +[0-9 ]+: [0-9a-f]+ +0 +SECTION +LOCAL +DEFAULT +7 +[0-9 ]+: [0-9a-f]+ +0 +SECTION +LOCAL +DEFAULT +8 +[0-9 ]+: [0-9a-f]+ +0 +SECTION +LOCAL +DEFAULT +9 +[0-9 ]+: [0-9a-f]+ +0 +SECTION +LOCAL +DEFAULT +10 +[0-9 ]+: [0-9a-f]+ +0 +SECTION +LOCAL +DEFAULT +11 +[0-9 ]+: [0-9a-f]+ +0 +SECTION +LOCAL +DEFAULT +12 +[0-9 ]+: [0-9a-f]+ +0 +SECTION +LOCAL +DEFAULT +13 +[0-9 ]+: [0-9a-f]+ +0 +TLS +LOCAL +DEFAULT +9 sl1 +[0-9 ]+: [0-9a-f]+ +0 +TLS +LOCAL +DEFAULT +9 sl2 +[0-9 ]+: [0-9a-f]+ +0 +TLS +LOCAL +DEFAULT +9 sl3 +[0-9 ]+: [0-9a-f]+ +0 +TLS +LOCAL +DEFAULT +9 sl4 +[0-9 ]+: [0-9a-f]+ +0 +TLS +LOCAL +DEFAULT +9 sl5 +[0-9 ]+: [0-9a-f]+ +0 +TLS +LOCAL +DEFAULT +9 sl6 +[0-9 ]+: [0-9a-f]+ +0 +TLS +LOCAL +DEFAULT +9 sl7 +[0-9 ]+: [0-9a-f]+ +0 +TLS +LOCAL +DEFAULT +9 sl8 +[0-9 ]+: [0-9a-f]+ +0 +TLS +LOCAL +DEFAULT +10 bl1 +[0-9 ]+: [0-9a-f]+ +0 +TLS +LOCAL +DEFAULT +10 bl2 +[0-9 ]+: [0-9a-f]+ +0 +TLS +LOCAL +DEFAULT +10 bl3 +[0-9 ]+: [0-9a-f]+ +0 +TLS +LOCAL +DEFAULT +10 bl4 +[0-9 ]+: [0-9a-f]+ +0 +TLS +LOCAL +DEFAULT +10 bl5 +[0-9 ]+: [0-9a-f]+ +0 +TLS +LOCAL +DEFAULT +10 bl6 +[0-9 ]+: [0-9a-f]+ +0 +TLS +LOCAL +DEFAULT +10 bl7 +[0-9 ]+: [0-9a-f]+ +0 +TLS +LOCAL +DEFAULT +10 bl8 +[0-9 ]+: [0-9a-f]+ +0 +OBJECT +LOCAL +DEFAULT +11 _DYNAMIC +[0-9 ]+: [0-9a-f]+ +0 +OBJECT +LOCAL +DEFAULT +12 _PROCEDURE_LINKAGE_TABLE_ +[0-9 ]+: [0-9a-f]+ +0 +OBJECT +LOCAL +DEFAULT +13 _GLOBAL_OFFSET_TABLE_ +[0-9 ]+: [0-9a-f]+ +0 +TLS +GLOBAL +DEFAULT +9 sg8 +[0-9 ]+: [0-9a-f]+ +0 +TLS +GLOBAL +DEFAULT +10 bg8 +[0-9 ]+: [0-9a-f]+ +0 +TLS +GLOBAL +DEFAULT +10 bg6 +[0-9 ]+: [0-9a-f]+ +0 +TLS +GLOBAL +DEFAULT +10 bg3 +[0-9 ]+: [0-9a-f]+ +0 +TLS +GLOBAL +DEFAULT +9 sg3 +[0-9 ]+: [0-9a-f]+ +0 +TLS +GLOBAL +HIDDEN +9 sh3 +[0-9 ]+: [0-9a-f]+ +0 +TLS +GLOBAL +DEFAULT +UND sG2 +[0-9 ]+: [0-9a-f]+ +0 +TLS +GLOBAL +DEFAULT +9 sg4 +[0-9 ]+: [0-9a-f]+ +0 +TLS +GLOBAL +DEFAULT +9 sg5 +[0-9 ]+: [0-9a-f]+ +0 +TLS +GLOBAL +DEFAULT +10 bg5 +[0-9 ]+: [0-9a-f]+ +0 +FUNC +GLOBAL +DEFAULT +UND __tls_get_addr +[0-9 ]+: [0-9a-f]+ +0 +TLS +GLOBAL +HIDDEN +9 sh7 +[0-9 ]+: [0-9a-f]+ +0 +TLS +GLOBAL +HIDDEN +9 sh8 +[0-9 ]+: [0-9a-f]+ +0 +TLS +GLOBAL +DEFAULT +9 sg1 +[0-9 ]+: [0-9a-f]+ +52 +FUNC +GLOBAL +DEFAULT +7 _start +[0-9 ]+: [0-9a-f]+ +0 +TLS +GLOBAL +HIDDEN +9 sh4 +[0-9 ]+: [0-9a-f]+ +0 +TLS +GLOBAL +DEFAULT +10 bg7 +[0-9 ]+: [0-9a-f]+ +0 +TLS +GLOBAL +HIDDEN +9 sh5 +[0-9 ]+: [0-9a-f]+ +0 +NOTYPE +GLOBAL +DEFAULT +ABS __bss_start +[0-9 ]+: [0-9a-f]+ +136 +FUNC +GLOBAL +DEFAULT +\[<other>: 88\] +7 fn2 +[0-9 ]+: [0-9a-f]+ +0 +TLS +GLOBAL +DEFAULT +9 sg2 +[0-9 ]+: [0-9a-f]+ +0 +TLS +GLOBAL +DEFAULT +UND sG1 +[0-9 ]+: [0-9a-f]+ +0 +TLS +GLOBAL +HIDDEN +9 sh1 +[0-9 ]+: [0-9a-f]+ +0 +TLS +GLOBAL +DEFAULT +9 sg6 +[0-9 ]+: [0-9a-f]+ +0 +TLS +GLOBAL +DEFAULT +9 sg7 +[0-9 ]+: [0-9a-f]+ +0 +NOTYPE +GLOBAL +DEFAULT +ABS _edata +[0-9 ]+: [0-9a-f]+ +0 +NOTYPE +GLOBAL +DEFAULT +ABS _end +[0-9 ]+: [0-9a-f]+ +0 +TLS +GLOBAL +HIDDEN +9 sh2 +[0-9 ]+: [0-9a-f]+ +0 +TLS +GLOBAL +HIDDEN +9 sh6 +[0-9 ]+: [0-9a-f]+ +0 +TLS +GLOBAL +DEFAULT +10 bg2 +[0-9 ]+: [0-9a-f]+ +0 +TLS +GLOBAL +DEFAULT +10 bg1 +[0-9 ]+: [0-9a-f]+ +0 +TLS +GLOBAL +DEFAULT +10 bg4 diff --git a/binutils-2.21/ld/testsuite/ld-alpha/tlsbin.s b/binutils-2.21/ld/testsuite/ld-alpha/tlsbin.s new file mode 100644 index 0000000..a772a7e --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-alpha/tlsbin.s @@ -0,0 +1,46 @@ + .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 + .ent _start +_start: + rduniq + mov $0, $9 + + /* IE */ + ldq $1, sG2($gp) !gottprel + addq $1, $9, $1 + + /* IE against global symbol in exec */ + ldq $1, bl1($gp) !gottprel + addq $1, $9, $1 + + /* LE */ + lda $1, sg1($9) !tprel + lda $1, bl2+2($9) !tprel + + ldah $1, sh2+3($9) !tprelhi + lda $1, sh2+3($1) !tprello + + ldq $1, bl2+4($gp) !gottprel + addq $1, $9, $1 + + ret + .end _start diff --git a/binutils-2.21/ld/testsuite/ld-alpha/tlsbin.sd b/binutils-2.21/ld/testsuite/ld-alpha/tlsbin.sd new file mode 100644 index 0000000..1bf0278 --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-alpha/tlsbin.sd @@ -0,0 +1,17 @@ +#source: align.s +#source: tlsbinpic.s +#source: tlsbin.s +#as: +#ld: -melfalpha +#objdump: -sj.got +#target: alpha*-*-* + +.*: +file format elf64-alpha + +Contents of section .got: + [0-9a-f]+ 00000000 00000000 b0120120 01000000 .* + [0-9a-f]+ 56000000 00000000 00000000 00000000 .* + [0-9a-f]+ 00000000 00000000 01000000 00000000 .* + [0-9a-f]+ 00000000 00000000 01000000 00000000 .* + [0-9a-f]+ 24000000 00000000 90000000 00000000 .* + [0-9a-f]+ 98000000 00000000 .* diff --git a/binutils-2.21/ld/testsuite/ld-alpha/tlsbin.td b/binutils-2.21/ld/testsuite/ld-alpha/tlsbin.td new file mode 100644 index 0000000..8bd7a6c --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-alpha/tlsbin.td @@ -0,0 +1,17 @@ +#source: align.s +#source: tlsbinpic.s +#source: tlsbin.s +#as: +#ld: -melf64alpha +#objdump: -sj.tdata +#target: alpha*-*-* + +.*: +file format elf64-alpha + +Contents of section .tdata: + 1?200110f0 11000000 12000000 13000000 14000000 .* + 1?20011100 15000000 16000000 17000000 18000000 .* + 1?20011110 41000000 42000000 43000000 44000000 .* + 1?20011120 45000000 46000000 47000000 48000000 .* + 1?20011130 01010000 02010000 03010000 04010000 .* + 1?20011140 05010000 06010000 07010000 08010000 .* diff --git a/binutils-2.21/ld/testsuite/ld-alpha/tlsbinpic.s b/binutils-2.21/ld/testsuite/ld-alpha/tlsbinpic.s new file mode 100644 index 0000000..7a94eb1 --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-alpha/tlsbinpic.s @@ -0,0 +1,74 @@ + .section ".tdata", "awT", @progbits + .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 fn2 + .ent fn2 +fn2: + .frame $sp, 16, $26, 0 + ldgp $gp, 0($27) + subq $sp, 16, $sp + stq $26, 0($sp) + .prologue 1 + + /* GD */ + lda $16, sG1($gp) !tlsgd!1 + ldq $27, __tls_get_addr($gp) !literal!1 + jsr $26, ($27), __tls_get_addr !lituse_tlsgd!1 + ldgp $gp, 0($26) + + /* GD against local symbol */ + lda $16, sl2($gp) !tlsgd!2 + ldq $27, __tls_get_addr($gp) !literal!2 + jsr $26, ($27), __tls_get_addr !lituse_tlsgd!2 + ldgp $gp, 0($26) + + /* LD */ + lda $16, sl1($gp) !tlsldm!3 + ldq $27, __tls_get_addr($gp) !literal!3 + jsr $26, ($27), __tls_get_addr !lituse_tlsldm!3 + ldgp $gp, 0($26) + lda $1, sl1+1($0) !dtprel + + /* LD with 4 variables */ + lda $16, sh1($gp) !tlsldm!4 + ldq $27, __tls_get_addr($gp) !literal!4 + jsr $26, ($27), __tls_get_addr !lituse_tlsldm!4 + ldgp $gp, 0($26) + lda $1, sh1($0) !dtprel + lda $1, sh2+2($0) !dtprel + ldah $1, sh3+3($0) !dtprelhi + lda $1, sh3+3($1) !dtprello + ldq $1, sh4+10($gp) !gotdtprel + addq $1, $0, $1 + + ldq $26, 0($sp) + addq $sp, 16, $sp + ret + .end fn2 diff --git a/binutils-2.21/ld/testsuite/ld-alpha/tlsbinr.dd b/binutils-2.21/ld/testsuite/ld-alpha/tlsbinr.dd new file mode 100644 index 0000000..16d024d --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-alpha/tlsbinr.dd @@ -0,0 +1,62 @@ +#source: align.s +#source: tlsbinpic.s +#source: tlsbin.s +#as: +#ld: -relax -melf64alpha +#objdump: -drj.text +#target: alpha*-*-* + +.*: +file format elf64-alpha + +Disassembly of section \.text: + +0+120001000 <fn2>: + 120001000: 02 00 bb 27 ldah gp,2\(t12\) + 120001004: 90 82 bd 23 lda gp,-32112\(gp\) + 120001008: 3e 15 c2 43 subq sp,0x10,sp + 12000100c: 00 00 5e b7 stq ra,0\(sp\) + 120001010: 08 80 1d a6 ldq a0,-32760\(gp\) + 120001014: 00 00 fe 2f unop + 120001018: 9e 00 00 00 rduniq + 12000101c: 00 04 00 42 addq a0,v0,v0 + 120001020: 00 00 fe 2f unop + 120001024: 34 00 1f 22 lda a0,52 + 120001028: 00 00 fe 2f unop + 12000102c: 9e 00 00 00 rduniq + 120001030: 00 04 00 42 addq a0,v0,v0 + 120001034: 00 00 fe 2f unop + 120001038: 10 00 1f 22 lda a0,16 + 12000103c: 00 00 fe 2f unop + 120001040: 9e 00 00 00 rduniq + 120001044: 00 04 00 42 addq a0,v0,v0 + 120001048: 00 00 fe 2f unop + 12000104c: 21 00 20 20 lda t0,33\(v0\) + 120001050: 10 00 1f 22 lda a0,16 + 120001054: 00 00 fe 2f unop + 120001058: 9e 00 00 00 rduniq + 12000105c: 00 04 00 42 addq a0,v0,v0 + 120001060: 00 00 fe 2f unop + 120001064: 40 00 20 20 lda t0,64\(v0\) + 120001068: 46 00 20 20 lda t0,70\(v0\) + 12000106c: 00 00 20 24 ldah t0,0\(v0\) + 120001070: 4b 00 21 20 lda t0,75\(t0\) + 120001074: 56 00 3f 20 lda t0,86 + 120001078: 01 04 20 40 addq t0,v0,t0 + 12000107c: 00 00 5e a7 ldq ra,0\(sp\) + 120001080: 1e 14 c2 43 addq sp,0x10,sp + 120001084: 01 80 fa 6b ret + +0000000120001088 <_start>: + 120001088: 9e 00 00 00 rduniq + 12000108c: 09 04 e0 47 mov v0,s0 + 120001090: 00 80 3d a4 ldq t0,-32768\(gp\) + 120001094: 01 04 29 40 addq t0,s0,t0 + 120001098: 90 00 3f 20 lda t0,144 + 12000109c: 01 04 29 40 addq t0,s0,t0 + 1200010a0: 10 00 29 20 lda t0,16\(s0\) + 1200010a4: 96 00 29 20 lda t0,150\(s0\) + 1200010a8: 00 00 29 24 ldah t0,0\(s0\) + 1200010ac: 57 00 21 20 lda t0,87\(t0\) + 1200010b0: 98 00 3f 20 lda t0,152 + 1200010b4: 01 04 29 40 addq t0,s0,t0 + 1200010b8: 01 80 fa 6b ret diff --git a/binutils-2.21/ld/testsuite/ld-alpha/tlsbinr.rd b/binutils-2.21/ld/testsuite/ld-alpha/tlsbinr.rd new file mode 100644 index 0000000..247957d --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-alpha/tlsbinr.rd @@ -0,0 +1,128 @@ +#source: align.s +#source: tlsbinpic.s +#source: tlsbin.s +#as: +#ld: -relax -melf64alpha +#readelf: -WSsrl +#target: alpha*-*-* + +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]+\] \.interp +.* + +\[[ 0-9]+\] \.hash +.* + +\[[ 0-9]+\] \.dynsym +.* + +\[[ 0-9]+\] \.dynstr +.* + +\[[ 0-9]+\] \.rela\.dyn +.* + +\[[ 0-9]+\] \.rela\.plt +.* + +\[[ 0-9]+\] \.text +PROGBITS +[0-9a-f]+ [0-9a-f]+ [0-9a-f]+ 0+ +AX +0 +0 4096 + +\[[ 0-9]+\] \.eh_frame +PROGBITS +[0-9a-f]+ [0-9a-f]+ [0-9a-f]+ 00 +A +0 +0 +8 + +\[[ 0-9]+\] \.tdata +PROGBITS +[0-9a-f]+ [0-9a-f]+ [0-9a-f]+ 0+ WAT +0 +0 +4 + +\[[ 0-9]+\] \.tbss +NOBITS +[0-9a-f]+ [0-9a-f]+ [0-9a-f]+ 0+ WAT +0 +0 +1 + +\[[ 0-9]+\] \.dynamic +DYNAMIC +[0-9a-f]+ [0-9a-f]+ [0-9a-f]+ 10 +WA +4 +0 +8 + +\[[ 0-9]+\] \.plt +PROGBITS +[0-9a-f]+ [0-9a-f]+ [0-9a-f]+ 0+ WAX +0 +0 +16 + +\[[ 0-9]+\] \.got +PROGBITS +[0-9a-f]+ [0-9a-f]+ [0-9a-f]+ 0+ +WA +0 +0 +8 + +\[[ 0-9]+\] \.shstrtab +.* + +\[[ 0-9]+\] \.symtab +.* + +\[[ 0-9]+\] \.strtab +.* +#... + +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 +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ R E 0x8 + +INTERP +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ R +0x1 +.*Requesting program interpreter.* + +LOAD +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ R E 0x10000 + +LOAD +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ RWE 0x10000 + +DYNAMIC +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ RW +0x8 + +TLS +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ R +0x4 +#... + +Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 2 entries: + +Offset +Info +Type +Symbol's Value +Symbol's Name \+ Addend +[0-9a-f]+ +0+100000026 R_ALPHA_TPREL64 +0+ sG2 \+ 0 +[0-9a-f]+ +0+400000026 R_ALPHA_TPREL64 +0+ sG1 \+ 0 + +Symbol table '\.dynsym' contains [0-9]+ entries: + +Num: +Value +Size +Type +Bind +Vis +Ndx +Name +[0-9 ]+: 0+ +0 +NOTYPE +LOCAL +DEFAULT +UND +[0-9 ]+: 0+ +0 +TLS +GLOBAL +DEFAULT +UND sG2 +[0-9 ]+: 0+ +0 +FUNC +GLOBAL +DEFAULT +UND __tls_get_addr +[0-9 ]+: [0-9a-f]+ +0 +NOTYPE +GLOBAL +DEFAULT +ABS __bss_start +[0-9 ]+: 0+ +0 +TLS +GLOBAL +DEFAULT +UND sG1 +[0-9 ]+: [0-9a-f]+ +0 +NOTYPE +GLOBAL +DEFAULT +ABS _edata +[0-9 ]+: [0-9a-f]+ +0 +NOTYPE +GLOBAL +DEFAULT +ABS _end + +Symbol table '\.symtab' contains [0-9]+ entries: + +Num: +Value +Size +Type +Bind +Vis +Ndx +Name +[0-9 ]+: [0-9a-f]+ +0 +NOTYPE +LOCAL +DEFAULT +UND +[0-9 ]+: [0-9a-f]+ +0 +SECTION +LOCAL +DEFAULT +1 +[0-9 ]+: [0-9a-f]+ +0 +SECTION +LOCAL +DEFAULT +2 +[0-9 ]+: [0-9a-f]+ +0 +SECTION +LOCAL +DEFAULT +3 +[0-9 ]+: [0-9a-f]+ +0 +SECTION +LOCAL +DEFAULT +4 +[0-9 ]+: [0-9a-f]+ +0 +SECTION +LOCAL +DEFAULT +5 +[0-9 ]+: [0-9a-f]+ +0 +SECTION +LOCAL +DEFAULT +6 +[0-9 ]+: [0-9a-f]+ +0 +SECTION +LOCAL +DEFAULT +7 +[0-9 ]+: [0-9a-f]+ +0 +SECTION +LOCAL +DEFAULT +8 +[0-9 ]+: [0-9a-f]+ +0 +SECTION +LOCAL +DEFAULT +9 +[0-9 ]+: [0-9a-f]+ +0 +SECTION +LOCAL +DEFAULT +10 +[0-9 ]+: [0-9a-f]+ +0 +SECTION +LOCAL +DEFAULT +11 +[0-9 ]+: [0-9a-f]+ +0 +SECTION +LOCAL +DEFAULT +12 +[0-9 ]+: [0-9a-f]+ +0 +SECTION +LOCAL +DEFAULT +13 +[0-9 ]+: [0-9a-f]+ +0 +TLS +LOCAL +DEFAULT +9 sl1 +[0-9 ]+: [0-9a-f]+ +0 +TLS +LOCAL +DEFAULT +9 sl2 +[0-9 ]+: [0-9a-f]+ +0 +TLS +LOCAL +DEFAULT +9 sl3 +[0-9 ]+: [0-9a-f]+ +0 +TLS +LOCAL +DEFAULT +9 sl4 +[0-9 ]+: [0-9a-f]+ +0 +TLS +LOCAL +DEFAULT +9 sl5 +[0-9 ]+: [0-9a-f]+ +0 +TLS +LOCAL +DEFAULT +9 sl6 +[0-9 ]+: [0-9a-f]+ +0 +TLS +LOCAL +DEFAULT +9 sl7 +[0-9 ]+: [0-9a-f]+ +0 +TLS +LOCAL +DEFAULT +9 sl8 +[0-9 ]+: [0-9a-f]+ +0 +TLS +LOCAL +DEFAULT +10 bl1 +[0-9 ]+: [0-9a-f]+ +0 +TLS +LOCAL +DEFAULT +10 bl2 +[0-9 ]+: [0-9a-f]+ +0 +TLS +LOCAL +DEFAULT +10 bl3 +[0-9 ]+: [0-9a-f]+ +0 +TLS +LOCAL +DEFAULT +10 bl4 +[0-9 ]+: [0-9a-f]+ +0 +TLS +LOCAL +DEFAULT +10 bl5 +[0-9 ]+: [0-9a-f]+ +0 +TLS +LOCAL +DEFAULT +10 bl6 +[0-9 ]+: [0-9a-f]+ +0 +TLS +LOCAL +DEFAULT +10 bl7 +[0-9 ]+: [0-9a-f]+ +0 +TLS +LOCAL +DEFAULT +10 bl8 +[0-9 ]+: [0-9a-f]+ +0 +OBJECT +LOCAL +DEFAULT +11 _DYNAMIC +[0-9 ]+: [0-9a-f]+ +0 +OBJECT +LOCAL +DEFAULT +12 _PROCEDURE_LINKAGE_TABLE_ +[0-9 ]+: [0-9a-f]+ +0 +OBJECT +LOCAL +DEFAULT +13 _GLOBAL_OFFSET_TABLE_ +[0-9 ]+: [0-9a-f]+ +0 +TLS +GLOBAL +DEFAULT +9 sg8 +[0-9 ]+: [0-9a-f]+ +0 +TLS +GLOBAL +DEFAULT +10 bg8 +[0-9 ]+: [0-9a-f]+ +0 +TLS +GLOBAL +DEFAULT +10 bg6 +[0-9 ]+: [0-9a-f]+ +0 +TLS +GLOBAL +DEFAULT +10 bg3 +[0-9 ]+: [0-9a-f]+ +0 +TLS +GLOBAL +DEFAULT +9 sg3 +[0-9 ]+: [0-9a-f]+ +0 +TLS +GLOBAL +HIDDEN +9 sh3 +[0-9 ]+: [0-9a-f]+ +0 +TLS +GLOBAL +DEFAULT +UND sG2 +[0-9 ]+: [0-9a-f]+ +0 +TLS +GLOBAL +DEFAULT +9 sg4 +[0-9 ]+: [0-9a-f]+ +0 +TLS +GLOBAL +DEFAULT +9 sg5 +[0-9 ]+: [0-9a-f]+ +0 +TLS +GLOBAL +DEFAULT +10 bg5 +[0-9 ]+: [0-9a-f]+ +0 +FUNC +GLOBAL +DEFAULT +UND __tls_get_addr +[0-9 ]+: [0-9a-f]+ +0 +TLS +GLOBAL +HIDDEN +9 sh7 +[0-9 ]+: [0-9a-f]+ +0 +TLS +GLOBAL +HIDDEN +9 sh8 +[0-9 ]+: [0-9a-f]+ +0 +TLS +GLOBAL +DEFAULT +9 sg1 +[0-9 ]+: [0-9a-f]+ +52 +FUNC +GLOBAL +DEFAULT +7 _start +[0-9 ]+: [0-9a-f]+ +0 +TLS +GLOBAL +HIDDEN +9 sh4 +[0-9 ]+: [0-9a-f]+ +0 +TLS +GLOBAL +DEFAULT +10 bg7 +[0-9 ]+: [0-9a-f]+ +0 +TLS +GLOBAL +HIDDEN +9 sh5 +[0-9 ]+: [0-9a-f]+ +0 +NOTYPE +GLOBAL +DEFAULT +ABS __bss_start +[0-9 ]+: [0-9a-f]+ +136 +FUNC +GLOBAL +DEFAULT +\[<other>: 88\] +7 fn2 +[0-9 ]+: [0-9a-f]+ +0 +TLS +GLOBAL +DEFAULT +9 sg2 +[0-9 ]+: [0-9a-f]+ +0 +TLS +GLOBAL +DEFAULT +UND sG1 +[0-9 ]+: [0-9a-f]+ +0 +TLS +GLOBAL +HIDDEN +9 sh1 +[0-9 ]+: [0-9a-f]+ +0 +TLS +GLOBAL +DEFAULT +9 sg6 +[0-9 ]+: [0-9a-f]+ +0 +TLS +GLOBAL +DEFAULT +9 sg7 +[0-9 ]+: [0-9a-f]+ +0 +NOTYPE +GLOBAL +DEFAULT +ABS _edata +[0-9 ]+: [0-9a-f]+ +0 +NOTYPE +GLOBAL +DEFAULT +ABS _end +[0-9 ]+: [0-9a-f]+ +0 +TLS +GLOBAL +HIDDEN +9 sh2 +[0-9 ]+: [0-9a-f]+ +0 +TLS +GLOBAL +HIDDEN +9 sh6 +[0-9 ]+: [0-9a-f]+ +0 +TLS +GLOBAL +DEFAULT +10 bg2 +[0-9 ]+: [0-9a-f]+ +0 +TLS +GLOBAL +DEFAULT +10 bg1 +[0-9 ]+: [0-9a-f]+ +0 +TLS +GLOBAL +DEFAULT +10 bg4 diff --git a/binutils-2.21/ld/testsuite/ld-alpha/tlsbinr.sd b/binutils-2.21/ld/testsuite/ld-alpha/tlsbinr.sd new file mode 100644 index 0000000..59e9449 --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-alpha/tlsbinr.sd @@ -0,0 +1,12 @@ +#source: align.s +#source: tlsbinpic.s +#source: tlsbin.s +#as: +#ld: -relax -melfalpha +#objdump: -sj.got +#target: alpha*-*-* + +.*: +file format elf64-alpha + +Contents of section .got: + [0-9a-f]+ 00000000 00000000 00000000 00000000 .* diff --git a/binutils-2.21/ld/testsuite/ld-alpha/tlsg.s b/binutils-2.21/ld/testsuite/ld-alpha/tlsg.s new file mode 100644 index 0000000..99fb84a --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-alpha/tlsg.s @@ -0,0 +1,14 @@ + .section .tbss,"awT",@nobits + .align 4 + .skip 24 + .type a,@object + .size a,4 +a: + .long 0 + .text + .globl _start + .ent _start +_start: + .end _start + .section .debug_foobar + .quad a !dtprel diff --git a/binutils-2.21/ld/testsuite/ld-alpha/tlsg.sd b/binutils-2.21/ld/testsuite/ld-alpha/tlsg.sd new file mode 100644 index 0000000..c426a99 --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-alpha/tlsg.sd @@ -0,0 +1,10 @@ +#source: tlsg.s +#as: +#ld: -melf64_ia64 +#objdump: -sj.debug_foobar +#target: ia64-*-* + +.*: +file format elf64-ia64-little + +Contents of section .debug_foobar: + 0+ 18000000 0+ +.* diff --git a/binutils-2.21/ld/testsuite/ld-alpha/tlslib.s b/binutils-2.21/ld/testsuite/ld-alpha/tlslib.s new file mode 100644 index 0000000..88cdff2 --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-alpha/tlslib.s @@ -0,0 +1,19 @@ + .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_addr + .ent __tls_get_addr +__tls_get_addr: + .prologue 0 + ret + .end __tls_get_addr diff --git a/binutils-2.21/ld/testsuite/ld-alpha/tlspic.dd b/binutils-2.21/ld/testsuite/ld-alpha/tlspic.dd new file mode 100644 index 0000000..63f150c --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-alpha/tlspic.dd @@ -0,0 +1,56 @@ +#source: align.s +#source: tlspic1.s +#source: tlspic2.s +#as: +#ld: -shared -melf64alpha +#objdump: -drj.text +#target: alpha*-*-* + +.*: +file format elf64-alpha + +Disassembly of section .text: + +0+1000 <fn1>: + 1000: 02 00 bb 27 ldah gp,2\(t12\) + 1004: a0 82 bd 23 lda gp,-32096\(gp\) + 1008: 3e 15 c2 43 subq sp,0x10,sp + 100c: 00 00 5e b7 stq ra,0\(sp\) + 1010: 08 00 3e b5 stq s0,8\(sp\) + 1014: 9e 00 00 00 rduniq + 1018: 09 04 e0 47 mov v0,s0 + 101c: 08 80 1d 22 lda a0,-32760\(gp\) + 1020: 00 80 7d a7 ldq t12,-32768\(gp\) + 1024: 00 40 5b 6b jsr ra,\(t12\),1028 <.*> + 1028: 02 00 ba 27 ldah gp,2\(ra\) + 102c: 78 82 bd 23 lda gp,-32136\(gp\) + 1030: 30 80 1d 22 lda a0,-32720\(gp\) + 1034: 00 80 7d a7 ldq t12,-32768\(gp\) + 1038: 00 40 5b 6b jsr ra,\(t12\),103c <.*> + 103c: 02 00 ba 27 ldah gp,2\(ra\) + 1040: 64 82 bd 23 lda gp,-32156\(gp\) + 1044: 40 80 1d 22 lda a0,-32704\(gp\) + 1048: 00 80 7d a7 ldq t12,-32768\(gp\) + 104c: 00 40 5b 6b jsr ra,\(t12\),1050 <.*> + 1050: 02 00 ba 27 ldah gp,2\(ra\) + 1054: 50 82 bd 23 lda gp,-32176\(gp\) + 1058: 21 00 20 20 lda t0,33\(v0\) + 105c: 40 80 1d 22 lda a0,-32704\(gp\) + 1060: 00 80 7d a7 ldq t12,-32768\(gp\) + 1064: 00 40 5b 6b jsr ra,\(t12\),1068 <.*> + 1068: 02 00 ba 27 ldah gp,2\(ra\) + 106c: 38 82 bd 23 lda gp,-32200\(gp\) + 1070: 40 00 20 20 lda t0,64\(v0\) + 1074: 62 00 20 20 lda t0,98\(v0\) + 1078: 00 00 20 24 ldah t0,0\(v0\) + 107c: 53 00 21 20 lda t0,83\(t0\) + 1080: 18 80 3d a4 ldq t0,-32744\(gp\) + 1084: 01 04 20 40 addq t0,v0,t0 + 1088: 20 80 3d a4 ldq t0,-32736\(gp\) + 108c: 01 04 29 40 addq t0,s0,t0 + 1090: 50 80 3d a4 ldq t0,-32688\(gp\) + 1094: 28 80 5d a4 ldq t1,-32728\(gp\) + 1098: 01 04 29 40 addq t0,s0,t0 + 109c: 02 04 49 40 addq t1,s0,t1 + 10a0: 00 00 5e a7 ldq ra,0\(sp\) + 10a4: 1e 14 c2 43 addq sp,0x10,sp + 10a8: 01 80 fa 6b ret diff --git a/binutils-2.21/ld/testsuite/ld-alpha/tlspic.rd b/binutils-2.21/ld/testsuite/ld-alpha/tlspic.rd new file mode 100644 index 0000000..ac6a38a --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-alpha/tlspic.rd @@ -0,0 +1,128 @@ +#source: align.s +#source: tlspic1.s +#source: tlspic2.s +#as: +#ld: -shared -melf64alpha +#readelf: -WSsrl +#target: alpha*-*-* + +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]+\] .text +PROGBITS +0+1000 0+1000 0+ac 0+ +AX +0 +0 4096 + +\[[ 0-9]+\] .eh_frame +PROGBITS +[0-9a-f]+ [0-9a-f]+ [0-9a-f]+ 00 +A +0 +0 +8 + +\[[ 0-9]+\] .tdata +PROGBITS +[0-9a-f]+ [0-9a-f]+ [0-9a-f]+ 0+ WAT +0 +0 +4 + +\[[ 0-9]+\] .tbss +NOBITS +[0-9a-f]+ [0-9a-f]+ [0-9a-f]+ 0+ WAT +0 +0 +1 + +\[[ 0-9]+\] .dynamic +DYNAMIC +[0-9a-f]+ [0-9a-f]+ [0-9a-f]+ 10 +WA +3 +0 +8 + +\[[ 0-9]+\] .plt +.* + +\[[ 0-9]+\] .got +PROGBITS +[0-9a-f]+ [0-9a-f]+ [0-9a-f]+ 0+ +WA +0 +0 +8 + +\[[ 0-9]+\] .shstrtab +.* + +\[[ 0-9]+\] .symtab +.* + +\[[ 0-9]+\] .strtab +.* +#... + +Elf file type is DYN \(Shared object file\) +Entry point 0x1000 +There are [0-9]+ program headers, starting at offset [0-9]+ + +Program Headers: + +Type +Offset +VirtAddr +PhysAddr +FileSiz +MemSiz +Flg Align + +LOAD +0x0+ 0x0+ 0x0+ 0x[0-9a-f]+ 0x[0-9a-f]+ R E 0x10000 + +LOAD +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ RWE 0x10000 + +DYNAMIC +0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ 0x[0-9a-f]+ RW +0x8 + +TLS +0x0+10e0 0x0+110e0 0x0+110e0 0x0+60 0x0+80 R +0x4 +#... + +Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 7 entries: + +Offset +Info +Type +Symbol's Value +Symbol's Name \+ Addend +[0-9a-f]+ +[0-9a-f]+ R_ALPHA_DTPMOD64 +0+ sg1 \+ 0 +[0-9a-f]+ +[0-9a-f]+ R_ALPHA_DTPREL64 +0+ sg1 \+ 0 +[0-9a-f]+ +[0-9a-f]+ R_ALPHA_TPREL64 +0+4 sg2 \+ 0 +[0-9a-f]+ +[0-9a-f]+ R_ALPHA_TPREL64 +0+44 +[0-9a-f]+ +[0-9a-f]+ R_ALPHA_DTPMOD64 +0+ +[0-9a-f]+ +[0-9a-f]+ R_ALPHA_DTPMOD64 +0+ +[0-9a-f]+ +[0-9a-f]+ R_ALPHA_TPREL64 +0+24 + +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]+ +[0-9a-f]+ R_ALPHA_JMP_SLOT +0+ __tls_get_addr \+ 0 + +Symbol table '\.dynsym' contains [0-9]+ entries: + +Num: +Value +Size +Type +Bind +Vis +Ndx +Name +.* [0-9a-f]+ +0 +NOTYPE +LOCAL +DEFAULT +UND +.* [0-9a-f]+ +0 +TLS +GLOBAL +DEFAULT +8 sg8 +.* [0-9a-f]+ +0 +TLS +GLOBAL +DEFAULT +8 sg3 +.* [0-9a-f]+ +0 +TLS +GLOBAL +DEFAULT +8 sg4 +.* [0-9a-f]+ +0 +TLS +GLOBAL +DEFAULT +8 sg5 +.* [0-9a-f]+ +0 +NOTYPE +GLOBAL +DEFAULT +UND __tls_get_addr +.* [0-9a-f]+ +0 +TLS +GLOBAL +DEFAULT +8 sg1 +.* [0-9a-f]+ +172 +FUNC +GLOBAL +DEFAULT +\[<other>: 88\] +6 fn1 +.* [0-9a-f]+ +0 +NOTYPE +GLOBAL +DEFAULT +ABS __bss_start +.* [0-9a-f]+ +0 +TLS +GLOBAL +DEFAULT +8 sg2 +.* [0-9a-f]+ +0 +TLS +GLOBAL +DEFAULT +8 sg6 +.* [0-9a-f]+ +0 +TLS +GLOBAL +DEFAULT +8 sg7 +.* [0-9a-f]+ +0 +NOTYPE +GLOBAL +DEFAULT +ABS _edata +.* [0-9a-f]+ +0 +NOTYPE +GLOBAL +DEFAULT +ABS _end + +Symbol table '\.symtab' contains [0-9]+ entries: + +Num: +Value +Size +Type +Bind +Vis +Ndx +Name +.* [0-9a-f]+ +0 +NOTYPE +LOCAL +DEFAULT +UND +.* [0-9a-f]+ +0 +SECTION +LOCAL +DEFAULT +1 +.* [0-9a-f]+ +0 +SECTION +LOCAL +DEFAULT +2 +.* [0-9a-f]+ +0 +SECTION +LOCAL +DEFAULT +3 +.* [0-9a-f]+ +0 +SECTION +LOCAL +DEFAULT +4 +.* [0-9a-f]+ +0 +SECTION +LOCAL +DEFAULT +5 +.* [0-9a-f]+ +0 +SECTION +LOCAL +DEFAULT +6 +.* [0-9a-f]+ +0 +SECTION +LOCAL +DEFAULT +7 +.* [0-9a-f]+ +0 +SECTION +LOCAL +DEFAULT +8 +.* [0-9a-f]+ +0 +SECTION +LOCAL +DEFAULT +9 +.* [0-9a-f]+ +0 +SECTION +LOCAL +DEFAULT +10 +.* [0-9a-f]+ +0 +SECTION +LOCAL +DEFAULT +11 +.* [0-9a-f]+ +0 +SECTION +LOCAL +DEFAULT +12 +.* [0-9a-f]+ +0 +TLS +LOCAL +DEFAULT +8 sl1 +.* [0-9a-f]+ +0 +TLS +LOCAL +DEFAULT +8 sl2 +.* [0-9a-f]+ +0 +TLS +LOCAL +DEFAULT +8 sl3 +.* [0-9a-f]+ +0 +TLS +LOCAL +DEFAULT +8 sl4 +.* [0-9a-f]+ +0 +TLS +LOCAL +DEFAULT +8 sl5 +.* [0-9a-f]+ +0 +TLS +LOCAL +DEFAULT +8 sl6 +.* [0-9a-f]+ +0 +TLS +LOCAL +DEFAULT +8 sl7 +.* [0-9a-f]+ +0 +TLS +LOCAL +DEFAULT +8 sl8 +.* [0-9a-f]+ +0 +TLS +LOCAL +DEFAULT +9 sH1 +.* [0-9a-f]+ +0 +OBJECT +LOCAL +DEFAULT +ABS _DYNAMIC +.* [0-9a-f]+ +0 +TLS +LOCAL +DEFAULT +8 sh3 +.* [0-9a-f]+ +0 +TLS +LOCAL +DEFAULT +9 sH2 +.* [0-9a-f]+ +0 +TLS +LOCAL +DEFAULT +9 sH7 +.* [0-9a-f]+ +0 +OBJECT +LOCAL +DEFAULT +ABS _PROCEDURE_LINKAGE_TABLE_ +.* [0-9a-f]+ +0 +TLS +LOCAL +DEFAULT +8 sh7 +.* [0-9a-f]+ +0 +TLS +LOCAL +DEFAULT +8 sh8 +.* [0-9a-f]+ +0 +TLS +LOCAL +DEFAULT +9 sH4 +.* [0-9a-f]+ +0 +TLS +LOCAL +DEFAULT +8 sh4 +.* [0-9a-f]+ +0 +TLS +LOCAL +DEFAULT +9 sH3 +.* [0-9a-f]+ +0 +TLS +LOCAL +DEFAULT +8 sh5 +.* [0-9a-f]+ +0 +TLS +LOCAL +DEFAULT +9 sH5 +.* [0-9a-f]+ +0 +TLS +LOCAL +DEFAULT +9 sH6 +.* [0-9a-f]+ +0 +TLS +LOCAL +DEFAULT +9 sH8 +.* [0-9a-f]+ +0 +TLS +LOCAL +DEFAULT +8 sh1 +.* [0-9a-f]+ +0 +OBJECT +LOCAL +DEFAULT +ABS _GLOBAL_OFFSET_TABLE_ +.* [0-9a-f]+ +0 +TLS +LOCAL +DEFAULT +8 sh2 +.* [0-9a-f]+ +0 +TLS +LOCAL +DEFAULT +8 sh6 +.* [0-9a-f]+ +0 +TLS +GLOBAL +DEFAULT +8 sg8 +.* [0-9a-f]+ +0 +TLS +GLOBAL +DEFAULT +8 sg3 +.* [0-9a-f]+ +0 +TLS +GLOBAL +DEFAULT +8 sg4 +.* [0-9a-f]+ +0 +TLS +GLOBAL +DEFAULT +8 sg5 +.* [0-9a-f]+ +0 +NOTYPE +GLOBAL +DEFAULT +UND __tls_get_addr +.* [0-9a-f]+ +0 +TLS +GLOBAL +DEFAULT +8 sg1 +.* [0-9a-f]+ +172 +FUNC +GLOBAL +DEFAULT +\[<other>: 88\] +6 fn1 +.* [0-9a-f]+ +0 +NOTYPE +GLOBAL +DEFAULT +ABS __bss_start +.* [0-9a-f]+ +0 +TLS +GLOBAL +DEFAULT +8 sg2 +.* [0-9a-f]+ +0 +TLS +GLOBAL +DEFAULT +8 sg6 +.* [0-9a-f]+ +0 +TLS +GLOBAL +DEFAULT +8 sg7 +.* [0-9a-f]+ +0 +NOTYPE +GLOBAL +DEFAULT +ABS _edata +.* [0-9a-f]+ +0 +NOTYPE +GLOBAL +DEFAULT +ABS _end diff --git a/binutils-2.21/ld/testsuite/ld-alpha/tlspic.sd b/binutils-2.21/ld/testsuite/ld-alpha/tlspic.sd new file mode 100644 index 0000000..772cbaf --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-alpha/tlspic.sd @@ -0,0 +1,17 @@ +#source: align.s +#source: tlspic1.s +#source: tlspic2.s +#as: +#ld: -shared -melf64alpha +#objdump: -sj.got +#target: alpha*-*-* + +.*: +file format elf64-alpha + +Contents of section .got: + 112a0 90120100 00000000 00000000 00000000 .* + 112b0 00000000 00000000 71000000 00000000 .* + 112c0 00000000 00000000 00000000 00000000 .* + 112d0 00000000 00000000 44000000 00000000 .* + 112e0 00000000 00000000 00000000 00000000 .* + 112f0 00000000 00000000 .* diff --git a/binutils-2.21/ld/testsuite/ld-alpha/tlspic.td b/binutils-2.21/ld/testsuite/ld-alpha/tlspic.td new file mode 100644 index 0000000..cd09609 --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-alpha/tlspic.td @@ -0,0 +1,17 @@ +#source: align.s +#source: tlspic1.s +#source: tlspic2.s +#as: +#ld: -shared -melf64alpha +#objdump: -sj.tdata +#target: alpha*-*-* + +.*: +file format elf64-alpha + +Contents of section .tdata: + 110e0 11000000 12000000 13000000 14000000 .* + 110f0 15000000 16000000 17000000 18000000 .* + 11100 41000000 42000000 43000000 44000000 .* + 11110 45000000 46000000 47000000 48000000 .* + 11120 01010000 02010000 03010000 04010000 .* + 11130 05010000 06010000 07010000 08010000 .* diff --git a/binutils-2.21/ld/testsuite/ld-alpha/tlspic1.s b/binutils-2.21/ld/testsuite/ld-alpha/tlspic1.s new file mode 100644 index 0000000..822f36d --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-alpha/tlspic1.s @@ -0,0 +1,87 @@ + .section ".tdata", "awT", @progbits + .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 + .ent fn1 +fn1: + .frame $sp, 16, $26, 0 + ldgp $gp, 0($27) + subq $sp, 16, $sp + stq $26, 0($sp) + stq $9, 8($sp) + .prologue 1 + + rduniq + mov $0, $9 + + /* GD */ + lda $16, sg1($gp) !tlsgd!1 + ldq $27, __tls_get_addr($gp) !literal!1 + jsr $26, ($27), __tls_get_addr !lituse_tlsgd!1 + ldgp $gp, 0($26) + + /* GD against hidden symbol */ + lda $16, sh2($gp) !tlsgd!2 + ldq $27, __tls_get_addr($gp) !literal!2 + jsr $26, ($27), __tls_get_addr !lituse_tlsgd!2 + ldgp $gp, 0($26) + + /* LD */ + lda $16, sl1($gp) !tlsldm!3 + ldq $27, __tls_get_addr($gp) !literal!3 + jsr $26, ($27), __tls_get_addr !lituse_tlsldm!3 + ldgp $gp, 0($26) + lda $1, sl1+1($0) !dtprel + + /* LD with 4 variables */ + lda $16, sh1($gp) !tlsldm!4 + ldq $27, __tls_get_addr($gp) !literal!4 + jsr $26, ($27), __tls_get_addr !lituse_tlsldm!4 + ldgp $gp, 0($26) + lda $1, sh1($0) !dtprel + lda $1, sH1+2($0) !dtprel + ldah $1, sh5+3($0) !dtprelhi + lda $1, sh5+3($1) !dtprello + ldq $1, sH5+1($gp) !gotdtprel + addq $1, $0, $1 + + /* IE against global */ + ldq $1, sg2($gp) !gottprel + addq $1, $9, $1 + + /* IE against local and hidden */ + ldq $1, sl2($gp) !gottprel + ldq $2, sh2($gp) !gottprel + addq $1, $9, $1 + addq $2, $9, $2 + + ldq $26, 0($sp) + addq $sp, 16, $sp + ret + .end fn1 diff --git a/binutils-2.21/ld/testsuite/ld-alpha/tlspic2.s b/binutils-2.21/ld/testsuite/ld-alpha/tlspic2.s new file mode 100644 index 0000000..5513f9b --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-alpha/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 |