diff options
author | Roland McGrath <roland@gnu.org> | 2012-04-03 16:01:22 +0000 |
---|---|---|
committer | Roland McGrath <roland@gnu.org> | 2012-04-03 16:01:22 +0000 |
commit | de662f7c24d628b652704a6fbad26c9e3e7e23e5 (patch) | |
tree | 5e21797e94d1f965fc0130e5f64e5c0188ee4001 /ld/testsuite/ld-x86-64 | |
parent | 33af8d33f9aa35ce8874c4c52fd1d8033b56f9f7 (diff) | |
download | binutils-redhat-de662f7c24d628b652704a6fbad26c9e3e7e23e5.tar.gz |
bfd/
2012-04-03 Roland McGrath <mcgrathr@google.com>
* elf-nacl.c: New file.
* elf-nacl.h: New file.
* elf32-i386.c (elf_backend_modify_segment_map): Define for
bfd_elf32_i386_nacl_vec.
(elf_backend_modify_program_headers): Likewise.
* elf64-x86-64.c (elf_backend_modify_segment_map): Define for
bfd_elf64_x86_64_nacl_vec and bfd_elf32_x86_64_nacl_vec.
(elf_backend_modify_program_headers): Likewise.
* Makefile.am (BFD32_BACKENDS, BFD64_BACKENDS): Add elf-nacl.lo here.
(BFD32_BACKENDS_CFILES, BFD64_BACKENDS_CFILES): Add elf-nacl.c here.
* Makefile.in: Regenerated.
* configure.in (bfd_elf64_x86_64_nacl_vec): Add elf-nacl.o to tb here.
(bfd_elf32_x86_64_nacl_vec): Likewise.
(bfd_elf64_x86_64_vec, bfd_elf32_x86_64_vec): Likewise.
(bfd_elf64_x86_64_freebsd_vec, bfd_elf64_x86_64_sol2_vec): Likewise.
(bfd_elf64_l1om_vec, bfd_elf64_l1om_freebsd_vec): Likewise.
(bfd_elf64_k1om_vec, bfd_elf64_k1om_freebsd_vec): Likewise.
(bfd_elf32_i386_nacl_vec): Likewise.
(bfd_elf32_i386_sol2_vec, bfd_elf32_i386_freebsd_vec): Likewise.
(bfd_elf32_i386_vxworks_vec, bfd_elf32_i386_vec): Likewise.
* configure: Regenerated.
binutils/testsuite/
2012-04-03 Roland McGrath <mcgrathr@google.com>
* lib/binutils-common.exp (is_elf_format): Consider *-*-nacl* to
be ELF too.
* binutils-all/elfedit-4.d: Add "#as: --64" option.
* binutils-all/i386/i386.exp: Accept nacl targets too.
* binutils-all/x86-64/x86-64.exp: Likewise.
gas/testsuite/
2012-04-03 Roland McGrath <mcgrathr@google.com>
* gas/i386/k1om.d: Add not-target match for *-*-nacl*.
* gas/i386/l1om.d: Likewise.
ld/
2012-04-03 Roland McGrath <mcgrathr@google.com>
* configure.tgt (i[3-7]86-*-nacl*, x86_64-*-nacl*): Handle them.
* emulparams/elf_nacl.sh: New file.
* emulparams/elf_i386_nacl.sh: New file.
* emulparams/elf32_x86_64_nacl.sh: New file.
* emulparams/elf_x86_64_nacl.sh: New file.
* Makefile.am (ALL_EMULATION_SOURCES): Add eelf_i386_nacl.c here.
(ALL_64_EMULATION_SOURCES): Add eelf32_x86_64_nacl.c and
eelf_x86_64_nacl.c here.
(eelf_i386_nacl.c, eelf32_x86_64_nacl.c, eelf_x86_64_nacl.c):
New targets.
* Makefile.in: Regenerated.
* scripttempl/elf.sc: Handle SEPARATE_CODE cases.
ld/testsuite/
2012-04-03 Roland McGrath <mcgrathr@google.com>
* ld-x86-64/ilp32-4-nacl.d: New file.
* ld-x86-64/x86-64.exp: Run it.
* ld-discard/discard.exp: Accept nacl targets too.
* ld-elf/binutils.exp: Likewise.
* ld-elf/comm-data.exp: Likewise.
* ld-elf/elf.exp: Likewise.
* ld-elf/tls_common.exp: Likewise.
* ld-elfvers/vers.exp: Likewise.
* ld-elfvsb/elfvsb.exp: Likewise.
* ld-elfweak/elfweak.exp: Likewise.
* ld-gc/gc.exp: Likewise.
* ld-ifunc/binutils.exp: Likewise.
* ld-ifunc/ifunc.exp: Likewise.
* ld-linkonce/linkonce.exp:Likewise.
* ld-pie/pie.exp: Likewise.
* ld-shared/shared.exp: Likewise.
* ld-undefined/weak-undef.exp: Likewise.
* ld-unique/unique.exp: Likewise.
* ld-x86-64/dwarfreloc.exp: Likewise.
* ld-x86-64/line.exp: Likewise.
* lib/ld-lib.exp (slurp_options): Support global array
options_regsub to apply substitutions to the contents
of options lines read from the file.
* ld-i386/emit-relocs.d: Renamed to ...
* ld-i386/emit-relocs.rd: ... this.
* ld-i386/i386.exp: Accept nacl targets too.
For them, use options_regsub to replace elf_i386 with
elf_i386_nacl in run_dump_test cases; apply the same
substitution in $i386tests; replace foo.rd expectations
files with foo-nacl.rd in $i386tests.
(i386tests): Change emit-relocs.d to emit-relocs.rd here.
* ld-i386/emit-relocs-nacl.rd: New file.
* ld-i386/plt-nacl.pd: New file.
* ld-i386/plt-pic-nacl.pd: New file.
* ld-i386/tlsbin-nacl.rd: New file.
* ld-i386/tlsbindesc-nacl.rd: New file.
* ld-i386/tlsdesc-nacl.rd: New file.
* ld-i386/tlsgdesc-nacl.rd: New file.
* ld-i386/tlsnopic-nacl.rd: New file.
* ld-i386/tlspic-nacl.rd: New file.
* ld-x86-64/x86-64.exp: Accept nacl targets too.
For them, use options_regsub to replace elf_x86_64 with
elf_x86_64_nacl in run_dump_test cases; apply the same
substitution in $x86_64tests; replace foo.rd expectations
files with foo-nacl.rd in $x86_64tests.
Add explicit -melf_x86_64 to ld options in tests that need it,
in case the default emulation is x32 (as it is for x86_64-nacl).
* ld/testsuite/ld-x86-64/plt-nacl.pd: New file.
* ld/testsuite/ld-x86-64/split-by-file-nacl.rd: New file.
* ld/testsuite/ld-x86-64/tlsbin-nacl.rd: New file.
* ld/testsuite/ld-x86-64/tlsbindesc-nacl.rd: New file.
* ld/testsuite/ld-x86-64/tlsdesc-nacl.pd: New file.
* ld/testsuite/ld-x86-64/tlsdesc-nacl.rd: New file.
* ld/testsuite/ld-x86-64/tlsgdesc-nacl.rd: New file.
* ld/testsuite/ld-x86-64/tlspic-nacl.rd: New file.
* ld-i386/hidden2.d: Loosen regexps to match any file format variant,
and not to depend on exact addresses, displacements, etc. where
they are irrelevant.
* ld-i386/pcrel16.d: Likewise.
* ld-i386/pcrel16abs.d: Likewise.
* ld-i386/pr12718.d: Likewise.
* ld-i386/pr12921.d: Likewise.
* ld-i386/reloc.d: Likewise.
* ld-i386/tlsbin.dd: Likewise.
* ld-i386/tlsbin.sd: Likewise.
* ld-i386/tlsbin.td: Likewise.
* ld-i386/tlsbindesc.dd: Likewise.
* ld-i386/tlsbindesc.sd: Likewise.
* ld-i386/tlsbindesc.td: Likewise.
* ld-i386/tlsdesc.dd: Likewise.
* ld-i386/tlsdesc.sd: Likewise.
* ld-i386/tlsdesc.td: Likewise.
* ld-i386/tlsg.sd: Likewise.
* ld-i386/tlsgdesc.dd: Likewise.
* ld-i386/tlsindntpoff.dd: Likewise.
* ld-i386/tlsnopic.dd: Likewise.
* ld-i386/tlsnopic.sd: Likewise.
* ld-i386/tlspic.dd: Likewise.
* ld-i386/tlspic.sd: Likewise.
* ld-i386/tlspic.td: Likewise.
* ld-i386/tlspie2.d: Likewise.
* ld-x86-64/hidden2.d: Likewise.
* ld-x86-64/pcrel16.d: Likewise.
* ld-x86-64/pr12718.d: Likewise.
* ld-x86-64/pr12921.d: Likewise.
* ld-x86-64/protected3.d: Likewise.
* ld-x86-64/tlsbin.dd: Likewise.
* ld-x86-64/tlsbin.sd: Likewise.
* ld-x86-64/tlsbin.td: Likewise.
* ld-x86-64/tlsbindesc.dd: Likewise.
* ld-x86-64/tlsbindesc.sd: Likewise.
* ld-x86-64/tlsbindesc.td: Likewise.
* ld-x86-64/tlsdesc.dd: Likewise.
* ld-x86-64/tlsdesc.sd: Likewise.
* ld-x86-64/tlsdesc.td: Likewise.
* ld-x86-64/tlsg.sd: Likewise.
* ld-x86-64/tlsgd5.dd: Likewise.
* ld-x86-64/tlsgd6.dd: Likewise.
* ld-x86-64/tlsgdesc.dd: Likewise.
* ld-x86-64/tlspic.dd: Likewise.
* ld-x86-64/tlspic.sd: Likewise.
* ld-x86-64/tlspic.td: Likewise.
* ld-x86-64/ilp32-8.d: Match any file format variant.
Use a -Ttext and adjust expected results, to handle variant layouts.
* ld-x86-64/ilp32-9.d: Likewise.
* ld-i386/alloc.t: Remove superfluous OUTPUT_FORMAT statement.
* ld-i386/pr12627.t: Likewise.
* ld-x86-64/abs-l1om.d: Add target: constraint.
* ld-x86-64/protected2-l1om.d: Likewise.
* ld-x86-64/protected3-l1om.d: Likewise.
* ld-x86-64/ilp32-4.d: Likewise.
* ld-x86-64/plt.s: New file.
* ld-x86-64/pltlib.s: New file.
* ld-x86-64/plt.pd: New file.
* ld-x86-64/x86-64.exp (x86_64tests): Add them.
* ld-i386/plt.s: New file.
* ld-i386/pltlib.s: New file.
* ld-i386/plt.pd: New file.
* ld-i386/plt-pic.s: New file.
* ld-i386/plt-pic.pd: New file.
* ld-i386/i386.exp (i386tests): Add them.
Diffstat (limited to 'ld/testsuite/ld-x86-64')
43 files changed, 1577 insertions, 635 deletions
diff --git a/ld/testsuite/ld-x86-64/abs-l1om.d b/ld/testsuite/ld-x86-64/abs-l1om.d index 1b2231c6f8..1fb96d44b7 100644 --- a/ld/testsuite/ld-x86-64/abs-l1om.d +++ b/ld/testsuite/ld-x86-64/abs-l1om.d @@ -4,6 +4,7 @@ #as: --64 -march=l1om #ld: -m elf_l1om #objdump: -rs -j .text +#target: x86_64-*-linux* .*: file format .* diff --git a/ld/testsuite/ld-x86-64/dwarfreloc.exp b/ld/testsuite/ld-x86-64/dwarfreloc.exp index 8137a3d746..9de192e2af 100644 --- a/ld/testsuite/ld-x86-64/dwarfreloc.exp +++ b/ld/testsuite/ld-x86-64/dwarfreloc.exp @@ -1,5 +1,5 @@ # Expect script for DWARF relocation test. -# Copyright 2008 Free Software Foundation, Inc. +# Copyright 2008, 2012 Free Software Foundation, Inc. # # This file is part of the GNU Binutils. # @@ -27,14 +27,15 @@ # `ld -r'. # # <1><57>: Abbrev Number: 2 (DW_TAG_variable) -# <58> DW_AT_name : i2 +# <58> DW_AT_name : i2 # ... -# <5d> DW_AT_type : <0x32> +# <5d> DW_AT_type : <0x32> # vs. -# <5d> DW_AT_type : <0x0> +# <5d> DW_AT_type : <0x0> # Only the testcase .s files are arch-dependent, the relocations are cross-arch. if { !([istarget "x86_64-*-elf*"] + || [istarget "x86_64-*-nacl*"] || [istarget "x86_64-*-linux*"]) } { return } diff --git a/ld/testsuite/ld-x86-64/hidden2.d b/ld/testsuite/ld-x86-64/hidden2.d index 9a29f9a649..d51c2fb066 100644 --- a/ld/testsuite/ld-x86-64/hidden2.d +++ b/ld/testsuite/ld-x86-64/hidden2.d @@ -8,6 +8,6 @@ Disassembly of section .text: [a-f0-9]+ <bar>: -[ ]*[a-f0-9]+: e8 33 fe ff ff callq 0 .* -[ ]*[a-f0-9]+: c3 retq +[ ]*[a-f0-9]+: e8 ([0-9a-f]{2} ){4} * callq 0 .* +[ ]*[a-f0-9]+: c3 retq * #pass diff --git a/ld/testsuite/ld-x86-64/ilp32-4-nacl.d b/ld/testsuite/ld-x86-64/ilp32-4-nacl.d new file mode 100644 index 0000000000..4de7e6651a --- /dev/null +++ b/ld/testsuite/ld-x86-64/ilp32-4-nacl.d @@ -0,0 +1,32 @@ +#source: ilp32-4.s +#as: --x32 +#ld: -m elf32_x86_64_nacl -shared --no-ld-generated-unwind-info +#readelf: -d -S --wide +#target: x86_64-*-nacl* + +There are 9 section headers, starting at offset 0x[0-9a-f]+: + +Section Headers: + +\[Nr\] Name +Type +Addr +Off +Size +ES +Flg +Lk +Inf +Al + +\[ 0\] +NULL +0+ 0+ 0+ 00 +0 +0 +0 + +\[ 1\] \.text +PROGBITS +0+ 0+10000 +0+1 +00 +AX +0 +0 +4 + +\[ 2\] \.hash +HASH +100000b4 +0+b4 +0+2c +04 +A +3 +0 +4 + +\[ 3\] \.dynsym +DYNSYM +100000e0 +0+e0 +0+60 +10 +A +4 +2 +4 + +\[ 4\] \.dynstr +STRTAB +10000140 +0+140 +0+19 +00 +A +0 +0 +1 + +\[ 5\] \.dynamic +DYNAMIC +1001015c +0+15c +0+58 +08 +WA +4 +0 +4 + +\[ 6\] \.shstrtab +STRTAB +0+ +0+10001 +0+40 +00 +0 +0 +1 + +\[ 7\] \.symtab +SYMTAB +0+0 +0+101ac +0+c0 +10 +8 +8 +4 + +\[ 8\] \.strtab +STRTAB +0+ 0+1026c 0+3f +00 +0 +0 +1 +Key to Flags: + W \(write\), A \(alloc\), X \(execute\), M \(merge\), S \(strings\), l \(large\) + I \(info\), L \(link order\), G \(group\), T \(TLS\), E \(exclude\), x \(unknown\) + O \(extra OS processing required\) o \(OS specific\), p \(processor specific\) + +Dynamic section at offset 0x15c contains 6 entries: + Tag Type Name/Value + 0x00000004 \(HASH\) 0x100000b4 + 0x00000005 \(STRTAB\) 0x10000140 + 0x00000006 \(SYMTAB\) 0x100000e0 + 0x0000000a \(STRSZ\) 25 \(bytes\) + 0x0000000b \(SYMENT\) 16 \(bytes\) + 0x00000000 \(NULL\) 0x0 diff --git a/ld/testsuite/ld-x86-64/ilp32-4.d b/ld/testsuite/ld-x86-64/ilp32-4.d index 92d8a67e7b..8c2d22cfa0 100644 --- a/ld/testsuite/ld-x86-64/ilp32-4.d +++ b/ld/testsuite/ld-x86-64/ilp32-4.d @@ -1,6 +1,7 @@ #as: --x32 #ld: -m elf32_x86_64 -shared --no-ld-generated-unwind-info #readelf: -d -S --wide +#target: x86_64-*-linux* There are 9 section headers, starting at offset 0x1d8: diff --git a/ld/testsuite/ld-x86-64/ilp32-8.d b/ld/testsuite/ld-x86-64/ilp32-8.d index 2fe2c6077a..500d1e5a0e 100644 --- a/ld/testsuite/ld-x86-64/ilp32-8.d +++ b/ld/testsuite/ld-x86-64/ilp32-8.d @@ -1,13 +1,13 @@ #as: --x32 -#ld: -m elf32_x86_64 -Ttext-segment 0xe0000000 +#ld: -m elf32_x86_64 -Ttext-segment 0xe0000000 -Ttext 0xe0010000 #objdump: -dw -.*: +file format elf32-x86-64 +.*: +file format elf32-x86-64.* Disassembly of section .text: -e0000054 <_start>: -[ ]*[a-f0-9]+: 48 b8 54 00 00 e0 00 00 00 00 movabs \$0xe0000054,%rax -[ ]*[a-f0-9]+: 48 a1 54 00 00 e0 00 00 00 00 movabs 0xe0000054,%rax +e0010000 <_start>: +[ ]*[a-f0-9]+: 48 b8 00 00 01 e0 00 00 00 00 movabs \$0xe0010000,%rax +[ ]*[a-f0-9]+: 48 a1 00 00 01 e0 00 00 00 00 movabs 0xe0010000,%rax #pass diff --git a/ld/testsuite/ld-x86-64/ilp32-9.d b/ld/testsuite/ld-x86-64/ilp32-9.d index 8fced17c5a..e73d53db3c 100644 --- a/ld/testsuite/ld-x86-64/ilp32-9.d +++ b/ld/testsuite/ld-x86-64/ilp32-9.d @@ -1,9 +1,9 @@ #as: --x32 -#ld: -m elf32_x86_64 -Ttext-segment 0xe0000000 +#ld: -m elf32_x86_64 -Ttext-segment 0xe0000000 -Ttext 0xe0010000 #objdump: -s -j .text .*: +file format .* Contents of section .text: - e0000054 540000e0 00000000 T....... + e0010000 000001e0 00000000 ........ #pass diff --git a/ld/testsuite/ld-x86-64/line.exp b/ld/testsuite/ld-x86-64/line.exp index c68daaa671..3ddaf1782d 100644 --- a/ld/testsuite/ld-x86-64/line.exp +++ b/ld/testsuite/ld-x86-64/line.exp @@ -1,6 +1,6 @@ # Test that the linker reports undefined symbol line number correctly. # -# Copyright 2007 Free Software Foundation, Inc. +# Copyright 2007, 2012 Free Software Foundation, Inc. # # This file is part of the GNU Binutils. # @@ -20,10 +20,17 @@ # MA 02110-1301, USA. if { !([istarget "x86_64-*-elf*"] + || [istarget "x86_64-*-nacl*"] || [istarget "x86_64-*-linux*"]) } { return } +if [istarget "*-*-nacl*"] { + set emul "elf_x86_64_nacl" +} else { + set emul "elf_x86_64" +} + set testline "undefined line" if ![ld_assemble $as "--64 $srcdir/$subdir/undefined.s" tmpdir/undefined.o] { @@ -36,8 +43,8 @@ remote_file host delete "tmpdir/undefined" # Using -e start prevents the SunOS linker from trying to build a # shared library. -send_log "$ld -e start -melf_x86_64 -o tmpdir/undefined tmpdir/undefined.o\n" -set exec_output [run_host_cmd "$ld" "-e start -melf_x86_64 -o tmpdir/undefined tmpdir/undefined.o"] +send_log "$ld -e start -m$emul -o tmpdir/undefined tmpdir/undefined.o\n" +set exec_output [run_host_cmd "$ld" "-e start -m$emul -o tmpdir/undefined tmpdir/undefined.o"] send_log "$exec_output\n" verbose "$exec_output" diff --git a/ld/testsuite/ld-x86-64/pcrel16.d b/ld/testsuite/ld-x86-64/pcrel16.d index 5bbbb3ee16..b9dff1f99b 100644 --- a/ld/testsuite/ld-x86-64/pcrel16.d +++ b/ld/testsuite/ld-x86-64/pcrel16.d @@ -3,7 +3,7 @@ #ld: -Ttext 0x0 #objdump: -drj.text -m i8086 -.*: +file format elf.*-x86-64 +.*: +file format elf.*-x86-64.* Disassembly of section .text: diff --git a/ld/testsuite/ld-x86-64/plt-nacl.pd b/ld/testsuite/ld-x86-64/plt-nacl.pd new file mode 100644 index 0000000000..9a6c6b3525 --- /dev/null +++ b/ld/testsuite/ld-x86-64/plt-nacl.pd @@ -0,0 +1,54 @@ +#source: plt.s +#as: --64 +#ld: -melf_x86_64_nacl +#objdump: -drj.plt +#target: x86_64-*-nacl* + +.*: +file format .* + +Disassembly of section .plt: + +[0-9a-f]+ <fn1@plt-0x40>: + +[0-9a-f]+: ff 35 ([0-9a-f]{2} ){4} * pushq 0x[0-9a-f]+\(%rip\) +# [0-9a-f]+ <_GLOBAL_OFFSET_TABLE_\+0x8> + +[0-9a-f]+: 4c 8b 1d ([0-9a-f]{2} ){4} * mov 0x[0-9a-f]+\(%rip\),%r11 +# [0-9a-f]+ <_GLOBAL_OFFSET_TABLE_\+0x10> + +[0-9a-f]+: 41 83 e3 e0 and \$0xffffffe0,%r11d + +[0-9a-f]+: 4d 01 fb add %r15,%r11 + +[0-9a-f]+: 41 ff e3 jmpq \*%r11 + +[0-9a-f]+: 66 66 66 66 66 66 2e data32 data32 data32 data32 data32 nopw %cs:0x0\(%rax,%rax,1\) + +[0-9a-f]+: 0f 1f 84 00 00 00 00 * + +[0-9a-f]+: 00 * + +[0-9a-f]+: 66 66 66 66 66 66 2e data32 data32 data32 data32 data32 nopw %cs:0x0\(%rax,%rax,1\) + +[0-9a-f]+: 0f 1f 84 00 00 00 00 * + +[0-9a-f]+: 00 * + +[0-9a-f]+: 66 66 2e 0f 1f 84 00 data32 nopw %cs:0x0\(%rax,%rax,1\) + +[0-9a-f]+: 00 00 00 00 * + +[0-9a-f]+ <fn1@plt>: + +[0-9a-f]+: 4c 8b 1d ([0-9a-f]{2} ){4} * mov 0x[0-9a-f]+\(%rip\),%r11 +# [0-9a-f]+ <_GLOBAL_OFFSET_TABLE_\+0x18> + +[0-9a-f]+: 41 83 e3 e0 and \$0xffffffe0,%r11d + +[0-9a-f]+: 4d 01 fb add %r15,%r11 + +[0-9a-f]+: 41 ff e3 jmpq \*%r11 + +[0-9a-f]+: 66 66 66 66 66 66 2e data32 data32 data32 data32 data32 nopw %cs:0x0\(%rax,%rax,1\) + +[0-9a-f]+: 0f 1f 84 00 00 00 00 * + +[0-9a-f]+: 00 * + +[0-9a-f]+: 68 00 00 00 00 pushq \$0x0 + +[0-9a-f]+: e9 ([0-9a-f]{2} ){4} * jmpq [0-9a-f]+ <fn1@plt-0x40> + +[0-9a-f]+: 66 66 66 66 66 66 2e data32 data32 data32 data32 data32 nopw %cs:0x0\(%rax,%rax,1\) + +[0-9a-f]+: 0f 1f 84 00 00 00 00 * + +[0-9a-f]+: 00 * + +[0-9a-f]+: 0f 1f 80 00 00 00 00 nopl 0x0\(%rax\) + +[0-9a-f]+ <fn2@plt>: + +[0-9a-f]+: 4c 8b 1d ([0-9a-f]{2} ){4} * mov 0x[0-9a-f]+\(%rip\),%r11 +# [0-9a-f]+ <_GLOBAL_OFFSET_TABLE_\+0x20> + +[0-9a-f]+: 41 83 e3 e0 and \$0xffffffe0,%r11d + +[0-9a-f]+: 4d 01 fb add %r15,%r11 + +[0-9a-f]+: 41 ff e3 jmpq \*%r11 + +[0-9a-f]+: 66 66 66 66 66 66 2e data32 data32 data32 data32 data32 nopw %cs:0x0\(%rax,%rax,1\) + +[0-9a-f]+: 0f 1f 84 00 00 00 00 * + +[0-9a-f]+: 00 * + +[0-9a-f]+: 68 01 00 00 00 pushq \$0x1 + +[0-9a-f]+: e9 ([0-9a-f]{2} ){4} * jmpq [0-9a-f]+ <fn1@plt-0x40> + +[0-9a-f]+: 66 66 66 66 66 66 2e data32 data32 data32 data32 data32 nopw %cs:0x0\(%rax,%rax,1\) + +[0-9a-f]+: 0f 1f 84 00 00 00 00 * + +[0-9a-f]+: 00 * + +[0-9a-f]+: 0f 1f 80 00 00 00 00 nopl 0x0\(%rax\) diff --git a/ld/testsuite/ld-x86-64/plt-pic.s b/ld/testsuite/ld-x86-64/plt-pic.s new file mode 100644 index 0000000000..a6f03dea9a --- /dev/null +++ b/ld/testsuite/ld-x86-64/plt-pic.s @@ -0,0 +1,6 @@ + .text + .globl foo + .type foo,@function +foo: + call fn1@plt + jmp fn2@plt diff --git a/ld/testsuite/ld-x86-64/plt.pd b/ld/testsuite/ld-x86-64/plt.pd new file mode 100644 index 0000000000..b11cc22aab --- /dev/null +++ b/ld/testsuite/ld-x86-64/plt.pd @@ -0,0 +1,24 @@ +#source: plt.s +#as: --64 +#ld: -melf_x86_64 +#objdump: -drj.plt +#target: x86_64-*-* + +.*: +file format .* + +Disassembly of section .plt: + +[0-9a-f]+ <fn1@plt-0x10>: + +[0-9a-f]+: ff 35 ([0-9a-f]{2} ){4} * pushq 0x[0-9a-f]+\(%rip\) +# [0-9a-f]+ <_GLOBAL_OFFSET_TABLE_\+0x8> + +[0-9a-f]+: ff 25 ([0-9a-f]{2} ){4} * jmpq \*0x[0-9a-f]+\(%rip\) +# [0-9a-f]+ <_GLOBAL_OFFSET_TABLE_\+0x10> + +[0-9a-f]+: 0f 1f 40 00 nopl 0x0\(%rax\) + +[0-9a-f]+ <fn1@plt>: + +[0-9a-f]+: ff 25 ([0-9a-f]{2} ){4} * jmpq \*0x[0-9a-f]+\(%rip\) +# [0-9a-f]+ <_GLOBAL_OFFSET_TABLE_\+0x18> + +[0-9a-f]+: 68 00 00 00 00 pushq \$0x0 + +[0-9a-f]+: e9 ([0-9a-f]{2} ){4} * jmpq [0-9a-f]+ <fn1@plt-0x10> + +[0-9a-f]+ <fn2@plt>: + +[0-9a-f]+: ff 25 ([0-9a-f]{2} ){4} * jmpq \*0x[0-9a-f]+\(%rip\) +# [0-9a-f]+ <_GLOBAL_OFFSET_TABLE_\+0x20> + +[0-9a-f]+: 68 01 00 00 00 pushq \$0x1 + +[0-9a-f]+: e9 ([0-9a-f]{2} ){4} * jmpq [0-9a-f]+ <fn1@plt-0x10> diff --git a/ld/testsuite/ld-x86-64/plt.s b/ld/testsuite/ld-x86-64/plt.s new file mode 100644 index 0000000000..3fd01afbf4 --- /dev/null +++ b/ld/testsuite/ld-x86-64/plt.s @@ -0,0 +1,6 @@ + .text + .globl _start + .type _start,@function +_start: + call fn1 + call fn2 diff --git a/ld/testsuite/ld-x86-64/pltlib.s b/ld/testsuite/ld-x86-64/pltlib.s new file mode 100644 index 0000000000..99e2bb48ed --- /dev/null +++ b/ld/testsuite/ld-x86-64/pltlib.s @@ -0,0 +1,10 @@ + .text + .globl fn1 + .type fn1,@function +fn1: + ret + + .globl fn2 + .type fn2,@function +fn2: + ret diff --git a/ld/testsuite/ld-x86-64/pr12718.d b/ld/testsuite/ld-x86-64/pr12718.d index ed04fd6d29..a5e904e84f 100644 --- a/ld/testsuite/ld-x86-64/pr12718.d +++ b/ld/testsuite/ld-x86-64/pr12718.d @@ -3,15 +3,15 @@ #ld: -melf_x86_64 #readelf: -S --wide -There are 5 section headers, starting at offset 0xa0: +There are 5 section headers, starting at offset 0x[0-9a-f]+: Section Headers: - \[Nr\] Name Type Address Off Size ES Flg Lk Inf Al - \[ 0\] NULL 0000000000000000 000000 000000 00 0 0 0 - \[ 1\] .text PROGBITS 0000000000400078 000078 000006 00 AX 0 0 4 - \[ 2\] .shstrtab STRTAB 0000000000000000 00007e 000021 00 0 0 1 - \[ 3\] .symtab SYMTAB 0000000000000000 0001e0 0000a8 18 4 2 8 - \[ 4\] .strtab STRTAB 0000000000000000 000288 000024 00 0 0 1 + +\[Nr\] Name +Type +Address +Off +Size +ES +Flg +Lk +Inf +Al + +\[ 0\] +NULL +0+ +0+ +0+ +0+ +0 +0 +0 + +\[ 1\] +.text +PROGBITS +[0-9a-f]+ +[0-9a-f]+ +000006 00 +AX +0 +0 +4 + +\[ 2\] +.shstrtab +STRTAB +0+ +[0-9a-f]+ +[0-9a-f]+ +0+ +0 +0 +1 + +\[ 3\] +.symtab +SYMTAB +0+ +[0-9a-f]+ +[0-9a-f]+ 18 +4 +2 +8 + +\[ 4\] +.strtab +STRTAB +0+ +[0-9a-f]+ +[0-9a-f]+ 00 +0 +0 +1 Key to Flags: W \(write\), A \(alloc\), X \(execute\), M \(merge\), S \(strings\), l \(large\) I \(info\), L \(link order\), G \(group\), T \(TLS\), E \(exclude\), x \(unknown\) diff --git a/ld/testsuite/ld-x86-64/pr12921.d b/ld/testsuite/ld-x86-64/pr12921.d index c0fe8abb2c..5c9537b30f 100644 --- a/ld/testsuite/ld-x86-64/pr12921.d +++ b/ld/testsuite/ld-x86-64/pr12921.d @@ -3,17 +3,17 @@ #ld: -melf_x86_64 #readelf: -S --wide -There are 7 section headers, starting at offset 0x2058: +There are 7 section headers, starting at offset 0x[0-9a-f]+: Section Headers: - \[Nr\] Name Type Address Off Size ES Flg Lk Inf Al - \[ 0\] NULL 0000000000000000 000000 000000 00 0 0 0 - \[ 1\] .text PROGBITS 0000000000401000 001000 000001 00 AX 0 0 4096 - \[ 2\] .data PROGBITS 0000000000602000 002000 000028 00 WA 0 0 4096 - \[ 3\] .bss NOBITS 0000000000603000 002028 010000 00 WA 0 0 4096 - \[ 4\] .shstrtab STRTAB 0000000000000000 002028 00002c 00 0 0 1 - \[ 5\] .symtab SYMTAB 0000000000000000 002218 000120 18 6 6 8 - \[ 6\] .strtab STRTAB 0000000000000000 002338 000037 00 0 0 1 + +\[Nr\] Name +Type +Address +Off +Size +ES +Flg +Lk +Inf +Al + +\[ 0\] +NULL +0+ +0+ +0+ +0+ +0 +0 +0 + +\[ 1\] .text +PROGBITS +[0-9a-f]+ +[0-9a-f]+ +0+1 00 +AX +0 +0 +4096 + +\[ 2\] .data +PROGBITS +[0-9a-f]+ +[0-9a-f]+000 +0+28 +00 +WA +0 +0 +4096 + +\[ 3\] .bss +NOBITS +[0-9a-f]+ +[0-9a-f]+028 +0+10000 +00 +WA +0 +0 +4096 + +\[ 4\] .shstrtab +STRTAB +0+ +[0-9a-f]+ +0+2c +00 +0 +0 +1 + +\[ 5\] .symtab +SYMTAB +0+ +[0-9a-f]+ +0+120 +18 +6 +6 +8 + +\[ 6\] .strtab +STRTAB +0+ +[0-9a-f]+ +0+37 +00 +0 +0 +1 Key to Flags: W \(write\), A \(alloc\), X \(execute\), M \(merge\), S \(strings\), l \(large\) I \(info\), L \(link order\), G \(group\), T \(TLS\), E \(exclude\), x \(unknown\) diff --git a/ld/testsuite/ld-x86-64/protected2-l1om.d b/ld/testsuite/ld-x86-64/protected2-l1om.d index 32311a25a4..9142f8eba1 100644 --- a/ld/testsuite/ld-x86-64/protected2-l1om.d +++ b/ld/testsuite/ld-x86-64/protected2-l1om.d @@ -2,6 +2,7 @@ #as: --64 -march=l1om #ld: -shared -melf_l1om #objdump: -drw --insn-width=7 +#target: x86_64-*-linux* .*: +file format .* diff --git a/ld/testsuite/ld-x86-64/protected3-l1om.d b/ld/testsuite/ld-x86-64/protected3-l1om.d index 701d4e15fc..9ecc89c732 100644 --- a/ld/testsuite/ld-x86-64/protected3-l1om.d +++ b/ld/testsuite/ld-x86-64/protected3-l1om.d @@ -2,6 +2,7 @@ #as: --64 -march=l1om #ld: -shared -melf_l1om #readelf: -h +#target: x86_64-*-linux* ELF Header: Magic: 7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00 diff --git a/ld/testsuite/ld-x86-64/protected3.d b/ld/testsuite/ld-x86-64/protected3.d index 897c1cf215..22a36ac4c8 100644 --- a/ld/testsuite/ld-x86-64/protected3.d +++ b/ld/testsuite/ld-x86-64/protected3.d @@ -8,6 +8,6 @@ Disassembly of section .text: 0+[a-f0-9]+ <bar>: -[ ]*[a-f0-9]+: 8b 05 [a-f0-9][a-f0-9] 00 [a-f0-9][a-f0-9] 00 mov 0x[a-f0-9]+\(%rip\),%eax # [a-f0-9]+ <foo> -[ ]*[a-f0-9]+: c3 retq +[ ]*[a-f0-9]+: 8b 05 ([0-9a-f]{2} ){4} * mov 0x[a-f0-9]+\(%rip\),%eax # [a-f0-9]+ <foo> +[ ]*[a-f0-9]+: c3 retq * #pass diff --git a/ld/testsuite/ld-x86-64/split-by-file-nacl.rd b/ld/testsuite/ld-x86-64/split-by-file-nacl.rd new file mode 100644 index 0000000000..7c63aaa1a6 --- /dev/null +++ b/ld/testsuite/ld-x86-64/split-by-file-nacl.rd @@ -0,0 +1,17 @@ +There are 9 section headers, starting at offset 0x80: + +Section Headers: + \[Nr\] Name Type Address Off Size ES Flg Lk Inf Al + \[ 0\] NULL 0000000000000000 000000 000000 00 0 0 0 + \[ 1\] .text PROGBITS 0000000000000000 000040 000000 00 AX 0 0 4 + \[ 2\] .foo PROGBITS 0000000000000000 000040 000003 00 AXl 0 0 1 + \[ 3\] .data PROGBITS 0000000000000000 000044 000000 00 WA 0 0 4 + \[ 4\] .bss NOBITS 0000000000000000 000044 000000 00 WA 0 0 4 + \[ 5\] .foo.0 PROGBITS 0000000000000003 000044 000003 00 AXl 0 0 1 + \[ 6\] .shstrtab STRTAB 0000000000000000 000047 000038 00 0 0 1 + \[ 7\] .symtab SYMTAB 0000000000000000 0002c0 0000d8 18 8 6 8 + \[ 8\] .strtab STRTAB 0000000000000000 000398 000016 00 0 0 1 +Key to Flags: + W \(write\), A \(alloc\), X \(execute\), M \(merge\), S \(strings\), l \(large\) + I \(info\), L \(link order\), G \(group\), T \(TLS\), E \(exclude\), x \(unknown\) + O \(extra OS processing required\) o \(OS specific\), p \(processor specific\) diff --git a/ld/testsuite/ld-x86-64/tlsbin-nacl.rd b/ld/testsuite/ld-x86-64/tlsbin-nacl.rd new file mode 100644 index 0000000000..5655b8c628 --- /dev/null +++ b/ld/testsuite/ld-x86-64/tlsbin-nacl.rd @@ -0,0 +1,149 @@ +#source: tlsbinpic.s +#source: tlsbin.s +#as: --64 +#ld: -shared -melf_x86_64_nacl --no-ld-generated-unwind-info +#readelf: -WSsrl +#target: x86_64-*-nacl* + +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]+\] .plt +.* + +\[[ 0-9]+\] .text +PROGBITS +0+21000 [0-9a-f]+ 0+234 00 +AX +0 +0 +4096 + +\[[ 0-9]+\] .interp +.* + +\[[ 0-9]+\] .hash +.* + +\[[ 0-9]+\] .dynsym +.* + +\[[ 0-9]+\] .dynstr +.* + +\[[ 0-9]+\] .rela.dyn +.* + +\[[ 0-9]+\] .rela.plt +.* + +\[[ 0-9]+\] .tdata +PROGBITS +0+100303b0 [0-9a-f]+ 0+60 00 WAT +0 +0 +1 + +\[[ 0-9]+\] .tbss +NOBITS +0+10030410 [0-9a-f]+ 0+40 00 WAT +0 +0 +1 + +\[[ 0-9]+\] .dynamic +DYNAMIC +0+10030410 [0-9a-f]+ 0+140 10 +WA +6 +0 +8 + +\[[ 0-9]+\] .got +PROGBITS +0+10030550 [0-9a-f]+ 0+20 08 +WA +0 +0 +8 + +\[[ 0-9]+\] .got.plt +PROGBITS +0+10030570 [0-9a-f]+ 0+20 08 +WA +0 +0 +8 + +\[[ 0-9]+\] .shstrtab +.* + +\[[ 0-9]+\] .symtab +.* + +\[[ 0-9]+\] .strtab +.* +Key to Flags: +.* +.* +.* + +Elf file type is EXEC \(Executable file\) +Entry point 0x2113c +There are [0-9]+ program headers, starting at offset [0-9]+ + +Program Headers: + +Type +Offset +VirtAddr +PhysAddr +FileSiz +MemSiz +Flg Align + +PHDR.* + +INTERP.* +.*Requesting program interpreter.* + +LOAD +0x0+10000 0x0+20000 0x0+20000 0x0+1234 0x0+1234 R E +0x10000 + +LOAD +0x0+ 0x0+10020000 0x0+10020000 0x0+3b0 0x0+3b0 R +0x10000 + +LOAD +0x0+3b0 0x0+100303b0 0x0+100303b0 0x0+1e0 0x0+1e0 RW +0x10000 + +DYNAMIC +0x0+410 0x0+10030410 0x0+10030410 0x0+140 0x0+140 RW +0x8 + +TLS +0x0+3b0 0x0+100303b0 0x0+100303b0 0x0+60 0x0+a0 R +0x1 + + Section to Segment mapping: + +Segment Sections... + +00 * + +01 +.interp * + +02 +.plt .text * + +03 +.interp .hash .dynsym .dynstr .rela.dyn .rela.plt * + +04 +.tdata .dynamic .got .got.plt * + +05 +.dynamic * + +06 +.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_X86_64_TPOFF64 +0+ sG5 \+ 0 +[0-9a-f ]+R_X86_64_TPOFF64 +0+ sG2 \+ 0 +[0-9a-f ]+R_X86_64_TPOFF64 +0+ sG6 \+ 0 +[0-9a-f ]+R_X86_64_TPOFF64 +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_X86_64_JUMP_SLOT[0-9a-f ]+__tls_get_addr \+ 0 + +Symbol table '\.dynsym' contains [0-9]+ entries: + +Num: +Value +Size +Type +Bind +Vis +Ndx +Name +.* NOTYPE +LOCAL +DEFAULT +UND * +.* TLS +GLOBAL +DEFAULT +UND sG5 +.* TLS +GLOBAL +DEFAULT +UND sG2 +.* FUNC +GLOBAL +DEFAULT +UND __tls_get_addr +.* 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 * +.* SECTION +LOCAL +DEFAULT +13 * +.* 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 +13 _GLOBAL_OFFSET_TABLE_ +.* TLS +GLOBAL +DEFAULT +9 sg8 +.* TLS +GLOBAL +DEFAULT +10 bg8 +.* TLS +GLOBAL +DEFAULT +10 bg6 +.* TLS +GLOBAL +DEFAULT +UND sG5 +.* 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 +.* FUNC +GLOBAL +DEFAULT +UND __tls_get_addr +.* TLS +GLOBAL +HIDDEN +9 sh7 +.* TLS +GLOBAL +HIDDEN +9 sh8 +.* TLS +GLOBAL +DEFAULT +9 sg1 +.* FUNC +GLOBAL +DEFAULT +2 _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 +2 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/ld/testsuite/ld-x86-64/tlsbin.dd b/ld/testsuite/ld-x86-64/tlsbin.dd index e0287530ca..a2ad193d16 100644 --- a/ld/testsuite/ld-x86-64/tlsbin.dd +++ b/ld/testsuite/ld-x86-64/tlsbin.dd @@ -14,298 +14,298 @@ # 0x60 -0x40 bg1..bg8 # 0x80 -0x20 bl1..bl8 -.*: +file format elf64-x86-64 +.*: +file format elf64-x86-64.* Disassembly of section .text: -0+401000 <fn2>: - 401000: 55[ ]+push %rbp - 401001: 48 89 e5[ ]+mov %rsp,%rbp +[0-9a-f]+ <fn2>: + +[0-9a-f]+: 55[ ]+push %rbp + +[0-9a-f]+: 48 89 e5[ ]+mov %rsp,%rbp # GD -> IE because variable is not defined in executable - 401004: 64 48 8b 04 25 00 00[ ]+mov %fs:0x0,%rax - 40100b: 00 00 * - 40100d: 48 03 05 dc 03 20 00[ ]+add 0x2003dc\(%rip\),%rax +# 6013f0 <.*> + +[0-9a-f]+: 64 48 8b 04 25 00 00[ ]+mov %fs:0x0,%rax + +[0-9a-f]+: 00 00 * + +[0-9a-f]+: 48 03 05 ([0-9a-f]{2} ){4}[ ]+add 0x[0-9a-f]+\(%rip\),%rax +# [0-9a-f]+ <_DYNAMIC\+0x158> # -> R_X86_64_TPOFF64 sG1 - 401014: 90[ ]+nop * - 401015: 90[ ]+nop * - 401016: 90[ ]+nop * - 401017: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * # GD -> IE because variable is not defined in executable where # the variable is referenced through IE too - 401018: 64 48 8b 04 25 00 00[ ]+mov %fs:0x0,%rax - 40101f: 00 00 * - 401021: 48 03 05 b8 03 20 00[ ]+add 0x2003b8\(%rip\),%rax +# 6013e0 <.*> + +[0-9a-f]+: 64 48 8b 04 25 00 00[ ]+mov %fs:0x0,%rax + +[0-9a-f]+: 00 00 * + +[0-9a-f]+: 48 03 05 ([0-9a-f]{2} ){4}[ ]+add 0x[0-9a-f]+\(%rip\),%rax +# [0-9a-f]+ <_DYNAMIC\+0x148> # -> R_X86_64_TPOFF64 sG2 - 401028: 90[ ]+nop * - 401029: 90[ ]+nop * - 40102a: 90[ ]+nop * - 40102b: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * # GD -> LE with global variable defined in executable - 40102c: 64 48 8b 04 25 00 00[ ]+mov %fs:0x0,%rax - 401033: 00 00 * - 401035: 48 8d 80 60 ff ff ff[ ]+lea -0xa0\(%rax\),%rax + +[0-9a-f]+: 64 48 8b 04 25 00 00[ ]+mov %fs:0x0,%rax + +[0-9a-f]+: 00 00 * + +[0-9a-f]+: 48 8d 80 60 ff ff ff[ ]+lea -0xa0\(%rax\),%rax # sg1 - 40103c: 90[ ]+nop * - 40103d: 90[ ]+nop * - 40103e: 90[ ]+nop * - 40103f: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * # GD -> LE with local variable defined in executable - 401040: 64 48 8b 04 25 00 00[ ]+mov %fs:0x0,%rax - 401047: 00 00 * - 401049: 48 8d 80 80 ff ff ff[ ]+lea -0x80\(%rax\),%rax + +[0-9a-f]+: 64 48 8b 04 25 00 00[ ]+mov %fs:0x0,%rax + +[0-9a-f]+: 00 00 * + +[0-9a-f]+: 48 8d 80 80 ff ff ff[ ]+lea -0x80\(%rax\),%rax # sl1 - 401050: 90[ ]+nop * - 401051: 90[ ]+nop * - 401052: 90[ ]+nop * - 401053: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * # GD -> LE with hidden variable defined in executable - 401054: 64 48 8b 04 25 00 00[ ]+mov %fs:0x0,%rax - 40105b: 00 00 * - 40105d: 48 8d 80 a0 ff ff ff[ ]+lea -0x60\(%rax\),%rax + +[0-9a-f]+: 64 48 8b 04 25 00 00[ ]+mov %fs:0x0,%rax + +[0-9a-f]+: 00 00 * + +[0-9a-f]+: 48 8d 80 a0 ff ff ff[ ]+lea -0x60\(%rax\),%rax # sh1 - 401064: 90[ ]+nop * - 401065: 90[ ]+nop * - 401066: 90[ ]+nop * - 401067: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * # LD -> LE - 401068: 66 66 66 64 48 8b 04[ ]+data32 data32 data32 mov %fs:0x0,%rax - 40106f: 25 00 00 00 00 * - 401074: 90[ ]+nop * - 401075: 90[ ]+nop * - 401076: 48 8d 90 81 ff ff ff[ ]+lea -0x7f\(%rax\),%rdx + +[0-9a-f]+: 66 66 66 64 48 8b 04[ ]+data32 data32 data32 mov %fs:0x0,%rax + +[0-9a-f]+: 25 00 00 00 00 * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 48 8d 90 81 ff ff ff[ ]+lea -0x7f\(%rax\),%rdx # sl1+1 - 40107d: 90[ ]+nop * - 40107e: 90[ ]+nop * - 40107f: 4c 8d 88 86 ff ff ff[ ]+lea -0x7a\(%rax\),%r9 + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 4c 8d 88 86 ff ff ff[ ]+lea -0x7a\(%rax\),%r9 # sl2+2 - 401086: 90[ ]+nop * - 401087: 90[ ]+nop * - 401088: 90[ ]+nop * - 401089: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * # LD -> LE against hidden variables - 40108a: 66 66 66 64 48 8b 04[ ]+data32 data32 data32 mov %fs:0x0,%rax - 401091: 25 00 00 00 00 * - 401096: 90[ ]+nop * - 401097: 90[ ]+nop * - 401098: 48 8d 90 a0 ff ff ff[ ]+lea -0x60\(%rax\),%rdx + +[0-9a-f]+: 66 66 66 64 48 8b 04[ ]+data32 data32 data32 mov %fs:0x0,%rax + +[0-9a-f]+: 25 00 00 00 00 * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 48 8d 90 a0 ff ff ff[ ]+lea -0x60\(%rax\),%rdx # sh1 - 40109f: 90[ ]+nop * - 4010a0: 90[ ]+nop * - 4010a1: 48 8d 88 a7 ff ff ff[ ]+lea -0x59\(%rax\),%rcx + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 48 8d 88 a7 ff ff ff[ ]+lea -0x59\(%rax\),%rcx # sh2+3 - 4010a8: 90[ ]+nop * - 4010a9: 90[ ]+nop * - 4010aa: 90[ ]+nop * - 4010ab: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * # IE against global var - 4010ac: 64 4c 8b 0c 25 00 00[ ]+mov %fs:0x0,%r9 - 4010b3: 00 00 * - 4010b5: 90[ ]+nop * - 4010b6: 90[ ]+nop * - 4010b7: 4c 03 0d 22 03 20 00[ ]+add 0x200322\(%rip\),%r9 +# 6013e0 <.*> + +[0-9a-f]+: 64 4c 8b 0c 25 00 00[ ]+mov %fs:0x0,%r9 + +[0-9a-f]+: 00 00 * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 4c 03 0d ([0-9a-f]{2} ){4}[ ]+add 0x[0-9a-f]+\(%rip\),%r9 +# [0-9a-f]+ <_DYNAMIC\+0x148> # -> R_X86_64_TPOFF64 sG2 - 4010be: 90[ ]+nop * - 4010bf: 90[ ]+nop * - 4010c0: 90[ ]+nop * - 4010c1: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * # IE -> LE against global var defined in exec - 4010c2: 64 4c 8b 14 25 00 00[ ]+mov %fs:0x0,%r10 - 4010c9: 00 00 * - 4010cb: 90[ ]+nop * - 4010cc: 90[ ]+nop * - 4010cd: 4d 8d 92 60 ff ff ff[ ]+lea -0xa0\(%r10\),%r10 + +[0-9a-f]+: 64 4c 8b 14 25 00 00[ ]+mov %fs:0x0,%r10 + +[0-9a-f]+: 00 00 * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 4d 8d 92 60 ff ff ff[ ]+lea -0xa0\(%r10\),%r10 # sg1 - 4010d4: 90[ ]+nop * - 4010d5: 90[ ]+nop * - 4010d6: 90[ ]+nop * - 4010d7: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * # IE -> LE against local var - 4010d8: 64 48 8b 04 25 00 00[ ]+mov %fs:0x0,%rax - 4010df: 00 00 * - 4010e1: 90[ ]+nop * - 4010e2: 90[ ]+nop * - 4010e3: 48 8d 80 80 ff ff ff[ ]+lea -0x80\(%rax\),%rax + +[0-9a-f]+: 64 48 8b 04 25 00 00[ ]+mov %fs:0x0,%rax + +[0-9a-f]+: 00 00 * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 48 8d 80 80 ff ff ff[ ]+lea -0x80\(%rax\),%rax # sl1 - 4010ea: 90[ ]+nop * - 4010eb: 90[ ]+nop * - 4010ec: 90[ ]+nop * - 4010ed: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * # IE -> LE against hidden var - 4010ee: 64 48 8b 0c 25 00 00[ ]+mov %fs:0x0,%rcx - 4010f5: 00 00 * - 4010f7: 90[ ]+nop * - 4010f8: 90[ ]+nop * - 4010f9: 48 8d 89 a0 ff ff ff[ ]+lea -0x60\(%rcx\),%rcx + +[0-9a-f]+: 64 48 8b 0c 25 00 00[ ]+mov %fs:0x0,%rcx + +[0-9a-f]+: 00 00 * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 48 8d 89 a0 ff ff ff[ ]+lea -0x60\(%rcx\),%rcx # sh1 - 401100: 90[ ]+nop * - 401101: 90[ ]+nop * - 401102: 90[ ]+nop * - 401103: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * # Direct access through %fs # IE against global var - 401104: 48 8b 0d cd 02 20 00[ ]+mov 0x2002cd\(%rip\),%rcx +# 6013d8 <.*> + +[0-9a-f]+: 48 8b 0d ([0-9a-f]{2} ){4}[ ]+mov 0x[0-9a-f]+\(%rip\),%rcx +# [0-9a-f]+ <_DYNAMIC\+0x140> # -> R_X86_64_TPOFF64 sG5 - 40110b: 90[ ]+nop * - 40110c: 90[ ]+nop * - 40110d: 64 48 8b 11[ ]+mov %fs:\(%rcx\),%rdx - 401111: 90[ ]+nop * - 401112: 90[ ]+nop * - 401113: 90[ ]+nop * - 401114: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 64 48 8b 11[ ]+mov %fs:\(%rcx\),%rdx + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * # IE->LE against local var - 401115: 49 c7 c3 90 ff ff ff[ ]+mov \$0xf+90,%r11 + +[0-9a-f]+: 49 c7 c3 90 ff ff ff[ ]+mov \$0xf+90,%r11 # sl5 - 40111c: 90[ ]+nop * - 40111d: 90[ ]+nop * - 40111e: 64 4d 8b 23[ ]+mov %fs:\(%r11\),%r12 - 401122: 90[ ]+nop * - 401123: 90[ ]+nop * - 401124: 90[ ]+nop * - 401125: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 64 4d 8b 23[ ]+mov %fs:\(%r11\),%r12 + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * # IE->LE against hidden var - 401126: 48 c7 c2 b0 ff ff ff[ ]+mov \$0xf+b0,%rdx - 40112d: 90[ ]+nop * - 40112e: 90[ ]+nop * - 40112f: 64 48 8b 12[ ]+mov %fs:\(%rdx\),%rdx + +[0-9a-f]+: 48 c7 c2 b0 ff ff ff[ ]+mov \$0xf+b0,%rdx + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 64 48 8b 12[ ]+mov %fs:\(%rdx\),%rdx # sh5 - 401133: 90[ ]+nop * - 401134: 90[ ]+nop * - 401135: 90[ ]+nop * - 401136: 90[ ]+nop * - 401137: c9[ ]+leaveq * - 401138: c3[ ]+retq * - 401139: 0f 1f 00[ ]+nopl \(%rax\) + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: c9[ ]+leaveq * + +[0-9a-f]+: c3[ ]+retq * + +[0-9a-f]+: 0f 1f 00[ ]+nopl \(%rax\) -0+40113c <_start>: - 40113c: 55[ ]+push %rbp - 40113d: 48 89 e5[ ]+mov %rsp,%rbp +[0-9a-f]+ <_start>: + +[0-9a-f]+: 55[ ]+push %rbp + +[0-9a-f]+: 48 89 e5[ ]+mov %rsp,%rbp # IE against global var - 401140: 64 4c 8b 1c 25 00 00[ ]+mov %fs:0x0,%r11 - 401147: 00 00 * - 401149: 90[ ]+nop * - 40114a: 90[ ]+nop * - 40114b: 4c 03 1d 96 02 20 00[ ]+add 0x200296\(%rip\),%r11 +# 6013e8 <.*> + +[0-9a-f]+: 64 4c 8b 1c 25 00 00[ ]+mov %fs:0x0,%r11 + +[0-9a-f]+: 00 00 * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 4c 03 1d ([0-9a-f]{2} ){4}[ ]+add 0x[0-9a-f]+\(%rip\),%r11 +# [0-9a-f]+ <_DYNAMIC\+0x150> # -> R_X86_64_TPOFF64 sG6 - 401152: 90[ ]+nop * - 401153: 90[ ]+nop * - 401154: 90[ ]+nop * - 401155: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * # IE -> LE against global var defined in exec - 401156: 64 48 8b 14 25 00 00[ ]+mov %fs:0x0,%rdx - 40115d: 00 00 * - 40115f: 90[ ]+nop * - 401160: 90[ ]+nop * - 401161: 48 8d 92 d4 ff ff ff[ ]+lea -0x2c\(%rdx\),%rdx + +[0-9a-f]+: 64 48 8b 14 25 00 00[ ]+mov %fs:0x0,%rdx + +[0-9a-f]+: 00 00 * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 48 8d 92 d4 ff ff ff[ ]+lea -0x2c\(%rdx\),%rdx # bg6 - 401168: 90[ ]+nop * - 401169: 90[ ]+nop * - 40116a: 90[ ]+nop * - 40116b: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * # IE -> LE against local var - 40116c: 64 4c 8b 24 25 00 00[ ]+mov %fs:0x0,%r12 - 401173: 00 00 * - 401175: 90[ ]+nop * - 401176: 90[ ]+nop * - 401177: 49 81 c4 f4 ff ff ff[ ]+add \$0xf+f4,%r12 + +[0-9a-f]+: 64 4c 8b 24 25 00 00[ ]+mov %fs:0x0,%r12 + +[0-9a-f]+: 00 00 * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 49 81 c4 f4 ff ff ff[ ]+add \$0xf+f4,%r12 # bl6 - 40117e: 90[ ]+nop * - 40117f: 90[ ]+nop * - 401180: 90[ ]+nop * - 401181: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * # direct %fs access IE -> LE against local var - 401182: 48 c7 c2 fc ff ff ff[ ]+mov \$0xf+fc,%rdx + +[0-9a-f]+: 48 c7 c2 fc ff ff ff[ ]+mov \$0xf+fc,%rdx # bl8 - 401189: 90[ ]+nop * - 40118a: 90[ ]+nop * - 40118b: 64 48 8b 02[ ]+mov %fs:\(%rdx\),%rax - 40118f: 90[ ]+nop * - 401190: 90[ ]+nop * - 401191: 90[ ]+nop * - 401192: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 64 48 8b 02[ ]+mov %fs:\(%rdx\),%rax + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * # IE -> LE against hidden but not local var - 401193: 64 48 8b 14 25 00 00[ ]+mov %fs:0x0,%rdx - 40119a: 00 00 * - 40119c: 90[ ]+nop * - 40119d: 90[ ]+nop * - 40119e: 48 8d 92 b4 ff ff ff[ ]+lea -0x4c\(%rdx\),%rdx + +[0-9a-f]+: 64 48 8b 14 25 00 00[ ]+mov %fs:0x0,%rdx + +[0-9a-f]+: 00 00 * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 48 8d 92 b4 ff ff ff[ ]+lea -0x4c\(%rdx\),%rdx # sh6 - 4011a5: 90[ ]+nop * - 4011a6: 90[ ]+nop * - 4011a7: 90[ ]+nop * - 4011a8: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * # direct %fs access IE -> LE against hidden but not local var - 4011a9: 48 c7 c2 bc ff ff ff[ ]+mov \$0xf+bc,%rdx + +[0-9a-f]+: 48 c7 c2 bc ff ff ff[ ]+mov \$0xf+bc,%rdx # sh8 - 4011b0: 90[ ]+nop * - 4011b1: 90[ ]+nop * - 4011b2: 64 48 8b 02[ ]+mov %fs:\(%rdx\),%rax - 4011b6: 90[ ]+nop * - 4011b7: 90[ ]+nop * - 4011b8: 90[ ]+nop * - 4011b9: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 64 48 8b 02[ ]+mov %fs:\(%rdx\),%rax + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * # LE, global var defined in exec - 4011ba: 64 48 8b 04 25 00 00[ ]+mov %fs:0x0,%rax - 4011c1: 00 00 * - 4011c3: 90[ ]+nop * - 4011c4: 90[ ]+nop * - 4011c5: 48 8d 90 64 ff ff ff[ ]+lea -0x9c\(%rax\),%rdx + +[0-9a-f]+: 64 48 8b 04 25 00 00[ ]+mov %fs:0x0,%rax + +[0-9a-f]+: 00 00 * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 48 8d 90 64 ff ff ff[ ]+lea -0x9c\(%rax\),%rdx # sg2 - 4011cc: 90[ ]+nop * - 4011cd: 90[ ]+nop * - 4011ce: 90[ ]+nop * - 4011cf: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * # LE, local var, non-canonical sequence - 4011d0: 49 c7 c1 e6 ff ff ff[ ]+mov \$0xf+e6,%r9 + +[0-9a-f]+: 49 c7 c1 e6 ff ff ff[ ]+mov \$0xf+e6,%r9 # bl2+2 - 4011d7: 90[ ]+nop * - 4011d8: 90[ ]+nop * - 4011d9: 64 48 8b 14 25 00 00[ ]+mov %fs:0x0,%rdx - 4011e0: 00 00 * - 4011e2: 90[ ]+nop * - 4011e3: 90[ ]+nop * - 4011e4: 4c 01 ca[ ]+add %r9,%rdx - 4011e7: 90[ ]+nop * - 4011e8: 90[ ]+nop * - 4011e9: 90[ ]+nop * - 4011ea: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 64 48 8b 14 25 00 00[ ]+mov %fs:0x0,%rdx + +[0-9a-f]+: 00 00 * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 4c 01 ca[ ]+add %r9,%rdx + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * # LE, hidden var defined in exec, non-canonical sequence - 4011eb: 64 48 8b 14 25 00 00[ ]+mov %fs:0x0,%rdx - 4011f2: 00 00 * - 4011f4: 90[ ]+nop * - 4011f5: 90[ ]+nop * - 4011f6: 48 81 c2 a5 ff ff ff[ ]+add \$0xf+a5,%rdx + +[0-9a-f]+: 64 48 8b 14 25 00 00[ ]+mov %fs:0x0,%rdx + +[0-9a-f]+: 00 00 * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 48 81 c2 a5 ff ff ff[ ]+add \$0xf+a5,%rdx # sh2+1 - 4011fd: 90[ ]+nop * - 4011fe: 90[ ]+nop * - 4011ff: 90[ ]+nop * - 401200: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * # Direct %fs access # LE, global var defined in exec - 401201: 64 48 8b 04 25 68 ff[ ]+mov %fs:0xf+68,%rax - 401208: ff ff * + +[0-9a-f]+: 64 48 8b 04 25 68 ff[ ]+mov %fs:0xf+68,%rax + +[0-9a-f]+: ff ff * # sg3 - 40120a: 90[ ]+nop * - 40120b: 90[ ]+nop * - 40120c: 90[ ]+nop * - 40120d: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * # LE, local var - 40120e: 64 4c 8b 14 25 eb ff[ ]+mov %fs:0xf+eb,%r10 - 401215: ff ff * + +[0-9a-f]+: 64 4c 8b 14 25 eb ff[ ]+mov %fs:0xf+eb,%r10 + +[0-9a-f]+: ff ff * # bl3+3 - 401217: 90[ ]+nop * - 401218: 90[ ]+nop * - 401219: 90[ ]+nop * - 40121a: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * # LE, hidden var defined in exec - 40121b: 64 48 8b 14 25 a9 ff[ ]+mov %fs:0xf+a9,%rdx - 401222: ff ff * + +[0-9a-f]+: 64 48 8b 14 25 a9 ff[ ]+mov %fs:0xf+a9,%rdx + +[0-9a-f]+: ff ff * # sh3+1 - 401224: 90[ ]+nop * - 401225: 90[ ]+nop * - 401226: 90[ ]+nop * - 401227: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * # LE, large model - 401228: 48 ba a5 ff ff ff ff[ ]+movabs \$0xffffffffffffffa5,%rdx - 40122f: ff ff ff * - 401232: c9[ ]+leaveq * - 401233: c3[ ]+retq * + +[0-9a-f]+: 48 ba a5 ff ff ff ff[ ]+movabs \$0xffffffffffffffa5,%rdx + +[0-9a-f]+: ff ff ff * + +[0-9a-f]+: c9[ ]+leaveq * + +[0-9a-f]+: c3[ ]+retq * diff --git a/ld/testsuite/ld-x86-64/tlsbin.sd b/ld/testsuite/ld-x86-64/tlsbin.sd index 7fa7904a4c..5a31dcd7e1 100644 --- a/ld/testsuite/ld-x86-64/tlsbin.sd +++ b/ld/testsuite/ld-x86-64/tlsbin.sd @@ -5,8 +5,8 @@ #objdump: -sj.got #target: x86_64-*-* -.*: +file format elf64-x86-64 +.*: +file format elf64-x86-64.* Contents of section .got: - 6013d8 00000000 00000000 00000000 00000000 .* - 6013e8 00000000 00000000 00000000 00000000 .* + [0-9a-f]+ 00000000 00000000 00000000 00000000 .* + [0-9a-f]+ 00000000 00000000 00000000 00000000 .* diff --git a/ld/testsuite/ld-x86-64/tlsbin.td b/ld/testsuite/ld-x86-64/tlsbin.td index 6f87a19f57..0f7b3a584f 100644 --- a/ld/testsuite/ld-x86-64/tlsbin.td +++ b/ld/testsuite/ld-x86-64/tlsbin.td @@ -5,12 +5,12 @@ #objdump: -sj.tdata #target: x86_64-*-* -.*: +file format elf64-x86-64 +.*: +file format elf64-x86-64.* Contents of section .tdata: - 601234 11000000 12000000 13000000 14000000 .* - 601244 15000000 16000000 17000000 18000000 .* - 601254 41000000 42000000 43000000 44000000 .* - 601264 45000000 46000000 47000000 48000000 .* - 601274 01010000 02010000 03010000 04010000 .* - 601284 05010000 06010000 07010000 08010000 .* + [0-9a-f]+ 11000000 12000000 13000000 14000000 .* + [0-9a-f]+ 15000000 16000000 17000000 18000000 .* + [0-9a-f]+ 41000000 42000000 43000000 44000000 .* + [0-9a-f]+ 45000000 46000000 47000000 48000000 .* + [0-9a-f]+ 01010000 02010000 03010000 04010000 .* + [0-9a-f]+ 05010000 06010000 07010000 08010000 .* diff --git a/ld/testsuite/ld-x86-64/tlsbindesc-nacl.rd b/ld/testsuite/ld-x86-64/tlsbindesc-nacl.rd new file mode 100644 index 0000000000..7d5e81d493 --- /dev/null +++ b/ld/testsuite/ld-x86-64/tlsbindesc-nacl.rd @@ -0,0 +1,140 @@ +#source: tlsbindesc.s +#source: tlsbin.s +#as: --64 +#ld: -shared -melf_x86_64_nacl --no-ld-generated-unwind-info +#readelf: -WSsrl +#target: x86_64-*-nacl* + +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]+\] .text +PROGBITS +0+20000 0+10000 0+200 00 +AX +0 +0 +4096 + +\[[ 0-9]+\] .interp +.* + +\[[ 0-9]+\] .hash +.* + +\[[ 0-9]+\] .dynsym +.* + +\[[ 0-9]+\] .dynstr +.* + +\[[ 0-9]+\] .rela.dyn +.* + +\[[ 0-9]+\] .tdata +PROGBITS +0+10030370 0+370 0+60 00 WAT +0 +0 +1 + +\[[ 0-9]+\] .tbss +NOBITS +0+100303d0 0+3d0 0+40 00 WAT +0 +0 +1 + +\[[ 0-9]+\] .dynamic +DYNAMIC +0+100303d0 0+3d0 0+100 10 +WA +5 +0 +8 + +\[[ 0-9]+\] .got +PROGBITS +0+100304d0 0+4d0 0+20 08 +WA +0 +0 +8 + +\[[ 0-9]+\] .got.plt +PROGBITS +0+100304f0 0+4f0 0+18 08 +WA +0 +0 +8 + +\[[ 0-9]+\] .shstrtab +.* + +\[[ 0-9]+\] .symtab +.* + +\[[ 0-9]+\] .strtab +.* +Key to Flags: +.* +.* +.* + +Elf file type is EXEC \(Executable file\) +Entry point 0x20108 +There are [0-9]+ program headers, starting at offset [0-9]+ + +Program Headers: + +Type +Offset +VirtAddr +PhysAddr +FileSiz +MemSiz +Flg Align + +PHDR.* + +INTERP.* +.*Requesting program interpreter.* + +LOAD +0x0+10000 0x0+20000 0x0+20000 0x0+200 0x0+200 R E 0x10000 + +LOAD +0x0+ 0x0+10020000 0x0+10020000 0x0+370 0x0+370 R +0x10000 + +LOAD +0x0+370 0x0+10030370 0x0+10030370 0x0+198 0x0+198 RW +0x10000 + +DYNAMIC +0x0+3d0 0x0+100303d0 0x0+100303d0 0x0+100 0x0+100 RW +0x8 + +TLS +0x0+370 0x0+10030370 0x0+10030370 0x0+60 0x0+a0 R +0x1 + + Section to Segment mapping: + +Segment Sections... + +00 * + +01 +.interp * + +02 +.text * + +03 +.interp .hash .dynsym .dynstr .rela.dyn * + +04 +.tdata .dynamic .got .got.plt * + +05 +.dynamic * + +06 +.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+100304d0 +0+100000012 R_X86_64_TPOFF64 +0+ sG5 \+ 0 +0+100304d8 +0+200000012 R_X86_64_TPOFF64 +0+ sG2 \+ 0 +0+100304e0 +0+400000012 R_X86_64_TPOFF64 +0+ sG6 \+ 0 +0+100304e8 +0+500000012 R_X86_64_TPOFF64 +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 sG5 + +[0-9]+: 0+ +0 +TLS +GLOBAL +DEFAULT +UND sG2 + +[0-9]+: 0+[0-9a-f]+ +0 +NOTYPE +GLOBAL +DEFAULT +ABS __bss_start + +[0-9]+: 0+ +0 +TLS +GLOBAL +DEFAULT +UND sG6 + +[0-9]+: 0+ +0 +TLS +GLOBAL +DEFAULT +UND sG1 + +[0-9]+: 0+[0-9a-f]+ +0 +NOTYPE +GLOBAL +DEFAULT +ABS _edata + +[0-9]+: 0+[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+20 +0 +TLS +LOCAL +DEFAULT +7 sl1 + +[0-9]+: 0+24 +0 +TLS +LOCAL +DEFAULT +7 sl2 + +[0-9]+: 0+28 +0 +TLS +LOCAL +DEFAULT +7 sl3 + +[0-9]+: 0+2c +0 +TLS +LOCAL +DEFAULT +7 sl4 + +[0-9]+: 0+30 +0 +TLS +LOCAL +DEFAULT +7 sl5 + +[0-9]+: 0+34 +0 +TLS +LOCAL +DEFAULT +7 sl6 + +[0-9]+: 0+38 +0 +TLS +LOCAL +DEFAULT +7 sl7 + +[0-9]+: 0+3c +0 +TLS +LOCAL +DEFAULT +7 sl8 + +[0-9]+: 0+80 +0 +TLS +LOCAL +DEFAULT +8 bl1 + +[0-9]+: 0+84 +0 +TLS +LOCAL +DEFAULT +8 bl2 + +[0-9]+: 0+88 +0 +TLS +LOCAL +DEFAULT +8 bl3 + +[0-9]+: 0+8c +0 +TLS +LOCAL +DEFAULT +8 bl4 + +[0-9]+: 0+90 +0 +TLS +LOCAL +DEFAULT +8 bl5 + +[0-9]+: 0+94 +0 +TLS +LOCAL +DEFAULT +8 bl6 + +[0-9]+: 0+98 +0 +TLS +LOCAL +DEFAULT +8 bl7 + +[0-9]+: 0+9c +0 +TLS +LOCAL +DEFAULT +8 bl8 + +[0-9]+: 0+a0 +0 +TLS +LOCAL +DEFAULT +7 _TLS_MODULE_BASE_ + +[0-9]+: 0+100303d0 +0 +OBJECT +LOCAL +DEFAULT +9 _DYNAMIC + +[0-9]+: 0+100304f0 +0 +OBJECT +LOCAL +DEFAULT +11 _GLOBAL_OFFSET_TABLE_ + +[0-9]+: 0+1c +0 +TLS +GLOBAL +DEFAULT +7 sg8 + +[0-9]+: 0+7c +0 +TLS +GLOBAL +DEFAULT +8 bg8 + +[0-9]+: 0+74 +0 +TLS +GLOBAL +DEFAULT +8 bg6 + +[0-9]+: 0+ +0 +TLS +GLOBAL +DEFAULT +UND sG5 + +[0-9]+: 0+68 +0 +TLS +GLOBAL +DEFAULT +8 bg3 + +[0-9]+: 0+8 +0 +TLS +GLOBAL +DEFAULT +7 sg3 + +[0-9]+: 0+48 +0 +TLS +GLOBAL +HIDDEN +7 sh3 + +[0-9]+: 0+ +0 +TLS +GLOBAL +DEFAULT +UND sG2 + +[0-9]+: 0+c +0 +TLS +GLOBAL +DEFAULT +7 sg4 + +[0-9]+: 0+10 +0 +TLS +GLOBAL +DEFAULT +7 sg5 + +[0-9]+: 0+70 +0 +TLS +GLOBAL +DEFAULT +8 bg5 + +[0-9]+: 0+58 +0 +TLS +GLOBAL +HIDDEN +7 sh7 + +[0-9]+: 0+5c +0 +TLS +GLOBAL +HIDDEN +7 sh8 + +[0-9]+: 0+ +0 +TLS +GLOBAL +DEFAULT +7 sg1 + +[0-9]+: 0+20108 +0 +FUNC +GLOBAL +DEFAULT +1 _start + +[0-9]+: 0+4c +0 +TLS +GLOBAL +HIDDEN +7 sh4 + +[0-9]+: 0+78 +0 +TLS +GLOBAL +DEFAULT +8 bg7 + +[0-9]+: 0+50 +0 +TLS +GLOBAL +HIDDEN +7 sh5 + +[0-9]+: [0-9a-f]+ +0 +NOTYPE +GLOBAL +DEFAULT +ABS __bss_start + +[0-9]+: 0+ +0 +TLS +GLOBAL +DEFAULT +UND sG6 + +[0-9]+: 0+20000 +0 +FUNC +GLOBAL +DEFAULT +1 fn2 + +[0-9]+: 0+4 +0 +TLS +GLOBAL +DEFAULT +7 sg2 + +[0-9]+: 0+ +0 +TLS +GLOBAL +DEFAULT +UND sG1 + +[0-9]+: 0+40 +0 +TLS +GLOBAL +HIDDEN +7 sh1 + +[0-9]+: 0+14 +0 +TLS +GLOBAL +DEFAULT +7 sg6 + +[0-9]+: 0+18 +0 +TLS +GLOBAL +DEFAULT +7 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+44 +0 +TLS +GLOBAL +HIDDEN +7 sh2 + +[0-9]+: 0+54 +0 +TLS +GLOBAL +HIDDEN +7 sh6 + +[0-9]+: 0+64 +0 +TLS +GLOBAL +DEFAULT +8 bg2 + +[0-9]+: 0+60 +0 +TLS +GLOBAL +DEFAULT +8 bg1 + +[0-9]+: 0+6c +0 +TLS +GLOBAL +DEFAULT +8 bg4 diff --git a/ld/testsuite/ld-x86-64/tlsbindesc.dd b/ld/testsuite/ld-x86-64/tlsbindesc.dd index 03f0169abf..166ec94840 100644 --- a/ld/testsuite/ld-x86-64/tlsbindesc.dd +++ b/ld/testsuite/ld-x86-64/tlsbindesc.dd @@ -14,289 +14,289 @@ # 0x60 -0x40 bg1..bg8 # 0x80 -0x20 bl1..bl8 -.*: +file format elf64-x86-64 +.*: +file format elf64-x86-64.* Disassembly of section .text: -0+401000 <fn2>: - [0-9a-f]+: 55[ ]+push %rbp - [0-9a-f]+: 48 89 e5[ ]+mov %rsp,%rbp +[0-9a-f]+ <fn2>: + +[0-9a-f]+: 55[ ]+push %rbp + +[0-9a-f]+: 48 89 e5[ ]+mov %rsp,%rbp # GD -> IE because variable is not defined in executable - [0-9a-f]+: 48 8b 05 6d 03 20 00[ ]+mov 0x20036d\(%rip\),%rax +# 601378 <.*> + +[0-9a-f]+: 48 8b 05 ([0-9a-f]{2} ){4}[ ]+mov 0x[0-9a-f]+\(%rip\),%rax +# [0-9a-f]+ <_DYNAMIC\+0x118> # -> R_X86_64_TPOFF64 sG1 - [0-9a-f]+: 66 90[ ]+xchg %ax,%ax - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 66 90[ ]+xchg %ax,%ax + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * # GD -> IE because variable is not defined in executable where # the variable is referenced through IE too - [0-9a-f]+: 48 8b 05 50 03 20 00[ ]+mov 0x200350\(%rip\),%rax +# 601368 <.*> + +[0-9a-f]+: 48 8b 05 ([0-9a-f]{2} ){4}[ ]+mov 0x[0-9a-f]+\(%rip\),%rax +# [0-9a-f]+ <_DYNAMIC\+0x108> # -> R_X86_64_TPOFF64 sG2 - [0-9a-f]+: 66 90[ ]+xchg %ax,%ax - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 66 90[ ]+xchg %ax,%ax + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * # GD -> LE with global variable defined in executable - [0-9a-f]+: 48 c7 c0 60 ff ff ff[ ]+mov \$0xf+60,%rax + +[0-9a-f]+: 48 c7 c0 60 ff ff ff[ ]+mov \$0xf+60,%rax # sg1 - [0-9a-f]+: 66 90[ ]+xchg %ax,%ax - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 66 90[ ]+xchg %ax,%ax + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * # GD -> LE with local variable defined in executable - [0-9a-f]+: 48 c7 c0 80 ff ff ff[ ]+mov \$0xf+80,%rax + +[0-9a-f]+: 48 c7 c0 80 ff ff ff[ ]+mov \$0xf+80,%rax # sl1 - [0-9a-f]+: 66 90[ ]+xchg %ax,%ax - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 66 90[ ]+xchg %ax,%ax + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * # GD -> LE with hidden variable defined in executable - [0-9a-f]+: 48 c7 c0 a0 ff ff ff[ ]+mov \$0xf+a0,%rax + +[0-9a-f]+: 48 c7 c0 a0 ff ff ff[ ]+mov \$0xf+a0,%rax # sh1 - [0-9a-f]+: 66 90[ ]+xchg %ax,%ax - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 66 90[ ]+xchg %ax,%ax + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * # LD -> LE - [0-9a-f]+: 48 c7 c0 00 00 00 00[ ]+mov \$0x0,%rax - [0-9a-f]+: 66 90[ ]+xchg %ax,%ax - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 48 8d 90 81 ff ff ff[ ]+lea -0x7f\(%rax\),%rdx + +[0-9a-f]+: 48 c7 c0 00 00 00 00[ ]+mov \$0x0,%rax + +[0-9a-f]+: 66 90[ ]+xchg %ax,%ax + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 48 8d 90 81 ff ff ff[ ]+lea -0x7f\(%rax\),%rdx # sl1+1 - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 4c 8d 88 86 ff ff ff[ ]+lea -0x7a\(%rax\),%r9 + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 4c 8d 88 86 ff ff ff[ ]+lea -0x7a\(%rax\),%r9 # sl2+2 - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * # LD -> LE against hidden variables - [0-9a-f]+: 48 8d 90 a0 ff ff ff[ ]+lea -0x60\(%rax\),%rdx + +[0-9a-f]+: 48 8d 90 a0 ff ff ff[ ]+lea -0x60\(%rax\),%rdx # sh1 - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 48 8d 88 a7 ff ff ff[ ]+lea -0x59\(%rax\),%rcx + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 48 8d 88 a7 ff ff ff[ ]+lea -0x59\(%rax\),%rcx # sh2+3 - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * # IE against global var - [0-9a-f]+: 64 4c 8b 0c 25 00 00[ ]+mov %fs:0x0,%r9 - [0-9a-f]+: 00 00 * - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 4c 03 0d de 02 20 00[ ]+add 0x2002de\(%rip\),%r9 +# 601368 <.*> + +[0-9a-f]+: 64 4c 8b 0c 25 00 00[ ]+mov %fs:0x0,%r9 + +[0-9a-f]+: 00 00 * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 4c 03 0d ([0-9a-f]{2} ){4}[ ]+add 0x[0-9a-f]+\(%rip\),%r9 +# [0-9a-f]+ <_DYNAMIC\+0x108> # -> R_X86_64_TPOFF64 sG2 - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * # IE -> LE against global var defined in exec - [0-9a-f]+: 64 4c 8b 14 25 00 00[ ]+mov %fs:0x0,%r10 - [0-9a-f]+: 00 00 * - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 4d 8d 92 60 ff ff ff[ ]+lea -0xa0\(%r10\),%r10 + +[0-9a-f]+: 64 4c 8b 14 25 00 00[ ]+mov %fs:0x0,%r10 + +[0-9a-f]+: 00 00 * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 4d 8d 92 60 ff ff ff[ ]+lea -0xa0\(%r10\),%r10 # sg1 - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * # IE -> LE against local var - [0-9a-f]+: 64 48 8b 04 25 00 00[ ]+mov %fs:0x0,%rax - [0-9a-f]+: 00 00 * - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 48 8d 80 80 ff ff ff[ ]+lea -0x80\(%rax\),%rax + +[0-9a-f]+: 64 48 8b 04 25 00 00[ ]+mov %fs:0x0,%rax + +[0-9a-f]+: 00 00 * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 48 8d 80 80 ff ff ff[ ]+lea -0x80\(%rax\),%rax # sl1 - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * # IE -> LE against hidden var - [0-9a-f]+: 64 48 8b 0c 25 00 00[ ]+mov %fs:0x0,%rcx - [0-9a-f]+: 00 00 * - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 48 8d 89 a0 ff ff ff[ ]+lea -0x60\(%rcx\),%rcx + +[0-9a-f]+: 64 48 8b 0c 25 00 00[ ]+mov %fs:0x0,%rcx + +[0-9a-f]+: 00 00 * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 48 8d 89 a0 ff ff ff[ ]+lea -0x60\(%rcx\),%rcx # sh1 - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * # Direct access through %fs # IE against global var - [0-9a-f]+: 48 8b 0d 89 02 20 00[ ]+mov 0x200289\(%rip\),%rcx +# 601360 <.*> + +[0-9a-f]+: 48 8b 0d ([0-9a-f]{2} ){4}[ ]+mov 0x[0-9a-f]+\(%rip\),%rcx +# [0-9a-f]+ <_DYNAMIC\+0x100> # -> R_X86_64_TPOFF64 sG5 - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 64 48 8b 11[ ]+mov %fs:\(%rcx\),%rdx - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 64 48 8b 11[ ]+mov %fs:\(%rcx\),%rdx + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * # IE->LE against local var - [0-9a-f]+: 49 c7 c3 90 ff ff ff[ ]+mov \$0xf+90,%r11 + +[0-9a-f]+: 49 c7 c3 90 ff ff ff[ ]+mov \$0xf+90,%r11 # sl5 - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 64 4d 8b 23[ ]+mov %fs:\(%r11\),%r12 - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 64 4d 8b 23[ ]+mov %fs:\(%r11\),%r12 + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * # IE->LE against hidden var - [0-9a-f]+: 48 c7 c2 b0 ff ff ff[ ]+mov \$0xf+b0,%rdx - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 64 48 8b 12[ ]+mov %fs:\(%rdx\),%rdx + +[0-9a-f]+: 48 c7 c2 b0 ff ff ff[ ]+mov \$0xf+b0,%rdx + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 64 48 8b 12[ ]+mov %fs:\(%rdx\),%rdx # sh5 - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: c9[ ]+leaveq * - [0-9a-f]+: c3[ ]+retq * - [0-9a-f]+: 0f 1f 00[ ]+nopl \(%rax\) + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: c9[ ]+leaveq * + +[0-9a-f]+: c3[ ]+retq * + +[0-9a-f]+: 0f 1f 00[ ]+nopl \(%rax\) [0-9a-f]+ <_start>: - [0-9a-f]+: 55[ ]+push %rbp - [0-9a-f]+: 48 89 e5[ ]+mov %rsp,%rbp + +[0-9a-f]+: 55[ ]+push %rbp + +[0-9a-f]+: 48 89 e5[ ]+mov %rsp,%rbp # IE against global var - [0-9a-f]+: 64 4c 8b 1c 25 00 00[ ]+mov %fs:0x0,%r11 - [0-9a-f]+: 00 00 * - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 4c 03 1d 52 02 20 00[ ]+add 0x200252\(%rip\),%r11 +# 601370 <.*> + +[0-9a-f]+: 64 4c 8b 1c 25 00 00[ ]+mov %fs:0x0,%r11 + +[0-9a-f]+: 00 00 * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 4c 03 1d ([0-9a-f]{2} ){4}[ ]+add 0x[0-9a-f]+\(%rip\),%r11 +# [0-9a-f]+ <_DYNAMIC\+0x110> # -> R_X86_64_TPOFF64 sG6 - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * # IE -> LE against global var defined in exec - [0-9a-f]+: 64 48 8b 14 25 00 00[ ]+mov %fs:0x0,%rdx - [0-9a-f]+: 00 00 * - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 48 8d 92 d4 ff ff ff[ ]+lea -0x2c\(%rdx\),%rdx + +[0-9a-f]+: 64 48 8b 14 25 00 00[ ]+mov %fs:0x0,%rdx + +[0-9a-f]+: 00 00 * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 48 8d 92 d4 ff ff ff[ ]+lea -0x2c\(%rdx\),%rdx # bg6 - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * # IE -> LE against local var - [0-9a-f]+: 64 4c 8b 24 25 00 00[ ]+mov %fs:0x0,%r12 - [0-9a-f]+: 00 00 * - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 49 81 c4 f4 ff ff ff[ ]+add \$0xf+f4,%r12 + +[0-9a-f]+: 64 4c 8b 24 25 00 00[ ]+mov %fs:0x0,%r12 + +[0-9a-f]+: 00 00 * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 49 81 c4 f4 ff ff ff[ ]+add \$0xf+f4,%r12 # bl6 - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * # direct %fs access IE -> LE against local var - [0-9a-f]+: 48 c7 c2 fc ff ff ff[ ]+mov \$0xf+fc,%rdx + +[0-9a-f]+: 48 c7 c2 fc ff ff ff[ ]+mov \$0xf+fc,%rdx # bl8 - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 64 48 8b 02[ ]+mov %fs:\(%rdx\),%rax - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 64 48 8b 02[ ]+mov %fs:\(%rdx\),%rax + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * # IE -> LE against hidden but not local var - [0-9a-f]+: 64 48 8b 14 25 00 00[ ]+mov %fs:0x0,%rdx - [0-9a-f]+: 00 00 * - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 48 8d 92 b4 ff ff ff[ ]+lea -0x4c\(%rdx\),%rdx + +[0-9a-f]+: 64 48 8b 14 25 00 00[ ]+mov %fs:0x0,%rdx + +[0-9a-f]+: 00 00 * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 48 8d 92 b4 ff ff ff[ ]+lea -0x4c\(%rdx\),%rdx # sh6 - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * # direct %fs access IE -> LE against hidden but not local var - [0-9a-f]+: 48 c7 c2 bc ff ff ff[ ]+mov \$0xf+bc,%rdx + +[0-9a-f]+: 48 c7 c2 bc ff ff ff[ ]+mov \$0xf+bc,%rdx # sh8 - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 64 48 8b 02[ ]+mov %fs:\(%rdx\),%rax - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 64 48 8b 02[ ]+mov %fs:\(%rdx\),%rax + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * # LE, global var defined in exec - [0-9a-f]+: 64 48 8b 04 25 00 00[ ]+mov %fs:0x0,%rax - [0-9a-f]+: 00 00 * - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 48 8d 90 64 ff ff ff[ ]+lea -0x9c\(%rax\),%rdx + +[0-9a-f]+: 64 48 8b 04 25 00 00[ ]+mov %fs:0x0,%rax + +[0-9a-f]+: 00 00 * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 48 8d 90 64 ff ff ff[ ]+lea -0x9c\(%rax\),%rdx # sg2 - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * # LE, local var, non-canonical sequence - [0-9a-f]+: 49 c7 c1 e6 ff ff ff[ ]+mov \$0xf+e6,%r9 + +[0-9a-f]+: 49 c7 c1 e6 ff ff ff[ ]+mov \$0xf+e6,%r9 # bl2+2 - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 64 48 8b 14 25 00 00[ ]+mov %fs:0x0,%rdx - [0-9a-f]+: 00 00 * - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 4c 01 ca[ ]+add %r9,%rdx - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 64 48 8b 14 25 00 00[ ]+mov %fs:0x0,%rdx + +[0-9a-f]+: 00 00 * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 4c 01 ca[ ]+add %r9,%rdx + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * # LE, hidden var defined in exec, non-canonical sequence - [0-9a-f]+: 64 48 8b 14 25 00 00[ ]+mov %fs:0x0,%rdx - [0-9a-f]+: 00 00 * - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 48 81 c2 a5 ff ff ff[ ]+add \$0xf+a5,%rdx + +[0-9a-f]+: 64 48 8b 14 25 00 00[ ]+mov %fs:0x0,%rdx + +[0-9a-f]+: 00 00 * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 48 81 c2 a5 ff ff ff[ ]+add \$0xf+a5,%rdx # sh2+1 - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * # Direct %fs access # LE, global var defined in exec - [0-9a-f]+: 64 48 8b 04 25 68 ff[ ]+mov %fs:0xf+68,%rax - [0-9a-f]+: ff ff * + +[0-9a-f]+: 64 48 8b 04 25 68 ff[ ]+mov %fs:0xf+68,%rax + +[0-9a-f]+: ff ff * # sg3 - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * # LE, local var - [0-9a-f]+: 64 4c 8b 14 25 eb ff[ ]+mov %fs:0xf+eb,%r10 - [0-9a-f]+: ff ff * + +[0-9a-f]+: 64 4c 8b 14 25 eb ff[ ]+mov %fs:0xf+eb,%r10 + +[0-9a-f]+: ff ff * # bl3+3 - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * # LE, hidden var defined in exec - [0-9a-f]+: 64 48 8b 14 25 a9 ff[ ]+mov %fs:0xf+a9,%rdx - [0-9a-f]+: ff ff * + +[0-9a-f]+: 64 48 8b 14 25 a9 ff[ ]+mov %fs:0xf+a9,%rdx + +[0-9a-f]+: ff ff * # sh3+1 - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * - [0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * + +[0-9a-f]+: 90[ ]+nop * # LE, large model - [0-9a-f]+: 48 ba a5 ff ff ff ff[ ]+movabs \$0xffffffffffffffa5,%rdx - [0-9a-f]+: ff ff ff * - [0-9a-f]+: c9[ ]+leaveq * - [0-9a-f]+: c3[ ]+retq * + +[0-9a-f]+: 48 ba a5 ff ff ff ff[ ]+movabs \$0xffffffffffffffa5,%rdx + +[0-9a-f]+: ff ff ff * + +[0-9a-f]+: c9[ ]+leaveq * + +[0-9a-f]+: c3[ ]+retq * diff --git a/ld/testsuite/ld-x86-64/tlsbindesc.sd b/ld/testsuite/ld-x86-64/tlsbindesc.sd index dbea32d44b..50e6fa5fe6 100644 --- a/ld/testsuite/ld-x86-64/tlsbindesc.sd +++ b/ld/testsuite/ld-x86-64/tlsbindesc.sd @@ -5,8 +5,8 @@ #objdump: -sj.got #target: x86_64-*-* -.*: +file format elf64-x86-64 +.*: +file format elf64-x86-64.* Contents of section .got: - 601360 00000000 00000000 00000000 00000000 .* - 601370 00000000 00000000 00000000 00000000 .* + [0-9a-f]+ 00000000 00000000 00000000 00000000 .* + [0-9a-f]+ 00000000 00000000 00000000 00000000 .* diff --git a/ld/testsuite/ld-x86-64/tlsbindesc.td b/ld/testsuite/ld-x86-64/tlsbindesc.td index 1dc6c28abb..54ec0e3467 100644 --- a/ld/testsuite/ld-x86-64/tlsbindesc.td +++ b/ld/testsuite/ld-x86-64/tlsbindesc.td @@ -5,12 +5,12 @@ #objdump: -sj.tdata #target: x86_64-*-* -.*: +file format elf64-x86-64 +.*: +file format elf64-x86-64.* Contents of section .tdata: - 601200 11000000 12000000 13000000 14000000 .* - 601210 15000000 16000000 17000000 18000000 .* - 601220 41000000 42000000 43000000 44000000 .* - 601230 45000000 46000000 47000000 48000000 .* - 601240 01010000 02010000 03010000 04010000 .* - 601250 05010000 06010000 07010000 08010000 .* + [0-9a-f]+ 11000000 12000000 13000000 14000000 .* + [0-9a-f]+ 15000000 16000000 17000000 18000000 .* + [0-9a-f]+ 41000000 42000000 43000000 44000000 .* + [0-9a-f]+ 45000000 46000000 47000000 48000000 .* + [0-9a-f]+ 01010000 02010000 03010000 04010000 .* + [0-9a-f]+ 05010000 06010000 07010000 08010000 .* diff --git a/ld/testsuite/ld-x86-64/tlsdesc-nacl.pd b/ld/testsuite/ld-x86-64/tlsdesc-nacl.pd new file mode 100644 index 0000000000..066d760f96 --- /dev/null +++ b/ld/testsuite/ld-x86-64/tlsdesc-nacl.pd @@ -0,0 +1,40 @@ +#source: tlsdesc.s +#source: tlspic2.s +#as: --64 +#ld: -shared -melf_x86_64_nacl --no-ld-generated-unwind-info +#objdump: -drj.plt +#target: x86_64-*-nacl* + +.*: +file format elf64-x86-64-nacl + +Disassembly of section .plt: + +[0-9a-f]+ <.*@plt-0x40>: + +[0-9a-f]+: ff 35 .. .. .. .. pushq 0x[0-9a-f]+\(%rip\) +# [0-9a-f]+ <_GLOBAL_OFFSET_TABLE_\+0x8> + +[0-9a-f]+: 4c 8b 1d .. .. .. .. mov 0x[0-9a-f]+\(%rip\),%r11 +# [0-9a-f]+ <_GLOBAL_OFFSET_TABLE_\+0x10> + +[0-9a-f]+: 41 83 e3 e0 and \$0xffffffe0,%r11d + +[0-9a-f]+: 4d 01 fb add %r15,%r11 + +[0-9a-f]+: 41 ff e3 jmpq \*%r11 + +[0-9a-f]+: 66 66 66 66 66 66 2e data32 data32 data32 data32 data32 nopw %cs:0x0\(%rax,%rax,1\) + +[0-9a-f]+: 0f 1f 84 00 00 00 00 * + +[0-9a-f]+: 00 * + +[0-9a-f]+: 66 66 66 66 66 66 2e data32 data32 data32 data32 data32 nopw %cs:0x0\(%rax,%rax,1\) + +[0-9a-f]+: 0f 1f 84 00 00 00 00 * + +[0-9a-f]+: 00 * + +[0-9a-f]+: 66 66 2e 0f 1f 84 00 data32 nopw %cs:0x0\(%rax,%rax,1\) + +[0-9a-f]+: 00 00 00 00 * + +[0-9a-f]+ <.*@plt>: + +[0-9a-f]+: ff 35 .. .. .. .. pushq 0x[0-9a-f]+\(%rip\) +# [0-9a-f]+ <_GLOBAL_OFFSET_TABLE_\+0x8> + +[0-9a-f]+: 4c 8b 1d .. .. .. .. mov 0x[0-9a-f]+\(%rip\),%r11 +# [0-9a-f]+ <_DYNAMIC\+0x190> + +[0-9a-f]+: 41 83 e3 e0 and \$0xffffffe0,%r11d + +[0-9a-f]+: 4d 01 fb add %r15,%r11 + +[0-9a-f]+: 41 ff e3 jmpq \*%r11 + +[0-9a-f]+: 66 66 66 66 66 66 2e data32 data32 data32 data32 data32 nopw %cs:0x0\(%rax,%rax,1\) + +[0-9a-f]+: 0f 1f 84 00 00 00 00 * + +[0-9a-f]+: 00 * + +[0-9a-f]+: 66 66 66 66 66 66 2e data32 data32 data32 data32 data32 nopw %cs:0x0\(%rax,%rax,1\) + +[0-9a-f]+: 0f 1f 84 00 00 00 00 * + +[0-9a-f]+: 00 * + +[0-9a-f]+: 66 66 2e 0f 1f 84 00 data32 nopw %cs:0x0\(%rax,%rax,1\) + +[0-9a-f]+: 00 00 00 00 * diff --git a/ld/testsuite/ld-x86-64/tlsdesc-nacl.rd b/ld/testsuite/ld-x86-64/tlsdesc-nacl.rd new file mode 100644 index 0000000000..3a3c6007f1 --- /dev/null +++ b/ld/testsuite/ld-x86-64/tlsdesc-nacl.rd @@ -0,0 +1,162 @@ +#source: tlsdesc.s +#source: tlspic2.s +#as: --64 +#ld: -shared -melf_x86_64_nacl --no-ld-generated-unwind-info +#readelf: -WSsrld +#target: x86_64-*-nacl* + +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]+\] .plt +PROGBITS +0+ [0-9a-f]+ +0+80 +40 +AX +0 +0 +32 + +\[[ 0-9]+\] .text +PROGBITS +0+1000 [0-9a-f]+ +0+154 00 +AX +0 +0 4096 + +\[[ 0-9]+\] .hash +.* + +\[[ 0-9]+\] .dynsym +.* + +\[[ 0-9]+\] .dynstr +.* + +\[[ 0-9]+\] .rela.dyn +.* + +\[[ 0-9]+\] .rela.plt +.* + +\[[ 0-9]+\] .tdata +PROGBITS +0+10010488 [0-9a-f]+ +0+60 00 WAT +0 +0 +1 + +\[[ 0-9]+\] .tbss +NOBITS +0+100104e8 [0-9a-f]+ 0+20 00 WAT +0 +0 +1 + +\[[ 0-9]+\] .dynamic +DYNAMIC +0+100104e8 [0-9a-f]+ 0+150 10 +WA +5 +0 +8 + +\[[ 0-9]+\] .got +PROGBITS +0+10010638 [0-9a-f]+ 0+48 08 +WA +0 +0 +8 + +\[[ 0-9]+\] .got.plt +PROGBITS +0+10010680 [0-9a-f]+ 0+68 08 +WA +0 +0 +8 + +\[[ 0-9]+\] .shstrtab +.* + +\[[ 0-9]+\] .symtab +.* + +\[[ 0-9]+\] .strtab +.* +Key to Flags: +.* +.* +.* + +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 +0x[0-9a-f]+ 0x0+ 0x0+ 0x[0-9a-f]+ 0x[0-9a-f]+ R E 0x10000 + +LOAD +0x[0-9a-f]+ 0x0+10000000 0x0+10000000 0x[0-9a-f]+ 0x[0-9a-f]+ R +0x10000 + +LOAD +0x[0-9a-f]+ 0x0+10010488 0x0+10010488 0x0+260 0x0+260 RW +0x10000 + +DYNAMIC +0x[0-9a-f]+ 0x0+100104e8 0x0+100104e8 0x0+150 0x0+150 RW +0x8 + +TLS +0x[0-9a-f]+ 0x0+10010488 0x0+10010488 0x0+60 0x0+80 R +0x1 + + Section to Segment mapping: + +Segment Sections... + +00 +.plt .text * + +01 +.hash .dynsym .dynstr .rela.dyn .rela.plt * + +02 +.tdata .dynamic .got .got.plt * + +03 +.dynamic * + +04 +.tdata .tbss * + +Dynamic section at offset 0x[0-9a-f]+ contains 16 entries: + +Tag +Type +Name/Value + 0x[0-9a-f]+ +\(HASH\).* + 0x[0-9a-f]+ +\(STRTAB\).* + 0x[0-9a-f]+ +\(SYMTAB\).* + 0x[0-9a-f]+ +\(STRSZ\).* + 0x[0-9a-f]+ +\(SYMENT\).* + 0x[0-9a-f]+ +\(PLTGOT\).* + 0x[0-9a-f]+ +\(PLTRELSZ\).* + 0x[0-9a-f]+ +\(PLTREL\).* + 0x[0-9a-f]+ +\(JMPREL\).* + 0x[0-9a-f]+ +\(TLSDESC_PLT\) +0x40 + 0x[0-9a-f]+ +\(TLSDESC_GOT\) +0x10010678 + 0x[0-9a-f]+ +\(RELA\).* + 0x[0-9a-f]+ +\(RELASZ\).* + 0x[0-9a-f]+ +\(RELAENT\).* + 0x[0-9a-f]+ +\(FLAGS\).* + 0x[0-9a-f]+ +\(NULL\).* + +Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 8 entries: + +Offset +Info +Type +Symbol's Value +Symbol's Name \+ Addend +0+10010638 +[0-9a-f]+ R_X86_64_TPOFF64 +0+24 +0+10010640 +[0-9a-f]+ R_X86_64_TPOFF64 +0+30 +0+10010648 +[0-9a-f]+ R_X86_64_TPOFF64 +0+64 +0+10010658 +[0-9a-f]+ R_X86_64_TPOFF64 +0+50 +0+10010660 +[0-9a-f]+ R_X86_64_TPOFF64 +0+70 +0+10010670 +[0-9a-f]+ R_X86_64_TPOFF64 +0+44 +0+10010650 +[0-9a-f]+ R_X86_64_TPOFF64 +0+10 sg5 \+ 0 +0+10010668 +[0-9a-f]+ R_X86_64_TPOFF64 +0+4 sg2 \+ 0 + +Relocation section '.rela.plt' at offset 0x[0-9a-f]+ contains 5 entries: + +Offset +Info +Type +Symbol's Value +Symbol's Name \+ Addend +0+100106c8 +[0-9a-f]+ R_X86_64_TLSDESC +0+ sg1 \+ 0 +0+10010698 +[0-9a-f]+ R_X86_64_TLSDESC +0+20 +0+100106d8 +[0-9a-f]+ R_X86_64_TLSDESC +0+40 +0+100106a8 +[0-9a-f]+ R_X86_64_TLSDESC +0+60 +0+100106b8 +[0-9a-f]+ R_X86_64_TLSDESC +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-9a-f]+ +0 +SECTION +LOCAL +DEFAULT +2 * + +[0-9]+: [0-9a-f]+ +0 +SECTION +LOCAL +DEFAULT +8 * + +[0-9]+: 0+1c +0 +TLS +GLOBAL +DEFAULT +8 sg8 + +[0-9]+: 0+8 +0 +TLS +GLOBAL +DEFAULT +8 sg3 + +[0-9]+: 0+c +0 +TLS +GLOBAL +DEFAULT +8 sg4 + +[0-9]+: 0+10 +0 +TLS +GLOBAL +DEFAULT +8 sg5 + +[0-9]+: 0+ +0 +TLS +GLOBAL +DEFAULT +8 sg1 + +[0-9]+: 0+1000 +0 +FUNC +GLOBAL +DEFAULT +2 fn1 + +[0-9]+: [0-9a-f]+ +0 +NOTYPE +GLOBAL +DEFAULT +ABS __bss_start + +[0-9]+: 0+4 +0 +TLS +GLOBAL +DEFAULT +8 sg2 + +[0-9]+: 0+14 +0 +TLS +GLOBAL +DEFAULT +8 sg6 + +[0-9]+: 0+18 +0 +TLS +GLOBAL +DEFAULT +8 sg7 + +[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+20 +0 +TLS +LOCAL +DEFAULT +8 sl1 + +[0-9]+: 0+24 +0 +TLS +LOCAL +DEFAULT +8 sl2 + +[0-9]+: 0+28 +0 +TLS +LOCAL +DEFAULT +8 sl3 + +[0-9]+: 0+2c +0 +TLS +LOCAL +DEFAULT +8 sl4 + +[0-9]+: 0+30 +0 +TLS +LOCAL +DEFAULT +8 sl5 + +[0-9]+: 0+34 +0 +TLS +LOCAL +DEFAULT +8 sl6 + +[0-9]+: 0+38 +0 +TLS +LOCAL +DEFAULT +8 sl7 + +[0-9]+: 0+3c +0 +TLS +LOCAL +DEFAULT +8 sl8 + +[0-9]+: 0+60 +0 +TLS +LOCAL +DEFAULT +9 sH1 + +[0-9]+: 0+ +0 +TLS +LOCAL +DEFAULT +8 _TLS_MODULE_BASE_ + +[0-9]+: 0+100104e8 +0 +OBJECT +LOCAL +DEFAULT +ABS _DYNAMIC + +[0-9]+: 0+48 +0 +TLS +LOCAL +DEFAULT +8 sh3 + +[0-9]+: 0+64 +0 +TLS +LOCAL +DEFAULT +9 sH2 + +[0-9]+: 0+78 +0 +TLS +LOCAL +DEFAULT +9 sH7 + +[0-9]+: 0+58 +0 +TLS +LOCAL +DEFAULT +8 sh7 + +[0-9]+: 0+5c +0 +TLS +LOCAL +DEFAULT +8 sh8 + +[0-9]+: 0+6c +0 +TLS +LOCAL +DEFAULT +9 sH4 + +[0-9]+: 0+4c +0 +TLS +LOCAL +DEFAULT +8 sh4 + +[0-9]+: 0+68 +0 +TLS +LOCAL +DEFAULT +9 sH3 + +[0-9]+: 0+50 +0 +TLS +LOCAL +DEFAULT +8 sh5 + +[0-9]+: 0+70 +0 +TLS +LOCAL +DEFAULT +9 sH5 + +[0-9]+: 0+74 +0 +TLS +LOCAL +DEFAULT +9 sH6 + +[0-9]+: 0+7c +0 +TLS +LOCAL +DEFAULT +9 sH8 + +[0-9]+: 0+40 +0 +TLS +LOCAL +DEFAULT +8 sh1 + +[0-9]+: 0+10010680 +0 +OBJECT +LOCAL +DEFAULT +ABS _GLOBAL_OFFSET_TABLE_ + +[0-9]+: 0+44 +0 +TLS +LOCAL +DEFAULT +8 sh2 + +[0-9]+: 0+54 +0 +TLS +LOCAL +DEFAULT +8 sh6 + +[0-9]+: 0+1c +0 +TLS +GLOBAL +DEFAULT +8 sg8 + +[0-9]+: 0+8 +0 +TLS +GLOBAL +DEFAULT +8 sg3 + +[0-9]+: 0+c +0 +TLS +GLOBAL +DEFAULT +8 sg4 + +[0-9]+: 0+10 +0 +TLS +GLOBAL +DEFAULT +8 sg5 + +[0-9]+: 0+ +0 +TLS +GLOBAL +DEFAULT +8 sg1 + +[0-9]+: 0+1000 +0 +FUNC +GLOBAL +DEFAULT +2 fn1 + +[0-9]+: [0-9a-f]+ +0 +NOTYPE +GLOBAL +DEFAULT +ABS __bss_start + +[0-9]+: 0+4 +0 +TLS +GLOBAL +DEFAULT +8 sg2 + +[0-9]+: 0+14 +0 +TLS +GLOBAL +DEFAULT +8 sg6 + +[0-9]+: 0+18 +0 +TLS +GLOBAL +DEFAULT +8 sg7 + +[0-9]+: [0-9a-f]+ +0 +NOTYPE +GLOBAL +DEFAULT +ABS _edata + +[0-9]+: [0-9a-f]+ +0 +NOTYPE +GLOBAL +DEFAULT +ABS _end diff --git a/ld/testsuite/ld-x86-64/tlsdesc.dd b/ld/testsuite/ld-x86-64/tlsdesc.dd index 2507e42294..9f3fcbe78a 100644 --- a/ld/testsuite/ld-x86-64/tlsdesc.dd +++ b/ld/testsuite/ld-x86-64/tlsdesc.dd @@ -5,7 +5,7 @@ #objdump: -drj.text #target: x86_64-*-* -.*: +file format elf64-x86-64 +.*: +file format elf64-x86-64.* Disassembly of section .text: @@ -17,7 +17,7 @@ Disassembly of section .text: +[0-9a-f]+: 90[ ]+nop * +[0-9a-f]+: 90[ ]+nop * # GD - +[0-9a-f]+: 48 8d 05 89 03 20 00[ ]+lea 0x200389\(%rip\),%rax +# 201398 <.*> + +[0-9a-f]+: 48 8d 05 ([0-9a-f]{2} ){4}[ ]+lea 0x[0-9a-f]+\(%rip\),%rax +# [0-9a-f]+ <_GLOBAL_OFFSET_TABLE_\+0x48> # -> R_X86_64_TLSDESC sg1 +[0-9a-f]+: ff 10[ ]+callq \*\(%rax\) +[0-9a-f]+: 90[ ]+nop * @@ -25,7 +25,7 @@ Disassembly of section .text: +[0-9a-f]+: 90[ ]+nop * +[0-9a-f]+: 90[ ]+nop * # GD -> IE because variable is referenced through IE too - +[0-9a-f]+: 48 8b 05 1c 03 20 00[ ]+mov 0x20031c\(%rip\),%rax +# 201338 <.*> + +[0-9a-f]+: 48 8b 05 ([0-9a-f]{2} ){4}[ ]+mov 0x[0-9a-f]+\(%rip\),%rax +# [0-9a-f]+ <_DYNAMIC\+0x180> # -> R_X86_64_TPOFF64 sg2 +[0-9a-f]+: 66 90[ ]+xchg %ax,%ax +[0-9a-f]+: 90[ ]+nop * @@ -33,7 +33,7 @@ Disassembly of section .text: +[0-9a-f]+: 90[ ]+nop * +[0-9a-f]+: 90[ ]+nop * # GD against local variable - +[0-9a-f]+: 48 8d 05 3f 03 20 00[ ]+lea 0x20033f\(%rip\),%rax +# 201368 <.*> + +[0-9a-f]+: 48 8d 05 ([0-9a-f]{2} ){4}[ ]+lea 0x[0-9a-f]+\(%rip\),%rax +# [0-9a-f]+ <_GLOBAL_OFFSET_TABLE_\+0x18> # -> R_X86_64_TLSDESC [0 0x2000000000000000] +[0-9a-f]+: ff 10[ ]+callq \*\(%rax\) +[0-9a-f]+: 90[ ]+nop * @@ -41,7 +41,7 @@ Disassembly of section .text: +[0-9a-f]+: 90[ ]+nop * +[0-9a-f]+: 90[ ]+nop * # GD -> IE against local variable referenced through IE too - +[0-9a-f]+: 48 8b 05 d2 02 20 00[ ]+mov 0x2002d2\(%rip\),%rax +# 201308 <.*> + +[0-9a-f]+: 48 8b 05 ([0-9a-f]{2} ){4}[ ]+mov 0x[0-9a-f]+\(%rip\),%rax +# [0-9a-f]+ <_DYNAMIC\+0x150> # -> R_X86_64_TPOFF64 *ABS*+0x24 +[0-9a-f]+: 66 90[ ]+xchg %ax,%ax +[0-9a-f]+: 90[ ]+nop * @@ -49,7 +49,7 @@ Disassembly of section .text: +[0-9a-f]+: 90[ ]+nop * +[0-9a-f]+: 90[ ]+nop * # GD against hidden and local variable - +[0-9a-f]+: 48 8d 05 65 03 20 00[ ]+lea 0x200365\(%rip\),%rax +# 2013a8 <.*> + +[0-9a-f]+: 48 8d 05 ([0-9a-f]{2} ){4}[ ]+lea 0x[0-9a-f]+\(%rip\),%rax +# [0-9a-f]+ <_GLOBAL_OFFSET_TABLE_\+0x58> # -> R_X86_64_TLSDESC [0 0x4000000000000000] +[0-9a-f]+: ff 10[ ]+callq \*\(%rax\) +[0-9a-f]+: 90[ ]+nop * @@ -57,7 +57,7 @@ Disassembly of section .text: +[0-9a-f]+: 90[ ]+nop * +[0-9a-f]+: 90[ ]+nop * # GD -> IE against hidden and local variable referenced through IE too - +[0-9a-f]+: 48 8b 05 f0 02 20 00[ ]+mov 0x2002f0\(%rip\),%rax +# 201340 <.*> + +[0-9a-f]+: 48 8b 05 ([0-9a-f]{2} ){4}[ ]+mov 0x[0-9a-f]+\(%rip\),%rax +# [0-9a-f]+ <_DYNAMIC\+0x188> # -> R_X86_64_TPOFF64 *ABS*+0x44 +[0-9a-f]+: 66 90[ ]+xchg %ax,%ax +[0-9a-f]+: 90[ ]+nop * @@ -65,7 +65,7 @@ Disassembly of section .text: +[0-9a-f]+: 90[ ]+nop * +[0-9a-f]+: 90[ ]+nop * # GD against hidden but not local variable - +[0-9a-f]+: 48 8d 05 1b 03 20 00[ ]+lea 0x20031b\(%rip\),%rax +# 201378 <.*> + +[0-9a-f]+: 48 8d 05 ([0-9a-f]{2} ){4}[ ]+lea 0x[0-9a-f]+\(%rip\),%rax +# [0-9a-f]+ <_GLOBAL_OFFSET_TABLE_\+0x28> # -> R_X86_64_TLSDESC [0 0x6000000000000000] +[0-9a-f]+: ff 10[ ]+callq \*\(%rax\) +[0-9a-f]+: 90[ ]+nop * @@ -73,7 +73,7 @@ Disassembly of section .text: +[0-9a-f]+: 90[ ]+nop * +[0-9a-f]+: 90[ ]+nop * # GD -> IE against hidden but not local variable referenced through IE too - +[0-9a-f]+: 48 8b 05 ae 02 20 00[ ]+mov 0x2002ae\(%rip\),%rax +# 201318 <.*> + +[0-9a-f]+: 48 8b 05 ([0-9a-f]{2} ){4}[ ]+mov 0x[0-9a-f]+\(%rip\),%rax +# [0-9a-f]+ <_DYNAMIC\+0x160> # -> R_X86_64_TPOFF64 *ABS*+0x64 +[0-9a-f]+: 66 90[ ]+xchg %ax,%ax +[0-9a-f]+: 90[ ]+nop * @@ -81,7 +81,7 @@ Disassembly of section .text: +[0-9a-f]+: 90[ ]+nop * +[0-9a-f]+: 90[ ]+nop * # LD - +[0-9a-f]+: 48 8d 05 11 03 20 00[ ]+lea 0x200311\(%rip\),%rax +# 201388 <.*> + +[0-9a-f]+: 48 8d 05 ([0-9a-f]{2} ){4}[ ]+lea 0x[0-9a-f]+\(%rip\),%rax +# [0-9a-f]+ <_GLOBAL_OFFSET_TABLE_\+0x38> # -> R_X86_64_TLSDESC [0 0x000000000000000] +[0-9a-f]+: ff 10[ ]+callq \*\(%rax\) +[0-9a-f]+: 90[ ]+nop * @@ -115,7 +115,7 @@ Disassembly of section .text: +[0-9a-f]+: 00 00 * +[0-9a-f]+: 90[ ]+nop * +[0-9a-f]+: 90[ ]+nop * - +[0-9a-f]+: 48 03 0d 71 02 20 00[ ]+add 0x200271\(%rip\),%rcx +# 201338 <.*> + +[0-9a-f]+: 48 03 0d ([0-9a-f]{2} ){4}[ ]+add 0x[0-9a-f]+\(%rip\),%rcx +# [0-9a-f]+ <_DYNAMIC\+0x180> # -> R_X86_64_TPOFF64 sg2 +[0-9a-f]+: 90[ ]+nop * +[0-9a-f]+: 90[ ]+nop * @@ -126,7 +126,7 @@ Disassembly of section .text: +[0-9a-f]+: 00 00 * +[0-9a-f]+: 90[ ]+nop * +[0-9a-f]+: 90[ ]+nop * - +[0-9a-f]+: 4c 03 35 2b 02 20 00[ ]+add 0x20022b\(%rip\),%r14 +# 201308 <.*> + +[0-9a-f]+: 4c 03 35 ([0-9a-f]{2} ){4}[ ]+add 0x[0-9a-f]+\(%rip\),%r14 +# [0-9a-f]+ <_DYNAMIC\+0x150> # -> R_X86_64_TPOFF64 *ABS*+0x24 +[0-9a-f]+: 90[ ]+nop * +[0-9a-f]+: 90[ ]+nop * @@ -137,7 +137,7 @@ Disassembly of section .text: +[0-9a-f]+: 00 00 * +[0-9a-f]+: 90[ ]+nop * +[0-9a-f]+: 90[ ]+nop * - +[0-9a-f]+: 48 03 0d 4d 02 20 00[ ]+add 0x20024d\(%rip\),%rcx +# 201340 <.*> + +[0-9a-f]+: 48 03 0d ([0-9a-f]{2} ){4}[ ]+add 0x[0-9a-f]+\(%rip\),%rcx +# [0-9a-f]+ <_DYNAMIC\+0x188> # -> R_X86_64_TPOFF64 *ABS*+0x44 +[0-9a-f]+: 90[ ]+nop * +[0-9a-f]+: 90[ ]+nop * @@ -148,7 +148,7 @@ Disassembly of section .text: +[0-9a-f]+: 00 00 * +[0-9a-f]+: 90[ ]+nop * +[0-9a-f]+: 90[ ]+nop * - +[0-9a-f]+: 48 03 0d 0f 02 20 00[ ]+add 0x20020f\(%rip\),%rcx +# 201318 <.*> + +[0-9a-f]+: 48 03 0d ([0-9a-f]{2} ){4}[ ]+add 0x[0-9a-f]+\(%rip\),%rcx +# [0-9a-f]+ <_DYNAMIC\+0x160> # -> R_X86_64_TPOFF64 *ABS*+0x64 +[0-9a-f]+: 90[ ]+nop * +[0-9a-f]+: 90[ ]+nop * @@ -156,7 +156,7 @@ Disassembly of section .text: +[0-9a-f]+: 90[ ]+nop * # Direct access through %fs # IE against global var - +[0-9a-f]+: 48 8b 0d 0c 02 20 00[ ]+mov 0x20020c\(%rip\),%rcx +# 201320 <.*> + +[0-9a-f]+: 48 8b 0d ([0-9a-f]{2} ){4}[ ]+mov 0x[0-9a-f]+\(%rip\),%rcx +# [0-9a-f]+ <_DYNAMIC\+0x168> # -> R_X86_64_TPOFF64 sg5 +[0-9a-f]+: 90[ ]+nop * +[0-9a-f]+: 90[ ]+nop * @@ -166,7 +166,7 @@ Disassembly of section .text: +[0-9a-f]+: 90[ ]+nop * +[0-9a-f]+: 90[ ]+nop * # IE against local var - +[0-9a-f]+: 4c 8b 15 eb 01 20 00[ ]+mov 0x2001eb\(%rip\),%r10 +# 201310 <.*> + +[0-9a-f]+: 4c 8b 15 ([0-9a-f]{2} ){4}[ ]+mov 0x[0-9a-f]+\(%rip\),%r10 +# [0-9a-f]+ <_DYNAMIC\+0x158> # -> R_X86_64_TPOFF64 *ABS*+0x30 +[0-9a-f]+: 90[ ]+nop * +[0-9a-f]+: 90[ ]+nop * @@ -176,7 +176,7 @@ Disassembly of section .text: +[0-9a-f]+: 90[ ]+nop * +[0-9a-f]+: 90[ ]+nop * # IE against hidden and local var - +[0-9a-f]+: 48 8b 15 f2 01 20 00[ ]+mov 0x2001f2\(%rip\),%rdx +# 201328 <.*> + +[0-9a-f]+: 48 8b 15 ([0-9a-f]{2} ){4}[ ]+mov 0x[0-9a-f]+\(%rip\),%rdx +# [0-9a-f]+ <_DYNAMIC\+0x170> # -> R_X86_64_TPOFF64 *ABS*+0x50 +[0-9a-f]+: 90[ ]+nop * +[0-9a-f]+: 90[ ]+nop * @@ -186,7 +186,7 @@ Disassembly of section .text: +[0-9a-f]+: 90[ ]+nop * +[0-9a-f]+: 90[ ]+nop * # IE against hidden but not local var - +[0-9a-f]+: 48 8b 0d e9 01 20 00[ ]+mov 0x2001e9\(%rip\),%rcx +# 201330 <.*> + +[0-9a-f]+: 48 8b 0d ([0-9a-f]{2} ){4}[ ]+mov 0x[0-9a-f]+\(%rip\),%rcx +# [0-9a-f]+ <_DYNAMIC\+0x178> # -> R_X86_64_TPOFF64 *ABS*+0x70 +[0-9a-f]+: 90[ ]+nop * +[0-9a-f]+: 90[ ]+nop * diff --git a/ld/testsuite/ld-x86-64/tlsdesc.sd b/ld/testsuite/ld-x86-64/tlsdesc.sd index 89e2a39b64..88b9354283 100644 --- a/ld/testsuite/ld-x86-64/tlsdesc.sd +++ b/ld/testsuite/ld-x86-64/tlsdesc.sd @@ -5,19 +5,19 @@ #objdump: -s -j.got -j.got.plt #target: x86_64-*-* -.*: +file format elf64-x86-64 +.*: +file format elf64-x86-64.* Contents of section \.got: - 201308 00000000 00000000 00000000 00000000 .* - 201318 00000000 00000000 00000000 00000000 .* - 201328 00000000 00000000 00000000 00000000 .* - 201338 00000000 00000000 00000000 00000000 .* - 201348 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 00000000 00000000 00000000 .* + [0-9a-f]+ 00000000 00000000 .* Contents of section \.got\.plt: - 201350 b8112000 00000000 00000000 00000000 .* - 201360 00000000 00000000 00000000 00000000 .* - 201370 00000000 00000000 00000000 00000000 .* - 201380 00000000 00000000 00000000 00000000 .* - 201390 00000000 00000000 00000000 00000000 .* - 2013a0 00000000 00000000 00000000 00000000 .* - 2013b0 00000000 00000000 .* + [0-9a-f]+ [0-9a-f]+ 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 00000000 00000000 00000000 .* + [0-9a-f]+ 00000000 00000000 00000000 00000000 .* + [0-9a-f]+ 00000000 00000000 .* diff --git a/ld/testsuite/ld-x86-64/tlsdesc.td b/ld/testsuite/ld-x86-64/tlsdesc.td index 479cb84ea5..ac2899262b 100644 --- a/ld/testsuite/ld-x86-64/tlsdesc.td +++ b/ld/testsuite/ld-x86-64/tlsdesc.td @@ -5,12 +5,12 @@ #objdump: -sj.tdata #target: x86_64-*-* -.*: +file format elf64-x86-64 +.*: +file format elf64-x86-64.* Contents of section .tdata: - 201154 11000000 12000000 13000000 14000000 .* - 201164 15000000 16000000 17000000 18000000 .* - 201174 41000000 42000000 43000000 44000000 .* - 201184 45000000 46000000 47000000 48000000 .* - 201194 01010000 02010000 03010000 04010000 .* - 2011a4 05010000 06010000 07010000 08010000 .* + [0-9a-f]+ 11000000 12000000 13000000 14000000 .* + [0-9a-f]+ 15000000 16000000 17000000 18000000 .* + [0-9a-f]+ 41000000 42000000 43000000 44000000 .* + [0-9a-f]+ 45000000 46000000 47000000 48000000 .* + [0-9a-f]+ 01010000 02010000 03010000 04010000 .* + [0-9a-f]+ 05010000 06010000 07010000 08010000 .* diff --git a/ld/testsuite/ld-x86-64/tlsg.sd b/ld/testsuite/ld-x86-64/tlsg.sd index 4eaf3cdf26..7652d57998 100644 --- a/ld/testsuite/ld-x86-64/tlsg.sd +++ b/ld/testsuite/ld-x86-64/tlsg.sd @@ -4,7 +4,7 @@ #objdump: -sj.debug_foobar #target: x86_64-*-* -.*: +file format elf64-x86-64 +.*: +file format elf64-x86-64.* Contents of section .debug_foobar: 0+ 18000000 0+ +.* diff --git a/ld/testsuite/ld-x86-64/tlsgd5.dd b/ld/testsuite/ld-x86-64/tlsgd5.dd index ad9cd6e6d6..64ad1cdc6b 100644 --- a/ld/testsuite/ld-x86-64/tlsgd5.dd +++ b/ld/testsuite/ld-x86-64/tlsgd5.dd @@ -2,7 +2,7 @@ #as: --64 #ld: -melf_x86_64 tmpdir/tlsgd5 #objdump: -drw -#target: x86_64-*-linux* +#target: x86_64-*-linux* x86_64-*-nacl* .*: +file format .* @@ -10,5 +10,5 @@ Disassembly of section .text: [a-f0-9]+ <_start>: [ ]*[a-f0-9]+: 64 48 8b 04 25 00 00 00 00 mov %fs:0x0,%rax -[ ]*[a-f0-9]+: 48 03 05 40 01 20 00 add 0x200140\(%rip\),%rax # 6003a8 <_DYNAMIC\+0x100> +[ ]*[a-f0-9]+: 48 03 05 ([0-9a-f]{2} ){4} * add 0x[0-9a-f]+\(%rip\),%rax +# [0-9a-f]+ <_DYNAMIC\+0x100> #pass diff --git a/ld/testsuite/ld-x86-64/tlsgd6.dd b/ld/testsuite/ld-x86-64/tlsgd6.dd index 8bdb468e95..146fbc420f 100644 --- a/ld/testsuite/ld-x86-64/tlsgd6.dd +++ b/ld/testsuite/ld-x86-64/tlsgd6.dd @@ -10,5 +10,5 @@ Disassembly of section .text: [a-f0-9]+ <_start>: [ ]*[a-f0-9]+: 64 8b 04 25 00 00 00 00 mov %fs:0x0,%eax -[ ]*[a-f0-9]+: 48 03 05 c5 00 20 00 add 0x2000c5\(%rip\),%rax # 600270 <_DYNAMIC\+0x80> +[ ]*[a-f0-9]+: 48 03 05 ([0-9a-f]{2} ){4} * add 0x[0-9a-f]+\(%rip\),%rax +# [0-9a-f]+ <_DYNAMIC\+0x80> #pass diff --git a/ld/testsuite/ld-x86-64/tlsgdesc-nacl.rd b/ld/testsuite/ld-x86-64/tlsgdesc-nacl.rd new file mode 100644 index 0000000000..d163238384 --- /dev/null +++ b/ld/testsuite/ld-x86-64/tlsgdesc-nacl.rd @@ -0,0 +1,106 @@ +#source: tlsgdesc.s +#as: --64 +#ld: -shared -melf64_x86_64_nacl --no-ld-generated-unwind-info +#readelf: -WSsrl +#target: x86_64-*-nacl* + +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]+\] \.plt +.* + +\[[ 0-9]+\] \.text +.* + +\[[ 0-9]+\] \.hash +.* + +\[[ 0-9]+\] \.dynsym +.* + +\[[ 0-9]+\] \.dynstr +.* + +\[[ 0-9]+\] \.rela.dyn +.* + +\[[ 0-9]+\] \.rela.plt +.* + +\[[ 0-9]+\] \.dynamic +.* + +\[[ 0-9]+\] \.got +.* + +\[[ 0-9]+\] \.got.plt +.* + +\[[ 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.* + +LOAD.* + +LOAD.* + +DYNAMIC.* + + Section to Segment mapping: + +Segment Sections... + +00 +.plt .text * + +01 +.hash .dynsym .dynstr .rela.dyn .rela.plt * + +02 +.dynamic .got .got.plt * + +03 +.dynamic * + +Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 8 entries: + +Offset +Info +Type +Symbol's Value +Symbol's Name \+ Addend +[0-9a-f]+ +0+200000012 R_X86_64_TPOFF64 +0+ sG3 \+ 0 +[0-9a-f]+ +0+300000012 R_X86_64_TPOFF64 +0+ sG5 \+ 0 +[0-9a-f]+ +0+400000010 R_X86_64_DTPMOD64 +0+ sG2 \+ 0 +[0-9a-f]+ +0+400000011 R_X86_64_DTPOFF64 +0+ sG2 \+ 0 +[0-9a-f]+ +0+500000012 R_X86_64_TPOFF64 +0+ sG4 \+ 0 +[0-9a-f]+ +0+800000012 R_X86_64_TPOFF64 +0+ sG6 \+ 0 +[0-9a-f]+ +0+a00000010 R_X86_64_DTPMOD64 +0+ sG1 \+ 0 +[0-9a-f]+ +0+a00000011 R_X86_64_DTPOFF64 +0+ sG1 \+ 0 + +Relocation section '.rela.plt' at offset 0x[0-9a-f]+ contains 3 entries: + +Offset +Info +Type +Symbol's Value +Symbol's Name \+ Addend +[0-9a-f]+ +0+600000007 R_X86_64_JUMP_SLOT +0+ __tls_get_addr \+ 0 +[0-9a-f]+ +0+a00000024 R_X86_64_TLSDESC +0+ sG1 \+ 0 +[0-9a-f]+ +0+400000024 R_X86_64_TLSDESC +0+ sG2 \+ 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-9a-f]+ +0 +SECTION +LOCAL +DEFAULT +2 * + +[0-9]+: 0+ +0 +TLS +GLOBAL +DEFAULT +UND sG3 + +[0-9]+: 0+ +0 +TLS +GLOBAL +DEFAULT +UND sG5 + +[0-9]+: 0+ +0 +TLS +GLOBAL +DEFAULT +UND sG2 + +[0-9]+: 0+ +0 +TLS +GLOBAL +DEFAULT +UND sG4 + +[0-9]+: 0+ +0 +NOTYPE +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 sG6 + +[0-9]+: [0-9a-f]+ +0 +FUNC +GLOBAL +DEFAULT +2 fc1 + +[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+ +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 +OBJECT +LOCAL +DEFAULT +ABS _DYNAMIC + +[0-9]+: [0-9a-f]+ +0 +OBJECT +LOCAL +DEFAULT +ABS _GLOBAL_OFFSET_TABLE_ + +[0-9]+: 0+ +0 +TLS +GLOBAL +DEFAULT +UND sG3 + +[0-9]+: 0+ +0 +TLS +GLOBAL +DEFAULT +UND sG5 + +[0-9]+: 0+ +0 +TLS +GLOBAL +DEFAULT +UND sG2 + +[0-9]+: 0+ +0 +TLS +GLOBAL +DEFAULT +UND sG4 + +[0-9]+: 0+ +0 +NOTYPE +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 sG6 + +[0-9]+: [0-9a-f]+ +0 +FUNC +GLOBAL +DEFAULT +2 fc1 + +[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 diff --git a/ld/testsuite/ld-x86-64/tlsgdesc.dd b/ld/testsuite/ld-x86-64/tlsgdesc.dd index fa467a5ff3..635974c454 100644 --- a/ld/testsuite/ld-x86-64/tlsgdesc.dd +++ b/ld/testsuite/ld-x86-64/tlsgdesc.dd @@ -4,7 +4,7 @@ #objdump: -drj.text #target: x86_64-*-* -.*: +file format elf64-x86-64 +.*: +file format elf64-x86-64.* Disassembly of section .text: @@ -20,7 +20,7 @@ Disassembly of section .text: +[0-9a-f]+: 00 00 * +[0-9a-f]+: 90[ ]+nop * +[0-9a-f]+: 90[ ]+nop * - +[0-9a-f]+: 48 03 0d 5e 02 20 00[ ]+add 0x20025e\(%rip\),%rcx +# 200668 <.*> + +[0-9a-f]+: 48 03 0d ([0-9a-f]{2} ){4}[ ]+add 0x[0-9a-f]+\(%rip\),%rcx +# [0-9a-f]+ <_DYNAMIC\+0x150> # -> R_X86_64_TPOFF64 sG3 +[0-9a-f]+: 90[ ]+nop * +[0-9a-f]+: 90[ ]+nop * @@ -31,24 +31,24 @@ Disassembly of section .text: +[0-9a-f]+: 00 00 * +[0-9a-f]+: 90[ ]+nop * +[0-9a-f]+: 90[ ]+nop * - +[0-9a-f]+: 48 03 0d 68 02 20 00[ ]+add 0x200268\(%rip\),%rcx +# 200688 <.*> + +[0-9a-f]+: 48 03 0d ([0-9a-f]{2} ){4}[ ]+add 0x[0-9a-f]+\(%rip\),%rcx +# [0-9a-f]+ <_DYNAMIC\+0x170> # -> R_X86_64_TPOFF64 sG4 +[0-9a-f]+: 90[ ]+nop * +[0-9a-f]+: 90[ ]+nop * +[0-9a-f]+: 90[ ]+nop * +[0-9a-f]+: 90[ ]+nop * # GD, gd first - +[0-9a-f]+: 66 48 8d 3d 6c 02 20[ ]+data32 lea 0x20026c\(%rip\),%rdi +# 200698 <.*> - +[0-9a-f]+: 00 * + +[0-9a-f]+: 66 48 8d 3d ([0-9a-f]{2} ){3}[ ]+data32 lea 0x[0-9a-f]+\(%rip\),%rdi +# [0-9a-f]+ <_DYNAMIC\+0x180> + +[0-9a-f]+: [0-9a-f]{2} * # -> R_X86_64_DTPMOD64 sG1 - +[0-9a-f]+: 66 66 48 e8 9c ff ff[ ]+data32 data32 callq [0-9a-f]+ <.*> - +[0-9a-f]+: ff[ ]+ + +[0-9a-f]+: 66 66 48 e8 ([0-9a-f]{2} ){3}[ ]+data32 data32 callq [0-9a-f]+ <__tls_get_addr@plt> + +[0-9a-f]+: [0-9a-f]{2} * # -> R_X86_64_JUMP_SLOT __tls_get_addr +[0-9a-f]+: 90[ ]+nop * +[0-9a-f]+: 90[ ]+nop * +[0-9a-f]+: 90[ ]+nop * +[0-9a-f]+: 90[ ]+nop * - +[0-9a-f]+: 48 8d 05 a1 02 20 00[ ]+lea 0x2002a1\(%rip\),%rax +# 2006e0 <.*> + +[0-9a-f]+: 48 8d 05 ([0-9a-f]{2} ){4}[ ]+lea 0x[0-9a-f]+\(%rip\),%rax +# [0-9a-f]+ <_GLOBAL_OFFSET_TABLE_\+0x30> # -> R_X86_64_TLSDESC sG1 +[0-9a-f]+: ff 10[ ]+callq \*\(%rax\) +[0-9a-f]+: 90[ ]+nop * @@ -56,18 +56,18 @@ Disassembly of section .text: +[0-9a-f]+: 90[ ]+nop * +[0-9a-f]+: 90[ ]+nop * # GD, desc first - +[0-9a-f]+: 48 8d 05 84 02 20 00[ ]+lea 0x200284\(%rip\),%rax +# 2006d0 <.*> + +[0-9a-f]+: 48 8d 05 ([0-9a-f]{2} ){4}[ ]+lea 0x[0-9a-f]+\(%rip\),%rax +# [0-9a-f]+ <_GLOBAL_OFFSET_TABLE_\+0x20> # -> R_X86_64_TLSDESC sG2 +[0-9a-f]+: ff 10[ ]+callq \*\(%rax\) +[0-9a-f]+: 90[ ]+nop * +[0-9a-f]+: 90[ ]+nop * +[0-9a-f]+: 90[ ]+nop * +[0-9a-f]+: 90[ ]+nop * - +[0-9a-f]+: 66 48 8d 3d 1e 02 20[ ]+data32 lea 0x20021e\(%rip\),%rdi +# 200678 <.*> - +[0-9a-f]+: 00 * + +[0-9a-f]+: 66 48 8d 3d ([0-9a-f]{2} ){3}[ ]+data32 lea 0x[0-9a-f]+\(%rip\),%rdi +# [0-9a-f]+ <_DYNAMIC\+0x160> + +[0-9a-f]+: [0-9a-f]{2} * # -> R_X86_64_DTPMOD64 sG2 - +[0-9a-f]+: 66 66 48 e8 6e ff ff[ ]+data32 data32 callq [0-9a-f]+ <.*> - +[0-9a-f]+: ff[ ]+ + +[0-9a-f]+: 66 66 48 e8 ([0-9a-f]{2} ){3}[ ]+data32 data32 callq [0-9a-f]+ <__tls_get_addr@plt> + +[0-9a-f]+: [0-9a-f]{2} * # -> R_X86_64_JUMP_SLOT __tls_get_addr +[0-9a-f]+: 90[ ]+nop * +[0-9a-f]+: 90[ ]+nop * @@ -76,13 +76,13 @@ Disassembly of section .text: # GD -> IE, gd first, after IE use +[0-9a-f]+: 64 48 8b 04 25 00 00[ ]+mov %fs:0x0,%rax +[0-9a-f]+: 00 00 * - +[0-9a-f]+: 48 03 05 f2 01 20 00[ ]+add 0x2001f2\(%rip\),%rax +# 200668 <.*> + +[0-9a-f]+: 48 03 05 ([0-9a-f]{2} ){4}[ ]+add 0x[0-9a-f]+\(%rip\),%rax +# [0-9a-f]+ <_DYNAMIC\+0x150> # -> R_X86_64_TPOFF64 sG3 +[0-9a-f]+: 90[ ]+nop * +[0-9a-f]+: 90[ ]+nop * +[0-9a-f]+: 90[ ]+nop * +[0-9a-f]+: 90[ ]+nop * - +[0-9a-f]+: 48 8b 05 e7 01 20 00[ ]+mov 0x2001e7\(%rip\),%rax +# 200668 <.*> + +[0-9a-f]+: 48 8b 05 ([0-9a-f]{2} ){4}[ ]+mov 0x[0-9a-f]+\(%rip\),%rax +# [0-9a-f]+ <_DYNAMIC\+0x150> # -> R_X86_64_TPOFF64 sG3 +[0-9a-f]+: 66 90[ ]+xchg %ax,%ax +[0-9a-f]+: 90[ ]+nop * @@ -90,7 +90,7 @@ Disassembly of section .text: +[0-9a-f]+: 90[ ]+nop * +[0-9a-f]+: 90[ ]+nop * # GD -> IE, desc first, after IE use - +[0-9a-f]+: 48 8b 05 fa 01 20 00[ ]+mov 0x2001fa\(%rip\),%rax +# 200688 <.*> + +[0-9a-f]+: 48 8b 05 ([0-9a-f]{2} ){4}[ ]+mov 0x[0-9a-f]+\(%rip\),%rax +# [0-9a-f]+ <_DYNAMIC\+0x170> # -> R_X86_64_TPOFF64 sG4 +[0-9a-f]+: 66 90[ ]+xchg %ax,%ax +[0-9a-f]+: 90[ ]+nop * @@ -99,7 +99,7 @@ Disassembly of section .text: +[0-9a-f]+: 90[ ]+nop * +[0-9a-f]+: 64 48 8b 04 25 00 00[ ]+mov %fs:0x0,%rax +[0-9a-f]+: 00 00 * - +[0-9a-f]+: 48 03 05 e4 01 20 00[ ]+add 0x2001e4\(%rip\),%rax +# 200688 <.*> + +[0-9a-f]+: 48 03 05 ([0-9a-f]{2} ){4}[ ]+add 0x[0-9a-f]+\(%rip\),%rax +# [0-9a-f]+ <_DYNAMIC\+0x170> # -> R_X86_64_TPOFF64 sG4 +[0-9a-f]+: 90[ ]+nop * +[0-9a-f]+: 90[ ]+nop * @@ -108,13 +108,13 @@ Disassembly of section .text: # GD -> IE, gd first, before IE use +[0-9a-f]+: 64 48 8b 04 25 00 00[ ]+mov %fs:0x0,%rax +[0-9a-f]+: 00 00 * - +[0-9a-f]+: 48 03 05 b8 01 20 00[ ]+add 0x2001b8\(%rip\),%rax +# 200670 <.*> + +[0-9a-f]+: 48 03 05 ([0-9a-f]{2} ){4}[ ]+add 0x[0-9a-f]+\(%rip\),%rax +# [0-9a-f]+ <_DYNAMIC\+0x158> # -> R_X86_64_TPOFF64 sG5 +[0-9a-f]+: 90[ ]+nop * +[0-9a-f]+: 90[ ]+nop * +[0-9a-f]+: 90[ ]+nop * +[0-9a-f]+: 90[ ]+nop * - +[0-9a-f]+: 48 8b 05 ad 01 20 00[ ]+mov 0x2001ad\(%rip\),%rax +# 200670 <.*> + +[0-9a-f]+: 48 8b 05 ([0-9a-f]{2} ){4}[ ]+mov 0x[0-9a-f]+\(%rip\),%rax +# [0-9a-f]+ <_DYNAMIC\+0x158> # -> R_X86_64_TPOFF64 sG5 +[0-9a-f]+: 66 90[ ]+xchg %ax,%ax +[0-9a-f]+: 90[ ]+nop * @@ -122,7 +122,7 @@ Disassembly of section .text: +[0-9a-f]+: 90[ ]+nop * +[0-9a-f]+: 90[ ]+nop * # GD -> IE, desc first, before IE use - +[0-9a-f]+: 48 8b 05 c0 01 20 00[ ]+mov 0x2001c0\(%rip\),%rax +# 200690 <.*> + +[0-9a-f]+: 48 8b 05 ([0-9a-f]{2} ){4}[ ]+mov 0x[0-9a-f]+\(%rip\),%rax +# [0-9a-f]+ <_DYNAMIC\+0x178> # -> R_X86_64_TPOFF64 sG6 +[0-9a-f]+: 66 90[ ]+xchg %ax,%ax +[0-9a-f]+: 90[ ]+nop * @@ -131,7 +131,7 @@ Disassembly of section .text: +[0-9a-f]+: 90[ ]+nop * +[0-9a-f]+: 64 48 8b 04 25 00 00[ ]+mov %fs:0x0,%rax +[0-9a-f]+: 00 00 * - +[0-9a-f]+: 48 03 05 aa 01 20 00[ ]+add 0x2001aa\(%rip\),%rax +# 200690 <.*> + +[0-9a-f]+: 48 03 05 ([0-9a-f]{2} ){4}[ ]+add 0x[0-9a-f]+\(%rip\),%rax +# [0-9a-f]+ <_DYNAMIC\+0x178> # -> R_X86_64_TPOFF64 sG6 +[0-9a-f]+: 90[ ]+nop * +[0-9a-f]+: 90[ ]+nop * @@ -142,7 +142,7 @@ Disassembly of section .text: +[0-9a-f]+: 00 00 * +[0-9a-f]+: 90[ ]+nop * +[0-9a-f]+: 90[ ]+nop * - +[0-9a-f]+: 48 03 0d 74 01 20 00[ ]+add 0x200174\(%rip\),%rcx +# 200670 <.*> + +[0-9a-f]+: 48 03 0d ([0-9a-f]{2} ){4}[ ]+add 0x[0-9a-f]+\(%rip\),%rcx +# [0-9a-f]+ <_DYNAMIC\+0x158> # -> R_X86_64_TPOFF64 sG5 +[0-9a-f]+: 90[ ]+nop * +[0-9a-f]+: 90[ ]+nop * @@ -153,7 +153,7 @@ Disassembly of section .text: +[0-9a-f]+: 00 00 * +[0-9a-f]+: 90[ ]+nop * +[0-9a-f]+: 90[ ]+nop * - +[0-9a-f]+: 48 03 0d 7e 01 20 00[ ]+add 0x20017e\(%rip\),%rcx +# 200690 <.*> + +[0-9a-f]+: 48 03 0d ([0-9a-f]{2} ){4}[ ]+add 0x[0-9a-f]+\(%rip\),%rcx +# [0-9a-f]+ <_DYNAMIC\+0x178> # -> R_X86_64_TPOFF64 sG6 +[0-9a-f]+: 90[ ]+nop * +[0-9a-f]+: 90[ ]+nop * diff --git a/ld/testsuite/ld-x86-64/tlspic-nacl.rd b/ld/testsuite/ld-x86-64/tlspic-nacl.rd new file mode 100644 index 0000000000..56a07bf753 --- /dev/null +++ b/ld/testsuite/ld-x86-64/tlspic-nacl.rd @@ -0,0 +1,146 @@ +#source: tlspic1.s +#source: tlspic2.s +#as: --64 +#ld: -shared -melf_x86_64_nacl --no-ld-generated-unwind-info +#readelf: -WSsrl +#target: x86_64-*-nacl* + +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]+\] .plt +.* + +\[[ 0-9]+\] .text +PROGBITS +0+1000 [0-9a-f]+ 0+1ac 00 +AX +0 +0 4096 + +\[[ 0-9]+\] .hash +.* + +\[[ 0-9]+\] .dynsym +.* + +\[[ 0-9]+\] .dynstr +.* + +\[[ 0-9]+\] .rela.dyn +.* + +\[[ 0-9]+\] .rela.plt +.* + +\[[ 0-9]+\] .tdata +PROGBITS +0+100104e8 [0-9a-f]+ 0+60 00 WAT +0 +0 +1 + +\[[ 0-9]+\] .tbss +NOBITS +0+10010548 [0-9a-f]+ 0+20 00 WAT +0 +0 +1 + +\[[ 0-9]+\] .dynamic +DYNAMIC +0+10010548 [0-9a-f]+ 0+130 10 +WA +5 +0 +8 + +\[[ 0-9]+\] .got +PROGBITS +0+10010678 [0-9a-f]+ 0+90 08 +WA +0 +0 +8 + +\[[ 0-9]+\] .got.plt +PROGBITS +0+10010708 [0-9a-f]+ 0+20 08 +WA +0 +0 +8 + +\[[ 0-9]+\] .shstrtab +.* + +\[[ 0-9]+\] .symtab +.* + +\[[ 0-9]+\] .strtab +.* +Key to Flags: +.* +.* +.* + +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+10000 0x0+ 0x0+ 0x[0-9a-f]+ 0x[0-9a-f]+ R E 0x10000 + +LOAD +0x0+ 0x0+10000000 0x0+10000000 0x0+4e8 0x0+4e8 R +0x10000 + +LOAD +0x0+4e8 0x0+100104e8 0x0+100104e8 0x0+240 0x0+240 RW +0x10000 + +DYNAMIC +0x0+548 0x0+10010548 0x0+10010548 0x0+130 0x0+130 RW +0x8 + +TLS +0x0+4e8 0x0+100104e8 0x0+100104e8 0x0+60 0x0+80 R +0x1 + + Section to Segment mapping: + +Segment Sections... + +00 +.plt .text * + +01 +.hash .dynsym .dynstr .rela.dyn .rela.plt * + +02 +.tdata .dynamic .got .got.plt * + +03 +.dynamic * + +04 +.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_X86_64_DTPMOD64 +0+ +[0-9a-f ]+R_X86_64_TPOFF64 +0+24 +[0-9a-f ]+R_X86_64_TPOFF64 +0+30 +[0-9a-f ]+R_X86_64_DTPMOD64 +0+ +[0-9a-f ]+R_X86_64_DTPMOD64 +0+ +[0-9a-f ]+R_X86_64_TPOFF64 +0+64 +[0-9a-f ]+R_X86_64_TPOFF64 +0+50 +[0-9a-f ]+R_X86_64_TPOFF64 +0+70 +[0-9a-f ]+R_X86_64_DTPMOD64 +0+ +[0-9a-f ]+R_X86_64_TPOFF64 +0+44 +[0-9a-f ]+R_X86_64_TPOFF64 +0+10 sg5 \+ 0 +[0-9a-f ]+R_X86_64_DTPMOD64 +0+ sg1 \+ 0 +[0-9a-f ]+R_X86_64_DTPOFF64 +0+ sg1 \+ 0 +[0-9a-f ]+R_X86_64_TPOFF64 +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_X86_64_JUMP_SLOT +0+ __tls_get_addr \+ 0 + +Symbol table '\.dynsym' contains [0-9]+ entries: + +Num: +Value +Size +Type +Bind +Vis +Ndx +Name +.* NOTYPE +LOCAL +DEFAULT +UND * +.* SECTION +LOCAL +DEFAULT +2 * +.* 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_addr +.* TLS +GLOBAL +DEFAULT +8 sg1 +.* FUNC +GLOBAL +DEFAULT +2 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 * +.* SECTION +LOCAL +DEFAULT +12 * +.* 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_addr +.* TLS +GLOBAL +DEFAULT +8 sg1 +.* FUNC +GLOBAL +DEFAULT +2 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/ld/testsuite/ld-x86-64/tlspic.dd b/ld/testsuite/ld-x86-64/tlspic.dd index 0c474a9211..93baac0cc8 100644 --- a/ld/testsuite/ld-x86-64/tlspic.dd +++ b/ld/testsuite/ld-x86-64/tlspic.dd @@ -5,7 +5,7 @@ #objdump: -drj.text #target: x86_64-*-* -.*: +file format elf64-x86-64 +.*: +file format elf64-x86-64.* Disassembly of section .text: @@ -17,8 +17,8 @@ Disassembly of section .text: +1006: 90[ ]+nop * +1007: 90[ ]+nop * # GD - +1008: 66 48 8d 3d 80 03 20[ ]+data32 lea 0x200380\(%rip\),%rdi +# 201390 <.*> - +100f: 00 * + +1008: 66 48 8d 3d ([0-9a-f]{2} ){3}[ ]+data32 lea 0x[0-9a-f]+\(%rip\),%rdi +# [0-9a-f]+ <_DYNAMIC\+0x180> + +100f: [0-9a-f ]+ # -> R_X86_64_DTPMOD64 sg1 +1010: 66 66 48 e8 [0-9a-f ]+data32 data32 callq [0-9a-f]+ <.*> # -> R_X86_64_JUMP_SLOT __tls_get_addr @@ -30,15 +30,15 @@ Disassembly of section .text: # GD -> IE because variable is referenced through IE too +101c: 64 48 8b 04 25 00 00[ ]+mov %fs:0x0,%rax +1023: 00 00 * - +1025: 48 03 05 84 03 20 00[ ]+add 0x200384\(%rip\),%rax +# 2013b0 <.*> + +1025: 48 03 05 ([0-9a-f]{2} ){4}[ ]+add 0x[0-9a-f]+\(%rip\),%rax +# [0-9a-f]+ <_DYNAMIC\+0x1a0> # -> R_X86_64_TPOFF64 sg2 +102c: 90[ ]+nop * +102d: 90[ ]+nop * +102e: 90[ ]+nop * +102f: 90[ ]+nop * # GD against local variable - +1030: 66 48 8d 3d 08 03 20[ ]+data32 lea 0x200308\(%rip\),%rdi +# 201340 <.*> - +1037: 00 * + +1030: 66 48 8d 3d ([0-9a-f]{2} ){3}[ ]+data32 lea 0x[0-9a-f]+\(%rip\),%rdi +# [0-9a-f]+ <_DYNAMIC\+0x130> + +1037: [0-9a-f ]+ # -> R_X86_64_DTPMOD64 [0 0x2000000000000000] +1038: 66 66 48 e8 [0-9a-f ]+data32 data32 callq [0-9a-f]+ <.*> # -> R_X86_64_JUMP_SLOT __tls_get_addr @@ -50,15 +50,15 @@ Disassembly of section .text: # GD -> IE against local variable referenced through IE too +1044: 64 48 8b 04 25 00 00[ ]+mov %fs:0x0,%rax +104b: 00 00 * - +104d: 48 03 05 fc 02 20 00[ ]+add 0x2002fc\(%rip\),%rax +# 201350 <.*> + +104d: 48 03 05 ([0-9a-f]{2} ){4}[ ]+add 0x[0-9a-f]+\(%rip\),%rax +# [0-9a-f]+ <_DYNAMIC\+0x140> # -> R_X86_64_TPOFF64 *ABS*+0x24 +1054: 90[ ]+nop * +1055: 90[ ]+nop * +1056: 90[ ]+nop * +1057: 90[ ]+nop * # GD against hidden and local variable - +1058: 66 48 8d 3d 58 03 20[ ]+data32 lea 0x200358\(%rip\),%rdi +# 2013b8 <.*> - +105f: 00 * + +1058: 66 48 8d 3d ([0-9a-f]{2} ){3}[ ]+data32 lea 0x[0-9a-f]+\(%rip\),%rdi +# [0-9a-f]+ <_DYNAMIC\+0x1a8> + +105f: [0-9a-f ]+ # -> R_X86_64_DTPMOD64 [0 0x4000000000000000] +1060: 66 66 48 e8 [0-9a-f ]+data32 data32 callq [0-9a-f]+ <.*> # -> R_X86_64_JUMP_SLOT __tls_get_addr @@ -70,15 +70,15 @@ Disassembly of section .text: # GD -> IE against hidden and local variable referenced through IE too +106c: 64 48 8b 04 25 00 00[ ]+mov %fs:0x0,%rax +1073: 00 00 * - +1075: 48 03 05 4c 03 20 00[ ]+add 0x20034c\(%rip\),%rax +# 2013c8 <.*> + +1075: 48 03 05 ([0-9a-f]{2} ){4}[ ]+add 0x[0-9a-f]+\(%rip\),%rax +# [0-9a-f]+ <_DYNAMIC\+0x1b8> # -> R_X86_64_TPOFF64 *ABS*+0x44 +107c: 90[ ]+nop * +107d: 90[ ]+nop * +107e: 90[ ]+nop * +107f: 90[ ]+nop * # GD against hidden but not local variable - +1080: 66 48 8d 3d e8 02 20[ ]+data32 lea 0x2002e8\(%rip\),%rdi +# 201370 <.*> - +1087: 00 * + +1080: 66 48 8d 3d ([0-9a-f]{2} ){3}[ ]+data32 lea 0x[0-9a-f]+\(%rip\),%rdi +# [0-9a-f]+ <_DYNAMIC\+0x160> + +1087: [0-9a-f ]+ # -> R_X86_64_DTPMOD64 [0 0x6000000000000000] +1088: 66 66 48 e8 [0-9a-f ]+data32 data32 callq [0-9a-f]+ <.*> # -> R_X86_64_JUMP_SLOT __tls_get_addr @@ -90,14 +90,14 @@ Disassembly of section .text: # GD -> IE against hidden but not local variable referenced through IE too +1094: 64 48 8b 04 25 00 00[ ]+mov %fs:0x0,%rax +109b: 00 00 * - +109d: 48 03 05 dc 02 20 00[ ]+add 0x2002dc\(%rip\),%rax +# 201380 <.*> + +109d: 48 03 05 ([0-9a-f]{2} ){4}[ ]+add 0x[0-9a-f]+\(%rip\),%rax +# [0-9a-f]+ <_DYNAMIC\+0x170> # -> R_X86_64_TPOFF64 *ABS*+0x64 +10a4: 90[ ]+nop * +10a5: 90[ ]+nop * +10a6: 90[ ]+nop * +10a7: 90[ ]+nop * # LD - +10a8: 48 8d 3d b1 02 20 00[ ]+lea 0x2002b1\(%rip\),%rdi +# 201360 <.*> + +10a8: 48 8d 3d ([0-9a-f]{2} ){4}[ ]+lea 0x[0-9a-f]+\(%rip\),%rdi +# [0-9a-f]+ <_DYNAMIC\+0x150> # -> R_X86_64_DTPMOD64 [0 0x000000000000000] +10af: e8 [0-9a-f ]+callq [0-9a-f]+ <.*> # -> R_X86_64_JUMP_SLOT __tls_get_addr @@ -112,7 +112,7 @@ Disassembly of section .text: +10c8: 90[ ]+nop * +10c9: 90[ ]+nop * # LD against hidden and local variables - +10ca: 48 8d 3d 8f 02 20 00[ ]+lea 0x20028f\(%rip\),%rdi +# 201360 <.*> + +10ca: 48 8d 3d ([0-9a-f]{2} ){4}[ ]+lea 0x[0-9a-f]+\(%rip\),%rdi +# [0-9a-f]+ <_DYNAMIC\+0x150> # -> R_X86_64_DTPMOD64 [0 0x000000000000000] +10d1: e8 [0-9a-f ]+callq [0-9a-f]+ <.*> # -> R_X86_64_JUMP_SLOT __tls_get_addr @@ -127,7 +127,7 @@ Disassembly of section .text: +10ea: 90[ ]+nop * +10eb: 90[ ]+nop * # LD against hidden but not local variables - +10ec: 48 8d 3d 6d 02 20 00[ ]+lea 0x20026d\(%rip\),%rdi +# 201360 <.*> + +10ec: 48 8d 3d ([0-9a-f]{2} ){4}[ ]+lea 0x[0-9a-f]+\(%rip\),%rdi +# [0-9a-f]+ <_DYNAMIC\+0x150> # -> R_X86_64_DTPMOD64 [0 0x000000000000000] +10f3: e8 [0-9a-f ]+callq [0-9a-f]+ <.*> # -> R_X86_64_JUMP_SLOT __tls_get_addr @@ -144,7 +144,7 @@ Disassembly of section .text: +1113: 00 00 * +1115: 90[ ]+nop * +1116: 90[ ]+nop * - +1117: 48 03 0d 92 02 20 00[ ]+add 0x200292\(%rip\),%rcx +# 2013b0 <.*> + +1117: 48 03 0d ([0-9a-f]{2} ){4}[ ]+add 0x[0-9a-f]+\(%rip\),%rcx +# [0-9a-f]+ <_DYNAMIC\+0x1a0> # -> R_X86_64_TPOFF64 sg2 +111e: 90[ ]+nop * +111f: 90[ ]+nop * @@ -155,7 +155,7 @@ Disassembly of section .text: +1129: 00 00 * +112b: 90[ ]+nop * +112c: 90[ ]+nop * - +112d: 4c 03 35 1c 02 20 00[ ]+add 0x20021c\(%rip\),%r14 +# 201350 <.*> + +112d: 4c 03 35 ([0-9a-f]{2} ){4}[ ]+add 0x[0-9a-f]+\(%rip\),%r14 +# [0-9a-f]+ <_DYNAMIC\+0x140> # -> R_X86_64_TPOFF64 *ABS*+0x24 +1134: 90[ ]+nop * +1135: 90[ ]+nop * @@ -166,7 +166,7 @@ Disassembly of section .text: +113f: 00 00 * +1141: 90[ ]+nop * +1142: 90[ ]+nop * - +1143: 48 03 0d 7e 02 20 00[ ]+add 0x20027e\(%rip\),%rcx +# 2013c8 <.*> + +1143: 48 03 0d ([0-9a-f]{2} ){4}[ ]+add 0x[0-9a-f]+\(%rip\),%rcx +# [0-9a-f]+ <_DYNAMIC\+0x1b8> # -> R_X86_64_TPOFF64 *ABS*+0x44 +114a: 90[ ]+nop * +114b: 90[ ]+nop * @@ -177,7 +177,7 @@ Disassembly of section .text: +1155: 00 00 * +1157: 90[ ]+nop * +1158: 90[ ]+nop * - +1159: 48 03 0d 20 02 20 00[ ]+add 0x200220\(%rip\),%rcx +# 201380 <.*> + +1159: 48 03 0d ([0-9a-f]{2} ){4}[ ]+add 0x[0-9a-f]+\(%rip\),%rcx +# [0-9a-f]+ <_DYNAMIC\+0x170> # -> R_X86_64_TPOFF64 *ABS*+0x64 +1160: 90[ ]+nop * +1161: 90[ ]+nop * @@ -185,7 +185,7 @@ Disassembly of section .text: +1163: 90[ ]+nop * # Direct access through %fs # IE against global var - +1164: 48 8b 0d 1d 02 20 00[ ]+mov 0x20021d\(%rip\),%rcx +# 201388 <.*> + +1164: 48 8b 0d ([0-9a-f]{2} ){4}[ ]+mov 0x[0-9a-f]+\(%rip\),%rcx +# [0-9a-f]+ <_DYNAMIC\+0x178> # -> R_X86_64_TPOFF64 sg5 +116b: 90[ ]+nop * +116c: 90[ ]+nop * @@ -195,7 +195,7 @@ Disassembly of section .text: +1173: 90[ ]+nop * +1174: 90[ ]+nop * # IE against local var - +1175: 4c 8b 15 dc 01 20 00[ ]+mov 0x2001dc\(%rip\),%r10 +# 201358 <.*> + +1175: 4c 8b 15 ([0-9a-f]{2} ){4}[ ]+mov 0x[0-9a-f]+\(%rip\),%r10 +# [0-9a-f]+ <_DYNAMIC\+0x148> # -> R_X86_64_TPOFF64 *ABS*+0x30 +117c: 90[ ]+nop * +117d: 90[ ]+nop * @@ -205,7 +205,7 @@ Disassembly of section .text: +1184: 90[ ]+nop * +1185: 90[ ]+nop * # IE against hidden and local var - +1186: 48 8b 15 13 02 20 00[ ]+mov 0x200213\(%rip\),%rdx +# 2013a0 <.*> + +1186: 48 8b 15 ([0-9a-f]{2} ){4}[ ]+mov 0x[0-9a-f]+\(%rip\),%rdx +# [0-9a-f]+ <_DYNAMIC\+0x190> # -> R_X86_64_TPOFF64 *ABS*+0x50 +118d: 90[ ]+nop * +118e: 90[ ]+nop * @@ -215,7 +215,7 @@ Disassembly of section .text: +1195: 90[ ]+nop * +1196: 90[ ]+nop * # IE against hidden but not local var - +1197: 48 8b 0d 0a 02 20 00[ ]+mov 0x20020a\(%rip\),%rcx +# 2013a8 <.*> + +1197: 48 8b 0d ([0-9a-f]{2} ){4}[ ]+mov 0x[0-9a-f]+\(%rip\),%rcx +# [0-9a-f]+ <_DYNAMIC\+0x198> # -> R_X86_64_TPOFF64 *ABS*+0x70 +119e: 90[ ]+nop * +119f: 90[ ]+nop * diff --git a/ld/testsuite/ld-x86-64/tlspic.sd b/ld/testsuite/ld-x86-64/tlspic.sd index 36c1b528ca..e26c954ab3 100644 --- a/ld/testsuite/ld-x86-64/tlspic.sd +++ b/ld/testsuite/ld-x86-64/tlspic.sd @@ -5,15 +5,15 @@ #objdump: -sj.got #target: x86_64-*-* -.*: +file format elf64-x86-64 +.*: +file format elf64-x86-64.* Contents of section .got: - 201340 00000000 00000000 20000000 00000000 .* - 201350 00000000 00000000 00000000 00000000 .* - 201360 00000000 00000000 00000000 00000000 .* - 201370 00000000 00000000 60000000 00000000 .* - 201380 00000000 00000000 00000000 00000000 .* - 201390 00000000 00000000 00000000 00000000 .* - 2013a0 00000000 00000000 00000000 00000000 .* - 2013b0 00000000 00000000 00000000 00000000 .* - 2013c0 40000000 00000000 00000000 00000000 .* + [0-9a-f]+ 00000000 00000000 20000000 00000000 .* + [0-9a-f]+ 00000000 00000000 00000000 00000000 .* + [0-9a-f]+ 00000000 00000000 00000000 00000000 .* + [0-9a-f]+ 00000000 00000000 60000000 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 00000000 00000000 00000000 .* + [0-9a-f]+ 40000000 00000000 00000000 00000000 .* diff --git a/ld/testsuite/ld-x86-64/tlspic.td b/ld/testsuite/ld-x86-64/tlspic.td index 36a7f8e422..8fc12c6a30 100644 --- a/ld/testsuite/ld-x86-64/tlspic.td +++ b/ld/testsuite/ld-x86-64/tlspic.td @@ -5,12 +5,12 @@ #objdump: -sj.tdata #target: x86_64-*-* -.*: +file format elf64-x86-64 +.*: +file format elf64-x86-64.* Contents of section .tdata: - 2011ac 11000000 12000000 13000000 14000000 .* - 2011bc 15000000 16000000 17000000 18000000 .* - 2011cc 41000000 42000000 43000000 44000000 .* - 2011dc 45000000 46000000 47000000 48000000 .* - 2011ec 01010000 02010000 03010000 04010000 .* - 2011fc 05010000 06010000 07010000 08010000 .* + [0-9a-f]+ 11000000 12000000 13000000 14000000 .* + [0-9a-f]+ 15000000 16000000 17000000 18000000 .* + [0-9a-f]+ 41000000 42000000 43000000 44000000 .* + [0-9a-f]+ 45000000 46000000 47000000 48000000 .* + [0-9a-f]+ 01010000 02010000 03010000 04010000 .* + [0-9a-f]+ 05010000 06010000 07010000 08010000 .* diff --git a/ld/testsuite/ld-x86-64/x86-64.exp b/ld/testsuite/ld-x86-64/x86-64.exp index c258251853..963e8e7bd3 100644 --- a/ld/testsuite/ld-x86-64/x86-64.exp +++ b/ld/testsuite/ld-x86-64/x86-64.exp @@ -1,5 +1,5 @@ # Expect script for ld-x86_64 tests -# Copyright (C) 2002, 2005, 2006, 2007, 2008, 2009, 2010, 2011 +# Copyright (C) 2002, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 # Free Software Foundation # # This file is part of the GNU Binutils. @@ -24,10 +24,17 @@ # tools like objdump as well as the linker. if { !([istarget "x86_64-*-elf*"] + || [istarget "x86_64-*-nacl*"] || [istarget "x86_64-*-linux*"]) } { return } +if [istarget "*-*-nacl*"] { + set emul "elf_x86_64_nacl" +} else { + set emul "elf_x86_64" +} + # 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 @@ -38,6 +45,11 @@ if { !([istarget "x86_64-*-elf*"] # readelf: Apply readelf options on result. Compare with regex (last arg). set x86_64tests { + {"Helper shared library (basic PLT test)" + "-shared -melf_x86_64" "--64" {pltlib.s} {} "libpltlib.so"} + {"basic PLT generation" + "-melf_x86_64 tmpdir/libpltlib.so" "--64" {plt.s} + {{objdump -drj.plt plt.pd}} "plt"} {"TLS -fpic -shared transitions" "-shared -melf_x86_64 --no-ld-generated-unwind-info" "--64" {tlspic1.s tlspic2.s} @@ -111,10 +123,35 @@ set x86_64tests { {"TLS X32 LD->LE transition" "-melf32_x86_64" "--x32" {tlsld2.s} {{objdump -dwr tlsld2.dd}} "tlsld2"} - - {"build 32-bit object with 33 locals" "-e 0" "--32" {32bit.s} {{ ld incompatible.l }} "dummy" } - {"build 64-bit object" "-e 0 --defsym foo=1" "--64" {64bit.s} {} "dummy" } - {"link mixed objects" "-e 0 tmpdir/32bit.o tmpdir/64bit.o" "" {} { { ld incompatible.l } } "mixed"} + + {"build 32-bit object with 33 locals" "-melf_x86_64 -e 0" "--32" {32bit.s} {{ ld incompatible.l }} "dummy" } + {"build 64-bit object" "-melf_x86_64 -e 0 --defsym foo=1" "--64" {64bit.s} {} "dummy" } + {"link mixed objects" "-melf_x86_64 -e 0 tmpdir/32bit.o tmpdir/64bit.o" "" {} { { ld incompatible.l } } "mixed"} +} + +# So as to avoid rewriting every last test case here in a nacl variant, +# we use black magic to massage the generic cases into nacl-variant cases. +if [istarget "*-*-nacl*"] { + set emul elf_x86_64_nacl + + set lhs {elf(32)?_(i386|x86_64)[[:>:]]} + set rhs {&_nacl} + + # Change all the -melf_x86_64 to -melf_x86_64_nacl so linking can succeed. + regsub -all -- $lhs $x86_64tests $rhs x86_64tests + + # Same, applied to all the run_dump_test cases. + set options_regsub(ld) [list $lhs $rhs] + + # The section/segment layout differs too much for the vanilla + # readelf output files to match. So massage the cases so that + # they refer to a foo-nacl.rd file instead of a foo.rd file. + regsub -all -- {([a-z0-9]+)\.rd} $x86_64tests {\1-nacl.rd} x86_64tests + + # Likewise for PLTs. + regsub -all -- {([a-z0-9]+)\.pd} $x86_64tests {\1-nacl.pd} x86_64tests +} else { + set emul elf_x86_64 } run_ld_link_tests $x86_64tests @@ -124,21 +161,21 @@ global ld set test_name "Mixed x86_64 and i386 input test 1" set test mixed1 -if { ![ld_simple_link $ld tmpdir/$test "-melf_x86_64 tmpdir/${test}a.o tmpdir/${test}b.o"] } { +if { ![ld_simple_link $ld tmpdir/$test "-m$emul tmpdir/${test}a.o tmpdir/${test}b.o"] } { if [string match "*i386 architecture of input file `tmpdir/${test}b.o' is incompatible with i386:x86-64 output*" $link_output] { - pass "$test_name" + pass "$test_name" } { - fail "$test_name" + fail "$test_name" } } set test_name "Mixed x86_64 and i386 input test 2" set test mixed2 -if { ![ld_simple_link $ld tmpdir/$test "-melf_x86_64 tmpdir/${test}a.o tmpdir/${test}b.o"] } { +if { ![ld_simple_link $ld tmpdir/$test "-m$emul tmpdir/${test}a.o tmpdir/${test}b.o"] } { if [string match "*i386 architecture of input file `tmpdir/${test}b.o' is incompatible with i386:x86-64 output*" $link_output] { - pass "$test_name" + pass "$test_name" } { - fail "$test_name" + fail "$test_name" } } @@ -169,36 +206,36 @@ run_dump_test "discarded1" run_dump_test "pr12718" run_dump_test "pr12921" -if { ![istarget "x86_64-*-linux*"] } { +if { ![istarget "x86_64-*-linux*"] && ![istarget "x86_64-*-nacl*"]} { return } -if ![ld_assemble $as "--x32 $srcdir/$subdir/start.s" tmpdir/startx32.o] { +if ![ld_assemble $as "--x32 $srcdir/$subdir/start.s" tmpdir/startx32.o] { unresolved "Build ILP32 start.o" return } -if ![ld_assemble $as "--32 $srcdir/$subdir/start.s" tmpdir/start32.o] { +if ![ld_assemble $as "--32 $srcdir/$subdir/start.s" tmpdir/start32.o] { unresolved "Build ia32 start.o" return } -if ![ld_assemble $as "--64 $srcdir/$subdir/start.s" tmpdir/start64.o] { +if ![ld_assemble $as "--64 $srcdir/$subdir/start.s" tmpdir/start64.o] { unresolved "Build LP64 start.o" return } -if ![ld_assemble $as "--x32 $srcdir/$subdir/foo.s" tmpdir/foox32.o] { +if ![ld_assemble $as "--x32 $srcdir/$subdir/foo.s" tmpdir/foox32.o] { unresolved "Build ILP32 foo.o" return } -if ![ld_assemble $as "--32 $srcdir/$subdir/foo.s" tmpdir/foo32.o] { +if ![ld_assemble $as "--32 $srcdir/$subdir/foo.s" tmpdir/foo32.o] { unresolved "Build ia32 foo.o" return } -if ![ld_assemble $as "--64 $srcdir/$subdir/foo.s" tmpdir/foo64.o] { +if ![ld_assemble $as "--64 $srcdir/$subdir/foo.s" tmpdir/foo64.o] { unresolved "Build LP64 foo.o" return } @@ -208,6 +245,7 @@ run_dump_test "ilp32-1" run_dump_test "ilp32-2" run_dump_test "ilp32-3" run_dump_test "ilp32-4" +run_dump_test "ilp32-4-nacl" run_dump_test "ilp32-5" run_dump_test "ilp32-6" run_dump_test "ilp32-7" |