diff options
Diffstat (limited to 'ld/testsuite/ld-x86-64')
105 files changed, 1114 insertions, 147 deletions
diff --git a/ld/testsuite/ld-x86-64/bnd-branch-1-now.d b/ld/testsuite/ld-x86-64/bnd-branch-1-now.d index 50ddf74..6b35219 100644 --- a/ld/testsuite/ld-x86-64/bnd-branch-1-now.d +++ b/ld/testsuite/ld-x86-64/bnd-branch-1-now.d @@ -1,6 +1,6 @@ #source: bnd-branch-1.s #as: --64 -#ld: -z now -shared -melf_x86_64 +#ld: -z now -shared -melf_x86_64 --hash-style=sysv #objdump: -dw .*: +file format .* diff --git a/ld/testsuite/ld-x86-64/bnd-ifunc-1-now.d b/ld/testsuite/ld-x86-64/bnd-ifunc-1-now.d index 73ddc31..f29a40a 100644 --- a/ld/testsuite/ld-x86-64/bnd-ifunc-1-now.d +++ b/ld/testsuite/ld-x86-64/bnd-ifunc-1-now.d @@ -1,6 +1,6 @@ #source: bnd-ifunc-1.s #as: --64 -madd-bnd-prefix -#ld: -z now -shared -melf_x86_64 -z bndplt +#ld: -z now -shared -melf_x86_64 -z bndplt --hash-style=sysv #objdump: -dw .*: +file format .* diff --git a/ld/testsuite/ld-x86-64/bnd-ifunc-1.d b/ld/testsuite/ld-x86-64/bnd-ifunc-1.d index 273e334..13e86bb 100644 --- a/ld/testsuite/ld-x86-64/bnd-ifunc-1.d +++ b/ld/testsuite/ld-x86-64/bnd-ifunc-1.d @@ -1,5 +1,5 @@ #as: --64 -madd-bnd-prefix -#ld: -shared -melf_x86_64 -z bndplt +#ld: -shared -melf_x86_64 -z bndplt --hash-style=sysv #objdump: -dw #... diff --git a/ld/testsuite/ld-x86-64/bnd-ifunc-2-now.d b/ld/testsuite/ld-x86-64/bnd-ifunc-2-now.d index 1fbcd17..bb9a26e 100644 --- a/ld/testsuite/ld-x86-64/bnd-ifunc-2-now.d +++ b/ld/testsuite/ld-x86-64/bnd-ifunc-2-now.d @@ -1,6 +1,6 @@ #source: bnd-ifunc-2.s #as: --64 -madd-bnd-prefix -#ld: -z now -shared -melf_x86_64 -z bndplt +#ld: -z now -shared -melf_x86_64 -z bndplt --hash-style=sysv #objdump: -dw .*: +file format .* diff --git a/ld/testsuite/ld-x86-64/bnd-ifunc-2.d b/ld/testsuite/ld-x86-64/bnd-ifunc-2.d index fc03c17..caba178 100644 --- a/ld/testsuite/ld-x86-64/bnd-ifunc-2.d +++ b/ld/testsuite/ld-x86-64/bnd-ifunc-2.d @@ -1,5 +1,5 @@ #as: --64 -madd-bnd-prefix -#ld: -shared -melf_x86_64 -z bndplt +#ld: -shared -melf_x86_64 -z bndplt --hash-style=sysv #objdump: -dw #... diff --git a/ld/testsuite/ld-x86-64/bnd-plt-1-now.d b/ld/testsuite/ld-x86-64/bnd-plt-1-now.d index 2989f82..9a14a28 100644 --- a/ld/testsuite/ld-x86-64/bnd-plt-1-now.d +++ b/ld/testsuite/ld-x86-64/bnd-plt-1-now.d @@ -1,6 +1,6 @@ #source: bnd-branch-1.s #as: --64 -#ld: -z now -shared -melf_x86_64 -z bndplt +#ld: -z now -shared -melf_x86_64 -z bndplt --hash-style=sysv #objdump: -dw .*: +file format .* diff --git a/ld/testsuite/ld-x86-64/bnd-plt-1.d b/ld/testsuite/ld-x86-64/bnd-plt-1.d index 66efb1a..3f7c88d 100644 --- a/ld/testsuite/ld-x86-64/bnd-plt-1.d +++ b/ld/testsuite/ld-x86-64/bnd-plt-1.d @@ -1,6 +1,6 @@ #source: bnd-branch-1.s #as: --64 -#ld: -shared -melf_x86_64 -z bndplt +#ld: -shared -melf_x86_64 -z bndplt --hash-style=sysv #objdump: -dw .*: +file format .* diff --git a/ld/testsuite/ld-x86-64/ibt-plt-1-x32.d b/ld/testsuite/ld-x86-64/ibt-plt-1-x32.d index 6147ab4..665eaa5 100644 --- a/ld/testsuite/ld-x86-64/ibt-plt-1-x32.d +++ b/ld/testsuite/ld-x86-64/ibt-plt-1-x32.d @@ -1,6 +1,6 @@ #source: ibt-plt-1.s #as: --x32 -#ld: -shared -m elf32_x86_64 +#ld: -shared -m elf32_x86_64 --hash-style=sysv #objdump: -dw .*: +file format .* @@ -9,8 +9,8 @@ Disassembly of section .plt: 0+1c0 <.plt>: - +[a-f0-9]+: ff 35 6a 01 20 00 pushq 0x20016a\(%rip\) # 200330 <_GLOBAL_OFFSET_TABLE_\+0x8> - +[a-f0-9]+: ff 25 6c 01 20 00 jmpq \*0x20016c\(%rip\) # 200338 <_GLOBAL_OFFSET_TABLE_\+0x10> + +[a-f0-9]+: ff 35 62 01 20 00 pushq 0x200162\(%rip\) # 200328 <_GLOBAL_OFFSET_TABLE_\+0x8> + +[a-f0-9]+: ff 25 64 01 20 00 jmpq \*0x200164\(%rip\) # 200330 <_GLOBAL_OFFSET_TABLE_\+0x10> +[a-f0-9]+: 0f 1f 40 00 nopl 0x0\(%rax\) +[a-f0-9]+: f3 0f 1e fa endbr64 +[a-f0-9]+: 68 00 00 00 00 pushq \$0x0 @@ -25,12 +25,12 @@ Disassembly of section .plt.sec: 0+1f0 <bar1@plt>: +[a-f0-9]+: f3 0f 1e fa endbr64 - +[a-f0-9]+: ff 25 46 01 20 00 jmpq \*0x200146\(%rip\) # 200340 <bar1> + +[a-f0-9]+: ff 25 3e 01 20 00 jmpq \*0x20013e\(%rip\) # 200338 <bar1> +[a-f0-9]+: 66 0f 1f 44 00 00 nopw 0x0\(%rax,%rax,1\) 0+200 <bar2@plt>: +[a-f0-9]+: f3 0f 1e fa endbr64 - +[a-f0-9]+: ff 25 3e 01 20 00 jmpq \*0x20013e\(%rip\) # 200348 <bar2> + +[a-f0-9]+: ff 25 36 01 20 00 jmpq \*0x200136\(%rip\) # 200340 <bar2> +[a-f0-9]+: 66 0f 1f 44 00 00 nopw 0x0\(%rax,%rax,1\) Disassembly of section .text: diff --git a/ld/testsuite/ld-x86-64/ibt-plt-1.d b/ld/testsuite/ld-x86-64/ibt-plt-1.d index dbec3ed..8c36cfb 100644 --- a/ld/testsuite/ld-x86-64/ibt-plt-1.d +++ b/ld/testsuite/ld-x86-64/ibt-plt-1.d @@ -1,6 +1,6 @@ #source: ibt-plt-1.s #as: --64 -defsym __64_bit__=1 -#ld: -shared -m elf_x86_64 +#ld: -shared -m elf_x86_64 --hash-style=sysv #objdump: -dw .*: +file format .* diff --git a/ld/testsuite/ld-x86-64/ibt-plt-2a-x32.d b/ld/testsuite/ld-x86-64/ibt-plt-2a-x32.d index df9dc8e..3d934b5 100644 --- a/ld/testsuite/ld-x86-64/ibt-plt-2a-x32.d +++ b/ld/testsuite/ld-x86-64/ibt-plt-2a-x32.d @@ -1,6 +1,6 @@ #source: ibt-plt-2.s #as: --x32 -#ld: -shared -m elf32_x86_64 -z ibtplt +#ld: -shared -m elf32_x86_64 -z ibtplt --hash-style=sysv #objdump: -dw .*: +file format .* @@ -9,8 +9,8 @@ Disassembly of section .plt: 0+1c0 <.plt>: - +[a-f0-9]+: ff 35 6a 01 20 00 pushq 0x20016a\(%rip\) # 200330 <_GLOBAL_OFFSET_TABLE_\+0x8> - +[a-f0-9]+: ff 25 6c 01 20 00 jmpq \*0x20016c\(%rip\) # 200338 <_GLOBAL_OFFSET_TABLE_\+0x10> + +[a-f0-9]+: ff 35 62 01 20 00 pushq 0x200162\(%rip\) # 200328 <_GLOBAL_OFFSET_TABLE_\+0x8> + +[a-f0-9]+: ff 25 64 01 20 00 jmpq \*0x200164\(%rip\) # 200330 <_GLOBAL_OFFSET_TABLE_\+0x10> +[a-f0-9]+: 0f 1f 40 00 nopl 0x0\(%rax\) +[a-f0-9]+: f3 0f 1e fa endbr64 +[a-f0-9]+: 68 00 00 00 00 pushq \$0x0 @@ -25,12 +25,12 @@ Disassembly of section .plt.sec: 0+1f0 <bar1@plt>: +[a-f0-9]+: f3 0f 1e fa endbr64 - +[a-f0-9]+: ff 25 46 01 20 00 jmpq \*0x200146\(%rip\) # 200340 <bar1> + +[a-f0-9]+: ff 25 3e 01 20 00 jmpq \*0x20013e\(%rip\) # 200338 <bar1> +[a-f0-9]+: 66 0f 1f 44 00 00 nopw 0x0\(%rax,%rax,1\) 0+200 <bar2@plt>: +[a-f0-9]+: f3 0f 1e fa endbr64 - +[a-f0-9]+: ff 25 3e 01 20 00 jmpq \*0x20013e\(%rip\) # 200348 <bar2> + +[a-f0-9]+: ff 25 36 01 20 00 jmpq \*0x200136\(%rip\) # 200340 <bar2> +[a-f0-9]+: 66 0f 1f 44 00 00 nopw 0x0\(%rax,%rax,1\) Disassembly of section .text: diff --git a/ld/testsuite/ld-x86-64/ibt-plt-2a.d b/ld/testsuite/ld-x86-64/ibt-plt-2a.d index 0e4f424..4bdf8bd 100644 --- a/ld/testsuite/ld-x86-64/ibt-plt-2a.d +++ b/ld/testsuite/ld-x86-64/ibt-plt-2a.d @@ -1,6 +1,6 @@ #source: ibt-plt-2.s #as: --64 -defsym __64_bit__=1 -#ld: -shared -m elf_x86_64 -z ibtplt +#ld: -shared -m elf_x86_64 -z ibtplt --hash-style=sysv #objdump: -dw .*: +file format .* diff --git a/ld/testsuite/ld-x86-64/ibt-plt-2b-x32.d b/ld/testsuite/ld-x86-64/ibt-plt-2b-x32.d index e9e5638..54a708d 100644 --- a/ld/testsuite/ld-x86-64/ibt-plt-2b-x32.d +++ b/ld/testsuite/ld-x86-64/ibt-plt-2b-x32.d @@ -1,7 +1,42 @@ #source: ibt-plt-2.s #as: --x32 -#ld: -shared -m elf32_x86_64 -z ibtplt -#readelf: -n +#ld: -shared -m elf32_x86_64 -z ibtplt --hash-style=sysv +#readelf: -n -wf + +Contents of the .eh_frame section: + +0+ 00000014 00000000 CIE + Version: 1 + Augmentation: "zR" + Code alignment factor: 1 + Data alignment factor: -8 + Return address column: 16 + Augmentation data: 1b + + DW_CFA_def_cfa: r7 \(rsp\) ofs 8 + DW_CFA_offset: r16 \(rip\) at cfa-8 + DW_CFA_nop + DW_CFA_nop + +0+18 00000014 0000001c FDE cie=00000000 pc=00000210..00000222 + DW_CFA_advance_loc: 4 to 00000214 + DW_CFA_def_cfa_offset: 16 + DW_CFA_advance_loc: 9 to 0000021d + DW_CFA_def_cfa_offset: 8 + DW_CFA_nop + +0+30 00000020 00000034 FDE cie=00000000 pc=000001c0..000001f0 + DW_CFA_def_cfa_offset: 16 + DW_CFA_advance_loc: 6 to 000001c6 + DW_CFA_def_cfa_offset: 24 + DW_CFA_advance_loc: 10 to 000001d0 + DW_CFA_def_cfa_expression \(DW_OP_breg7 \(rsp\): 8; DW_OP_breg16 \(rip\): 0; DW_OP_lit15; DW_OP_and; DW_OP_lit9; DW_OP_ge; DW_OP_lit3; DW_OP_shl; DW_OP_plus\) + +0+54 00000010 00000058 FDE cie=00000000 pc=000001f0..00000210 + DW_CFA_nop + DW_CFA_nop + DW_CFA_nop + Displaying notes found in: .note.gnu.property Owner Data size Description diff --git a/ld/testsuite/ld-x86-64/ibt-plt-2b.d b/ld/testsuite/ld-x86-64/ibt-plt-2b.d index 604db82..9cd1462 100644 --- a/ld/testsuite/ld-x86-64/ibt-plt-2b.d +++ b/ld/testsuite/ld-x86-64/ibt-plt-2b.d @@ -1,7 +1,46 @@ #source: ibt-plt-2.s #as: --64 -defsym __64_bit__=1 -#ld: -shared -m elf_x86_64 -z ibtplt -#readelf: -n +#ld: -shared -m elf_x86_64 -z ibtplt --hash-style=sysv +#readelf: -wf -n + +Contents of the .eh_frame section: + +0+ 0000000000000014 00000000 CIE + Version: 1 + Augmentation: "zR" + Code alignment factor: 1 + Data alignment factor: -8 + Return address column: 16 + Augmentation data: 1b + + DW_CFA_def_cfa: r7 \(rsp\) ofs 8 + DW_CFA_offset: r16 \(rip\) at cfa-8 + DW_CFA_nop + DW_CFA_nop + +0+18 0000000000000014 0000001c FDE cie=00000000 pc=00000000000002e0..00000000000002f2 + DW_CFA_advance_loc: 4 to 00000000000002e4 + DW_CFA_def_cfa_offset: 16 + DW_CFA_advance_loc: 9 to 00000000000002ed + DW_CFA_def_cfa_offset: 8 + DW_CFA_nop + +0+30 0000000000000024 00000034 FDE cie=00000000 pc=0000000000000290..00000000000002c0 + DW_CFA_def_cfa_offset: 16 + DW_CFA_advance_loc: 6 to 0000000000000296 + DW_CFA_def_cfa_offset: 24 + DW_CFA_advance_loc: 10 to 00000000000002a0 + DW_CFA_def_cfa_expression \(DW_OP_breg7 \(rsp\): 8; DW_OP_breg16 \(rip\): 0; DW_OP_lit15; DW_OP_and; DW_OP_lit10; DW_OP_ge; DW_OP_lit3; DW_OP_shl; DW_OP_plus\) + DW_CFA_nop + DW_CFA_nop + DW_CFA_nop + DW_CFA_nop + +0+58 0000000000000010 0000005c FDE cie=00000000 pc=00000000000002c0..00000000000002e0 + DW_CFA_nop + DW_CFA_nop + DW_CFA_nop + Displaying notes found in: .note.gnu.property Owner Data size Description diff --git a/ld/testsuite/ld-x86-64/ibt-plt-2c-x32.d b/ld/testsuite/ld-x86-64/ibt-plt-2c-x32.d index e908804..88d6da8 100644 --- a/ld/testsuite/ld-x86-64/ibt-plt-2c-x32.d +++ b/ld/testsuite/ld-x86-64/ibt-plt-2c-x32.d @@ -1,6 +1,6 @@ #source: ibt-plt-2.s #as: --x32 -#ld: -shared -m elf32_x86_64 -z ibt +#ld: -shared -m elf32_x86_64 -z ibt --hash-style=sysv #objdump: -dw .*: +file format .* @@ -9,8 +9,8 @@ Disassembly of section .plt: 0+1c0 <.plt>: - +[a-f0-9]+: ff 35 6a 01 20 00 pushq 0x20016a\(%rip\) # 200330 <_GLOBAL_OFFSET_TABLE_\+0x8> - +[a-f0-9]+: ff 25 6c 01 20 00 jmpq \*0x20016c\(%rip\) # 200338 <_GLOBAL_OFFSET_TABLE_\+0x10> + +[a-f0-9]+: ff 35 62 01 20 00 pushq 0x200162\(%rip\) # 200328 <_GLOBAL_OFFSET_TABLE_\+0x8> + +[a-f0-9]+: ff 25 64 01 20 00 jmpq \*0x200164\(%rip\) # 200330 <_GLOBAL_OFFSET_TABLE_\+0x10> +[a-f0-9]+: 0f 1f 40 00 nopl 0x0\(%rax\) +[a-f0-9]+: f3 0f 1e fa endbr64 +[a-f0-9]+: 68 00 00 00 00 pushq \$0x0 @@ -25,12 +25,12 @@ Disassembly of section .plt.sec: 0+1f0 <bar1@plt>: +[a-f0-9]+: f3 0f 1e fa endbr64 - +[a-f0-9]+: ff 25 46 01 20 00 jmpq \*0x200146\(%rip\) # 200340 <bar1> + +[a-f0-9]+: ff 25 3e 01 20 00 jmpq \*0x20013e\(%rip\) # 200338 <bar1> +[a-f0-9]+: 66 0f 1f 44 00 00 nopw 0x0\(%rax,%rax,1\) 0+200 <bar2@plt>: +[a-f0-9]+: f3 0f 1e fa endbr64 - +[a-f0-9]+: ff 25 3e 01 20 00 jmpq \*0x20013e\(%rip\) # 200348 <bar2> + +[a-f0-9]+: ff 25 36 01 20 00 jmpq \*0x200136\(%rip\) # 200340 <bar2> +[a-f0-9]+: 66 0f 1f 44 00 00 nopw 0x0\(%rax,%rax,1\) Disassembly of section .text: diff --git a/ld/testsuite/ld-x86-64/ibt-plt-2c.d b/ld/testsuite/ld-x86-64/ibt-plt-2c.d index 0ef1131..7502d83 100644 --- a/ld/testsuite/ld-x86-64/ibt-plt-2c.d +++ b/ld/testsuite/ld-x86-64/ibt-plt-2c.d @@ -1,6 +1,6 @@ #source: ibt-plt-2.s #as: --64 -defsym __64_bit__=1 -#ld: -shared -m elf_x86_64 -z ibt +#ld: -shared -m elf_x86_64 -z ibt --hash-style=sysv #objdump: -dw .*: +file format .* diff --git a/ld/testsuite/ld-x86-64/ibt-plt-2d-x32.d b/ld/testsuite/ld-x86-64/ibt-plt-2d-x32.d index b3be904..f22154a 100644 --- a/ld/testsuite/ld-x86-64/ibt-plt-2d-x32.d +++ b/ld/testsuite/ld-x86-64/ibt-plt-2d-x32.d @@ -1,7 +1,42 @@ #source: ibt-plt-2.s #as: --x32 -#ld: -shared -m elf32_x86_64 -z ibt -#readelf: -n +#ld: -shared -m elf32_x86_64 -z ibt --hash-style=sysv +#readelf: -n -wf + +Contents of the .eh_frame section: + +0+ 00000014 00000000 CIE + Version: 1 + Augmentation: "zR" + Code alignment factor: 1 + Data alignment factor: -8 + Return address column: 16 + Augmentation data: 1b + + DW_CFA_def_cfa: r7 \(rsp\) ofs 8 + DW_CFA_offset: r16 \(rip\) at cfa-8 + DW_CFA_nop + DW_CFA_nop + +0+18 00000014 0000001c FDE cie=00000000 pc=00000210..00000222 + DW_CFA_advance_loc: 4 to 00000214 + DW_CFA_def_cfa_offset: 16 + DW_CFA_advance_loc: 9 to 0000021d + DW_CFA_def_cfa_offset: 8 + DW_CFA_nop + +0+30 00000020 00000034 FDE cie=00000000 pc=000001c0..000001f0 + DW_CFA_def_cfa_offset: 16 + DW_CFA_advance_loc: 6 to 000001c6 + DW_CFA_def_cfa_offset: 24 + DW_CFA_advance_loc: 10 to 000001d0 + DW_CFA_def_cfa_expression \(DW_OP_breg7 \(rsp\): 8; DW_OP_breg16 \(rip\): 0; DW_OP_lit15; DW_OP_and; DW_OP_lit9; DW_OP_ge; DW_OP_lit3; DW_OP_shl; DW_OP_plus\) + +0+54 00000010 00000058 FDE cie=00000000 pc=000001f0..00000210 + DW_CFA_nop + DW_CFA_nop + DW_CFA_nop + Displaying notes found in: .note.gnu.property Owner Data size Description diff --git a/ld/testsuite/ld-x86-64/ibt-plt-2d.d b/ld/testsuite/ld-x86-64/ibt-plt-2d.d index 7226b69..779f754 100644 --- a/ld/testsuite/ld-x86-64/ibt-plt-2d.d +++ b/ld/testsuite/ld-x86-64/ibt-plt-2d.d @@ -1,7 +1,46 @@ #source: ibt-plt-2.s #as: --64 -defsym __64_bit__=1 -#ld: -shared -m elf_x86_64 -z ibt -#readelf: -n +#ld: -shared -m elf_x86_64 -z ibt --hash-style=sysv +#readelf: -wf -n + +Contents of the .eh_frame section: + +0+ 0000000000000014 00000000 CIE + Version: 1 + Augmentation: "zR" + Code alignment factor: 1 + Data alignment factor: -8 + Return address column: 16 + Augmentation data: 1b + + DW_CFA_def_cfa: r7 \(rsp\) ofs 8 + DW_CFA_offset: r16 \(rip\) at cfa-8 + DW_CFA_nop + DW_CFA_nop + +0+18 0000000000000014 0000001c FDE cie=00000000 pc=00000000000002e0..00000000000002f2 + DW_CFA_advance_loc: 4 to 00000000000002e4 + DW_CFA_def_cfa_offset: 16 + DW_CFA_advance_loc: 9 to 00000000000002ed + DW_CFA_def_cfa_offset: 8 + DW_CFA_nop + +0+30 0000000000000024 00000034 FDE cie=00000000 pc=0000000000000290..00000000000002c0 + DW_CFA_def_cfa_offset: 16 + DW_CFA_advance_loc: 6 to 0000000000000296 + DW_CFA_def_cfa_offset: 24 + DW_CFA_advance_loc: 10 to 00000000000002a0 + DW_CFA_def_cfa_expression \(DW_OP_breg7 \(rsp\): 8; DW_OP_breg16 \(rip\): 0; DW_OP_lit15; DW_OP_and; DW_OP_lit10; DW_OP_ge; DW_OP_lit3; DW_OP_shl; DW_OP_plus\) + DW_CFA_nop + DW_CFA_nop + DW_CFA_nop + DW_CFA_nop + +0+58 0000000000000010 0000005c FDE cie=00000000 pc=00000000000002c0..00000000000002e0 + DW_CFA_nop + DW_CFA_nop + DW_CFA_nop + Displaying notes found in: .note.gnu.property Owner Data size Description diff --git a/ld/testsuite/ld-x86-64/ibt-plt-3a-x32.d b/ld/testsuite/ld-x86-64/ibt-plt-3a-x32.d index 0f7835d..4213689 100644 --- a/ld/testsuite/ld-x86-64/ibt-plt-3a-x32.d +++ b/ld/testsuite/ld-x86-64/ibt-plt-3a-x32.d @@ -1,6 +1,6 @@ #source: ibt-plt-3.s #as: --x32 -#ld: -shared -m elf32_x86_64 -z ibtplt +#ld: -shared -m elf32_x86_64 -z ibtplt --hash-style=sysv #objdump: -dw .*: +file format .* @@ -9,8 +9,8 @@ Disassembly of section .plt: 0+1a0 <.plt>: - +[a-f0-9]+: ff 35 52 01 20 00 pushq 0x200152\(%rip\) # 2002f8 <_GLOBAL_OFFSET_TABLE_\+0x8> - +[a-f0-9]+: ff 25 54 01 20 00 jmpq \*0x200154\(%rip\) # 200300 <_GLOBAL_OFFSET_TABLE_\+0x10> + +[a-f0-9]+: ff 35 4a 01 20 00 pushq 0x20014a\(%rip\) # 2002f0 <_GLOBAL_OFFSET_TABLE_\+0x8> + +[a-f0-9]+: ff 25 4c 01 20 00 jmpq \*0x20014c\(%rip\) # 2002f8 <_GLOBAL_OFFSET_TABLE_\+0x10> +[a-f0-9]+: 0f 1f 40 00 nopl 0x0\(%rax\) +[a-f0-9]+: f3 0f 1e fa endbr64 +[a-f0-9]+: 68 00 00 00 00 pushq \$0x0 @@ -25,12 +25,12 @@ Disassembly of section .plt.sec: 0+1d0 <bar1@plt>: +[a-f0-9]+: f3 0f 1e fa endbr64 - +[a-f0-9]+: ff 25 2e 01 20 00 jmpq \*0x20012e\(%rip\) # 200308 <bar1> + +[a-f0-9]+: ff 25 26 01 20 00 jmpq \*0x200126\(%rip\) # 200300 <bar1> +[a-f0-9]+: 66 0f 1f 44 00 00 nopw 0x0\(%rax,%rax,1\) 0+1e0 <bar2@plt>: +[a-f0-9]+: f3 0f 1e fa endbr64 - +[a-f0-9]+: ff 25 26 01 20 00 jmpq \*0x200126\(%rip\) # 200310 <bar2> + +[a-f0-9]+: ff 25 1e 01 20 00 jmpq \*0x20011e\(%rip\) # 200308 <bar2> +[a-f0-9]+: 66 0f 1f 44 00 00 nopw 0x0\(%rax,%rax,1\) Disassembly of section .text: diff --git a/ld/testsuite/ld-x86-64/ibt-plt-3a.d b/ld/testsuite/ld-x86-64/ibt-plt-3a.d index b8f2ebc..7ee2f17 100644 --- a/ld/testsuite/ld-x86-64/ibt-plt-3a.d +++ b/ld/testsuite/ld-x86-64/ibt-plt-3a.d @@ -1,6 +1,6 @@ #source: ibt-plt-3.s #as: --64 -defsym __64_bit__=1 -#ld: -shared -m elf_x86_64 -z ibtplt +#ld: -shared -m elf_x86_64 -z ibtplt --hash-style=sysv #objdump: -dw .*: +file format .* diff --git a/ld/testsuite/ld-x86-64/ibt-plt-3b-x32.d b/ld/testsuite/ld-x86-64/ibt-plt-3b-x32.d index fb0a834..e55406f 100644 --- a/ld/testsuite/ld-x86-64/ibt-plt-3b-x32.d +++ b/ld/testsuite/ld-x86-64/ibt-plt-3b-x32.d @@ -1,5 +1,39 @@ #source: ibt-plt-3.s #as: --x32 -#ld: -shared -m elf32_x86_64 -z ibtplt -#readelf: -n +#ld: -shared -m elf32_x86_64 -z ibtplt --hash-style=sysv +#readelf: -wf -n + +Contents of the .eh_frame section: + +0+ 00000014 00000000 CIE + Version: 1 + Augmentation: "zR" + Code alignment factor: 1 + Data alignment factor: -8 + Return address column: 16 + Augmentation data: 1b + + DW_CFA_def_cfa: r7 \(rsp\) ofs 8 + DW_CFA_offset: r16 \(rip\) at cfa-8 + DW_CFA_nop + DW_CFA_nop + +0+18 00000014 0000001c FDE cie=00000000 pc=000001f0..00000202 + DW_CFA_advance_loc: 4 to 000001f4 + DW_CFA_def_cfa_offset: 16 + DW_CFA_advance_loc: 9 to 000001fd + DW_CFA_def_cfa_offset: 8 + DW_CFA_nop + +0+30 00000020 00000034 FDE cie=00000000 pc=000001a0..000001d0 + DW_CFA_def_cfa_offset: 16 + DW_CFA_advance_loc: 6 to 000001a6 + DW_CFA_def_cfa_offset: 24 + DW_CFA_advance_loc: 10 to 000001b0 + DW_CFA_def_cfa_expression \(DW_OP_breg7 \(rsp\): 8; DW_OP_breg16 \(rip\): 0; DW_OP_lit15; DW_OP_and; DW_OP_lit9; DW_OP_ge; DW_OP_lit3; DW_OP_shl; DW_OP_plus\) + +0+54 00000010 00000058 FDE cie=00000000 pc=000001d0..000001f0 + DW_CFA_nop + DW_CFA_nop + DW_CFA_nop diff --git a/ld/testsuite/ld-x86-64/ibt-plt-3b.d b/ld/testsuite/ld-x86-64/ibt-plt-3b.d index 5a3843b..220371d 100644 --- a/ld/testsuite/ld-x86-64/ibt-plt-3b.d +++ b/ld/testsuite/ld-x86-64/ibt-plt-3b.d @@ -1,5 +1,43 @@ #source: ibt-plt-3.s #as: --64 -defsym __64_bit__=1 -#ld: -shared -m elf_x86_64 -z ibtplt -#readelf: -n +#ld: -shared -m elf_x86_64 -z ibtplt --hash-style=sysv +#readelf: -wf -n + +Contents of the .eh_frame section: + +0+ 0000000000000014 00000000 CIE + Version: 1 + Augmentation: "zR" + Code alignment factor: 1 + Data alignment factor: -8 + Return address column: 16 + Augmentation data: 1b + + DW_CFA_def_cfa: r7 \(rsp\) ofs 8 + DW_CFA_offset: r16 \(rip\) at cfa-8 + DW_CFA_nop + DW_CFA_nop + +0+18 0000000000000014 0000001c FDE cie=00000000 pc=00000000000002a0..00000000000002b2 + DW_CFA_advance_loc: 4 to 00000000000002a4 + DW_CFA_def_cfa_offset: 16 + DW_CFA_advance_loc: 9 to 00000000000002ad + DW_CFA_def_cfa_offset: 8 + DW_CFA_nop + +0+30 0000000000000024 00000034 FDE cie=00000000 pc=0000000000000250..0000000000000280 + DW_CFA_def_cfa_offset: 16 + DW_CFA_advance_loc: 6 to 0000000000000256 + DW_CFA_def_cfa_offset: 24 + DW_CFA_advance_loc: 10 to 0000000000000260 + DW_CFA_def_cfa_expression \(DW_OP_breg7 \(rsp\): 8; DW_OP_breg16 \(rip\): 0; DW_OP_lit15; DW_OP_and; DW_OP_lit10; DW_OP_ge; DW_OP_lit3; DW_OP_shl; DW_OP_plus\) + DW_CFA_nop + DW_CFA_nop + DW_CFA_nop + DW_CFA_nop + +0+58 0000000000000010 0000005c FDE cie=00000000 pc=0000000000000280..00000000000002a0 + DW_CFA_nop + DW_CFA_nop + DW_CFA_nop diff --git a/ld/testsuite/ld-x86-64/ibt-plt-3c-x32.d b/ld/testsuite/ld-x86-64/ibt-plt-3c-x32.d index 234944d..2f70d04 100644 --- a/ld/testsuite/ld-x86-64/ibt-plt-3c-x32.d +++ b/ld/testsuite/ld-x86-64/ibt-plt-3c-x32.d @@ -1,6 +1,6 @@ #source: ibt-plt-3.s #as: --x32 -#ld: -shared -m elf32_x86_64 -z ibt +#ld: -shared -m elf32_x86_64 -z ibt --hash-style=sysv #objdump: -dw .*: +file format .* @@ -9,8 +9,8 @@ Disassembly of section .plt: 0+1c0 <.plt>: - +[a-f0-9]+: ff 35 6a 01 20 00 pushq 0x20016a\(%rip\) # 200330 <_GLOBAL_OFFSET_TABLE_\+0x8> - +[a-f0-9]+: ff 25 6c 01 20 00 jmpq \*0x20016c\(%rip\) # 200338 <_GLOBAL_OFFSET_TABLE_\+0x10> + +[a-f0-9]+: ff 35 62 01 20 00 pushq 0x200162\(%rip\) # 200328 <_GLOBAL_OFFSET_TABLE_\+0x8> + +[a-f0-9]+: ff 25 64 01 20 00 jmpq \*0x200164\(%rip\) # 200330 <_GLOBAL_OFFSET_TABLE_\+0x10> +[a-f0-9]+: 0f 1f 40 00 nopl 0x0\(%rax\) +[a-f0-9]+: f3 0f 1e fa endbr64 +[a-f0-9]+: 68 00 00 00 00 pushq \$0x0 @@ -25,12 +25,12 @@ Disassembly of section .plt.sec: 0+1f0 <bar1@plt>: +[a-f0-9]+: f3 0f 1e fa endbr64 - +[a-f0-9]+: ff 25 46 01 20 00 jmpq \*0x200146\(%rip\) # 200340 <bar1> + +[a-f0-9]+: ff 25 3e 01 20 00 jmpq \*0x20013e\(%rip\) # 200338 <bar1> +[a-f0-9]+: 66 0f 1f 44 00 00 nopw 0x0\(%rax,%rax,1\) 0+200 <bar2@plt>: +[a-f0-9]+: f3 0f 1e fa endbr64 - +[a-f0-9]+: ff 25 3e 01 20 00 jmpq \*0x20013e\(%rip\) # 200348 <bar2> + +[a-f0-9]+: ff 25 36 01 20 00 jmpq \*0x200136\(%rip\) # 200340 <bar2> +[a-f0-9]+: 66 0f 1f 44 00 00 nopw 0x0\(%rax,%rax,1\) Disassembly of section .text: diff --git a/ld/testsuite/ld-x86-64/ibt-plt-3c.d b/ld/testsuite/ld-x86-64/ibt-plt-3c.d index b299f22..d0665ae 100644 --- a/ld/testsuite/ld-x86-64/ibt-plt-3c.d +++ b/ld/testsuite/ld-x86-64/ibt-plt-3c.d @@ -1,6 +1,6 @@ #source: ibt-plt-3.s #as: --64 -defsym __64_bit__=1 -#ld: -shared -m elf_x86_64 -z ibt +#ld: -shared -m elf_x86_64 -z ibt --hash-style=sysv #objdump: -dw .*: +file format .* diff --git a/ld/testsuite/ld-x86-64/ibt-plt-3d-x32.d b/ld/testsuite/ld-x86-64/ibt-plt-3d-x32.d index 447e811..ceaf75a 100644 --- a/ld/testsuite/ld-x86-64/ibt-plt-3d-x32.d +++ b/ld/testsuite/ld-x86-64/ibt-plt-3d-x32.d @@ -1,7 +1,42 @@ #source: ibt-plt-3.s #as: --x32 -#ld: -shared -m elf32_x86_64 -z ibt -#readelf: -n +#ld: -shared -m elf32_x86_64 -z ibt --hash-style=sysv +#readelf: -wf -n + +Contents of the .eh_frame section: + +0+ 00000014 00000000 CIE + Version: 1 + Augmentation: "zR" + Code alignment factor: 1 + Data alignment factor: -8 + Return address column: 16 + Augmentation data: 1b + + DW_CFA_def_cfa: r7 \(rsp\) ofs 8 + DW_CFA_offset: r16 \(rip\) at cfa-8 + DW_CFA_nop + DW_CFA_nop + +0+18 00000014 0000001c FDE cie=00000000 pc=00000210..00000222 + DW_CFA_advance_loc: 4 to 00000214 + DW_CFA_def_cfa_offset: 16 + DW_CFA_advance_loc: 9 to 0000021d + DW_CFA_def_cfa_offset: 8 + DW_CFA_nop + +0+30 00000020 00000034 FDE cie=00000000 pc=000001c0..000001f0 + DW_CFA_def_cfa_offset: 16 + DW_CFA_advance_loc: 6 to 000001c6 + DW_CFA_def_cfa_offset: 24 + DW_CFA_advance_loc: 10 to 000001d0 + DW_CFA_def_cfa_expression \(DW_OP_breg7 \(rsp\): 8; DW_OP_breg16 \(rip\): 0; DW_OP_lit15; DW_OP_and; DW_OP_lit9; DW_OP_ge; DW_OP_lit3; DW_OP_shl; DW_OP_plus\) + +0+54 00000010 00000058 FDE cie=00000000 pc=000001f0..00000210 + DW_CFA_nop + DW_CFA_nop + DW_CFA_nop + Displaying notes found in: .note.gnu.property Owner Data size Description diff --git a/ld/testsuite/ld-x86-64/ibt-plt-3d.d b/ld/testsuite/ld-x86-64/ibt-plt-3d.d index 342626a..d5cade0 100644 --- a/ld/testsuite/ld-x86-64/ibt-plt-3d.d +++ b/ld/testsuite/ld-x86-64/ibt-plt-3d.d @@ -1,7 +1,46 @@ #source: ibt-plt-3.s #as: --64 -defsym __64_bit__=1 -#ld: -shared -m elf_x86_64 -z ibt -#readelf: -n +#ld: -shared -m elf_x86_64 -z ibt --hash-style=sysv +#readelf: -wf -n + +Contents of the .eh_frame section: + +0+ 0000000000000014 00000000 CIE + Version: 1 + Augmentation: "zR" + Code alignment factor: 1 + Data alignment factor: -8 + Return address column: 16 + Augmentation data: 1b + + DW_CFA_def_cfa: r7 \(rsp\) ofs 8 + DW_CFA_offset: r16 \(rip\) at cfa-8 + DW_CFA_nop + DW_CFA_nop + +0+18 0000000000000014 0000001c FDE cie=00000000 pc=00000000000002e0..00000000000002f2 + DW_CFA_advance_loc: 4 to 00000000000002e4 + DW_CFA_def_cfa_offset: 16 + DW_CFA_advance_loc: 9 to 00000000000002ed + DW_CFA_def_cfa_offset: 8 + DW_CFA_nop + +0+30 0000000000000024 00000034 FDE cie=00000000 pc=0000000000000290..00000000000002c0 + DW_CFA_def_cfa_offset: 16 + DW_CFA_advance_loc: 6 to 0000000000000296 + DW_CFA_def_cfa_offset: 24 + DW_CFA_advance_loc: 10 to 00000000000002a0 + DW_CFA_def_cfa_expression \(DW_OP_breg7 \(rsp\): 8; DW_OP_breg16 \(rip\): 0; DW_OP_lit15; DW_OP_and; DW_OP_lit10; DW_OP_ge; DW_OP_lit3; DW_OP_shl; DW_OP_plus\) + DW_CFA_nop + DW_CFA_nop + DW_CFA_nop + DW_CFA_nop + +0+58 0000000000000010 0000005c FDE cie=00000000 pc=00000000000002c0..00000000000002e0 + DW_CFA_nop + DW_CFA_nop + DW_CFA_nop + Displaying notes found in: .note.gnu.property Owner Data size Description diff --git a/ld/testsuite/ld-x86-64/ilp32-11.d b/ld/testsuite/ld-x86-64/ilp32-11.d index f6fc86c..bc6c8a8 100644 --- a/ld/testsuite/ld-x86-64/ilp32-11.d +++ b/ld/testsuite/ld-x86-64/ilp32-11.d @@ -1,3 +1,3 @@ #as: --x32 #ld: -shared -melf32_x86_64 -#error: .*addend 0x7fffffff in relocation R_X86_64_64 against symbol `func' at 0x0 in section `.data.rel.local' is out of range +#error: .*addend 0x7fffffff in relocation R_X86_64_64 against symbol `func' at 0 in section `.data.rel.local' is out of range diff --git a/ld/testsuite/ld-x86-64/ilp32-4-nacl.d b/ld/testsuite/ld-x86-64/ilp32-4-nacl.d index f560ae3..92c1f9c 100644 --- a/ld/testsuite/ld-x86-64/ilp32-4-nacl.d +++ b/ld/testsuite/ld-x86-64/ilp32-4-nacl.d @@ -1,6 +1,6 @@ #source: ilp32-4.s #as: --x32 -#ld: -m elf32_x86_64_nacl -shared --no-ld-generated-unwind-info +#ld: -m elf32_x86_64_nacl -shared --no-ld-generated-unwind-info --hash-style=sysv #readelf: -d -S --wide #target: x86_64-*-nacl* diff --git a/ld/testsuite/ld-x86-64/ilp32-4.d b/ld/testsuite/ld-x86-64/ilp32-4.d index 658ad49..00d54c4 100644 --- a/ld/testsuite/ld-x86-64/ilp32-4.d +++ b/ld/testsuite/ld-x86-64/ilp32-4.d @@ -1,5 +1,5 @@ #as: --x32 -#ld: -m elf32_x86_64 -shared --no-ld-generated-unwind-info +#ld: -m elf32_x86_64 -shared --no-ld-generated-unwind-info --hash-style=sysv #readelf: -d -S --wide #target: x86_64-*-linux* diff --git a/ld/testsuite/ld-x86-64/load1c-nacl.d b/ld/testsuite/ld-x86-64/load1c-nacl.d index 57bc2c2..1ce80b4 100644 --- a/ld/testsuite/ld-x86-64/load1c-nacl.d +++ b/ld/testsuite/ld-x86-64/load1c-nacl.d @@ -1,6 +1,6 @@ #source: load1.s #as: --64 -#ld: -shared -melf_x86_64 +#ld: -shared -melf_x86_64 --hash-style=sysv #objdump: -dw #target: x86_64-*-nacl* diff --git a/ld/testsuite/ld-x86-64/load1c.d b/ld/testsuite/ld-x86-64/load1c.d index a4f7d8a..65f7eed 100644 --- a/ld/testsuite/ld-x86-64/load1c.d +++ b/ld/testsuite/ld-x86-64/load1c.d @@ -1,6 +1,6 @@ #source: load1.s #as: --64 -#ld: -shared -melf_x86_64 +#ld: -shared -melf_x86_64 --hash-style=sysv #objdump: -dw #notarget: x86_64-*-nacl* diff --git a/ld/testsuite/ld-x86-64/load1d-nacl.d b/ld/testsuite/ld-x86-64/load1d-nacl.d index b741917..19fea1a 100644 --- a/ld/testsuite/ld-x86-64/load1d-nacl.d +++ b/ld/testsuite/ld-x86-64/load1d-nacl.d @@ -1,6 +1,6 @@ #source: load1.s #as: --x32 -#ld: -shared -melf32_x86_64 +#ld: -shared -melf32_x86_64 --hash-style=sysv #objdump: -dw #target: x86_64-*-nacl* diff --git a/ld/testsuite/ld-x86-64/load1d.d b/ld/testsuite/ld-x86-64/load1d.d index ee1e3f0..2620c02 100644 --- a/ld/testsuite/ld-x86-64/load1d.d +++ b/ld/testsuite/ld-x86-64/load1d.d @@ -1,6 +1,6 @@ #source: load1.s #as: --x32 -#ld: -shared -melf32_x86_64 +#ld: -shared -melf32_x86_64 --hash-style=sysv #objdump: -dw #notarget: x86_64-*-nacl* diff --git a/ld/testsuite/ld-x86-64/mpx.exp b/ld/testsuite/ld-x86-64/mpx.exp index 1ba08e0..e3c0b5e 100644 --- a/ld/testsuite/ld-x86-64/mpx.exp +++ b/ld/testsuite/ld-x86-64/mpx.exp @@ -107,23 +107,23 @@ set run_tests { run_ld_link_tests { {"Build libcall.so" - "-m elf_x86_64 -shared -z bndplt" "" "--64" - {mpx3b.s} {} "libcall.so"} + "-m elf_x86_64 -shared -z bndplt" "" + "--64" {mpx3b.s} {} "libcall.so"} {"Build mpx3" - "-m elf_x86_64 -z bndplt tmpdir/libcall.so" "" "--64" - {mpx3a.s} {{objdump -dw mpx3.dd}} "mpx3"} + "-m elf_x86_64 -z bndplt tmpdir/libcall.so" "" + "--64" {mpx3a.s} {{objdump -dw mpx3.dd}} "mpx3"} {"Build libcall1.so" - "-m elf_x86_64 -shared -z bndplt" "" "--64" - {mpx4b.s} {} "libcall1.so"} + "-m elf_x86_64 -shared -z bndplt" "" + "--64" {mpx4b.s} {} "libcall1.so"} {"Build mpx4" - "-m elf_x86_64 -z bndplt tmpdir/libcall1.so" "" "--64" - {mpx4a.s} {{objdump -dw mpx4.dd}} "mpx4"} + "-m elf_x86_64 -z bndplt --hash-style=sysv tmpdir/libcall1.so" "" + "--64" {mpx4a.s} {{objdump -dw mpx4.dd}} "mpx4"} {"Build mpx3 (-z now)" - "-z now -m elf_x86_64 -z bndplt tmpdir/libcall.so" "" "--64" - {mpx3a.s} {{objdump -dw mpx3n.dd}} "mpx3n"} + "-z now -m elf_x86_64 -z bndplt --hash-style=sysv tmpdir/libcall.so" "" + "--64" {mpx3a.s} {{objdump -dw mpx3n.dd}} "mpx3n"} {"Build mpx4 (-z now)" - "-z now -m elf_x86_64 -z bndplt tmpdir/libcall1.so" "" "--64" - {mpx4a.s} {{objdump -dw mpx4n.dd}} "mpx4n"} + "-z now -m elf_x86_64 -z bndplt --hash-style=sysv tmpdir/libcall1.so" "" + "--64" {mpx4a.s} {{objdump -dw mpx4n.dd}} "mpx4n"} } run_ld_link_exec_tests $run_tests diff --git a/ld/testsuite/ld-x86-64/pie2.d b/ld/testsuite/ld-x86-64/pie2.d index ef9f58a..9532141 100644 --- a/ld/testsuite/ld-x86-64/pie2.d +++ b/ld/testsuite/ld-x86-64/pie2.d @@ -1,3 +1,3 @@ #as: --64 #ld: -pie -melf_x86_64 -#error: .*relocation R_X86_64_32 against symbol `foo' can not be used when making a shared object; recompile with -fPIC +#error: .*relocation R_X86_64_32 against symbol `foo' can not be used when making a PIE object; recompile with -fPIC diff --git a/ld/testsuite/ld-x86-64/pie3-nacl.d b/ld/testsuite/ld-x86-64/pie3-nacl.d new file mode 100644 index 0000000..efb74ed --- /dev/null +++ b/ld/testsuite/ld-x86-64/pie3-nacl.d @@ -0,0 +1,14 @@ +#source: pie3.s +#as: --64 +#ld: -pie -melf_x86_64 --hash-style=sysv +#objdump: -dw +#target: x86_64-*-nacl* + +.*: +file format .* + + +Disassembly of section .text: + +0+ <_start>: + +0: 48 8d 05 f9 ff ff ff lea -0x7\(%rip\),%rax # 0 <_start> +#pass diff --git a/ld/testsuite/ld-x86-64/pie3.d b/ld/testsuite/ld-x86-64/pie3.d new file mode 100644 index 0000000..7bc1ccb --- /dev/null +++ b/ld/testsuite/ld-x86-64/pie3.d @@ -0,0 +1,13 @@ +#as: --64 +#ld: -pie -melf_x86_64 --hash-style=sysv +#objdump: -dw +#notarget: x86_64-*-nacl* + +.*: +file format .* + + +Disassembly of section .text: + +0+191 <_start>: + +191: 48 8d 05 68 fe ff ff lea -0x198\(%rip\),%rax # 0 <_start-0x191> +#pass diff --git a/ld/testsuite/ld-x86-64/pie3.s b/ld/testsuite/ld-x86-64/pie3.s new file mode 100644 index 0000000..72914d9 --- /dev/null +++ b/ld/testsuite/ld-x86-64/pie3.s @@ -0,0 +1,5 @@ + .text + .global _start + .weak foo +_start: + leaq foo(%rip), %rax diff --git a/ld/testsuite/ld-x86-64/plt-main-bnd.dd b/ld/testsuite/ld-x86-64/plt-main-bnd.dd index 9e03dfd..c5ef1b3 100644 --- a/ld/testsuite/ld-x86-64/plt-main-bnd.dd +++ b/ld/testsuite/ld-x86-64/plt-main-bnd.dd @@ -1,7 +1,7 @@ #... Disassembly of section .plt.got: -[a-f0-9]+ <[a-z]+@plt>: +[a-f0-9]+ <[a-z_]+@plt>: [ ]*[a-f0-9]+: f2 ff 25 .. .. 20 00 bnd jmpq \*0x20....\(%rip\) # ...... <.*> [ ]*[a-f0-9]+: 90 nop #pass diff --git a/ld/testsuite/ld-x86-64/pr14207.d b/ld/testsuite/ld-x86-64/pr14207.d index f6558e7..b71d705 100644 --- a/ld/testsuite/ld-x86-64/pr14207.d +++ b/ld/testsuite/ld-x86-64/pr14207.d @@ -1,6 +1,6 @@ #name: PR ld/14207 #as: --64 -#ld: -melf_x86_64 -shared -z relro -z now +#ld: -melf_x86_64 -shared -z relro -z now --hash-style=sysv #readelf: -l --wide #target: x86_64-*-linux* diff --git a/ld/testsuite/ld-x86-64/pr17618.d b/ld/testsuite/ld-x86-64/pr17618.d index b090aa0..e640b40 100644 --- a/ld/testsuite/ld-x86-64/pr17618.d +++ b/ld/testsuite/ld-x86-64/pr17618.d @@ -1,5 +1,4 @@ #name: PLT PC-relative offset overflow check #as: --64 #ld: -shared -melf_x86_64 -#notarget: x86_64-*-linux*-gnux32 #error: .*PC-relative offset overflow in PLT entry for `bar' diff --git a/ld/testsuite/ld-x86-64/pr19162.d b/ld/testsuite/ld-x86-64/pr19162.d index 42cd6c3..6916a51 100644 --- a/ld/testsuite/ld-x86-64/pr19162.d +++ b/ld/testsuite/ld-x86-64/pr19162.d @@ -1,7 +1,7 @@ #source: pr19162a.s #source: pr19162b.s #as: --64 -#ld: -melf_x86_64 -shared -z max-page-size=0x200000 -z common-page-size=0x1000 +#ld: -melf_x86_64 -shared -z max-page-size=0x200000 -z common-page-size=0x1000 --hash-style=sysv #readelf: -l --wide #target: x86_64-*-linux* diff --git a/ld/testsuite/ld-x86-64/pr19609-2a.d b/ld/testsuite/ld-x86-64/pr19609-2a.d index e2c6c89..2bed641 100644 --- a/ld/testsuite/ld-x86-64/pr19609-2a.d +++ b/ld/testsuite/ld-x86-64/pr19609-2a.d @@ -1,4 +1,4 @@ #source: pr19609-2.s #as: --64 -mrelax-relocations=yes #ld: -melf_x86_64 -Ttext=0x70000000 -Tdata=0xa0000000 -#error: .*relocation truncated to fit: R_X86_64_32S .* +#error: failed to convert GOTPCREL relocation; relink with --no-relax diff --git a/ld/testsuite/ld-x86-64/pr19609-2b.d b/ld/testsuite/ld-x86-64/pr19609-2b.d index ead4987..3741ebb 100644 --- a/ld/testsuite/ld-x86-64/pr19609-2b.d +++ b/ld/testsuite/ld-x86-64/pr19609-2b.d @@ -1,4 +1,4 @@ #source: pr19609-2.s #as: --x32 -mrelax-relocations=yes #ld: -melf32_x86_64 -Ttext=0x70000000 -Tdata=0xa0000000 -#error: .*relocation truncated to fit: R_X86_64_32S .* +#error: failed to convert GOTPCREL relocation; relink with --no-relax diff --git a/ld/testsuite/ld-x86-64/pr19609-4a.d b/ld/testsuite/ld-x86-64/pr19609-4a.d index ce952ed..f08843c 100644 --- a/ld/testsuite/ld-x86-64/pr19609-4a.d +++ b/ld/testsuite/ld-x86-64/pr19609-4a.d @@ -1,5 +1,4 @@ #source: pr19609-4.s #as: --64 -mrelax-relocations=yes #ld: -melf_x86_64 -Ttext=0x70000000 -Tdata=0xa0000000 -#error: .*relocation truncated to fit: R_X86_64_32S .* -#error: .*relocation truncated to fit: R_X86_64_32S .* +#error: failed to convert GOTPCREL relocation; relink with --no-relax diff --git a/ld/testsuite/ld-x86-64/pr19609-4c.d b/ld/testsuite/ld-x86-64/pr19609-4c.d index ce952ed..f08843c 100644 --- a/ld/testsuite/ld-x86-64/pr19609-4c.d +++ b/ld/testsuite/ld-x86-64/pr19609-4c.d @@ -1,5 +1,4 @@ #source: pr19609-4.s #as: --64 -mrelax-relocations=yes #ld: -melf_x86_64 -Ttext=0x70000000 -Tdata=0xa0000000 -#error: .*relocation truncated to fit: R_X86_64_32S .* -#error: .*relocation truncated to fit: R_X86_64_32S .* +#error: failed to convert GOTPCREL relocation; relink with --no-relax diff --git a/ld/testsuite/ld-x86-64/pr19609-4e.d b/ld/testsuite/ld-x86-64/pr19609-4e.d index 527fe5d..f263494 100644 --- a/ld/testsuite/ld-x86-64/pr19609-4e.d +++ b/ld/testsuite/ld-x86-64/pr19609-4e.d @@ -9,5 +9,5 @@ Disassembly of section .text: 0+70000000 <_start>: -[ ]*[a-f0-9]+: 48 8d 05 f9 ff ff 2f lea 0x2ffffff9\(%rip\),%rax # a0000000 <foo> -[ ]*[a-f0-9]+: 4c 8d 1d f2 ff ff 2f lea 0x2ffffff2\(%rip\),%r11 # a0000000 <foo> +[ ]*[a-f0-9]+: 48 8b 05 ([0-9a-f]{2} ){4} * mov [-]?0x[a-f0-9]+\(%rip\),%rax # [a-f0-9]+ <.got> +[ ]*[a-f0-9]+: 4c 8b 1d ([0-9a-f]{2} ){4} * mov [-]?0x[a-f0-9]+\(%rip\),%r11 # [a-f0-9]+ <.got> diff --git a/ld/testsuite/ld-x86-64/pr19609-5d.d b/ld/testsuite/ld-x86-64/pr19609-5d.d index 959c63e..608c97b 100644 --- a/ld/testsuite/ld-x86-64/pr19609-5d.d +++ b/ld/testsuite/ld-x86-64/pr19609-5d.d @@ -1,4 +1,4 @@ #source: pr19609-5.s #as: --64 -mrelax-relocations=yes #ld: -melf_x86_64 -Ttext=0x80000000 -#error: .*relocation truncated to fit: R_X86_64_PC32 .* +#error: failed to convert GOTPCREL relocation; relink with --no-relax diff --git a/ld/testsuite/ld-x86-64/pr19609-6a.d b/ld/testsuite/ld-x86-64/pr19609-6a.d index 4802ffe..3c011d9 100644 --- a/ld/testsuite/ld-x86-64/pr19609-6a.d +++ b/ld/testsuite/ld-x86-64/pr19609-6a.d @@ -1,4 +1,4 @@ #source: pr19609-6.s #as: --64 -mrelax-relocations=yes #ld: -melf_x86_64 --defsym foobar=0x80000000 -#error: .*relocation truncated to fit: R_X86_64_32S .* +#error: failed to convert GOTPCREL relocation; relink with --no-relax diff --git a/ld/testsuite/ld-x86-64/pr19609-7a.d b/ld/testsuite/ld-x86-64/pr19609-7a.d index d960572..015a6ff 100644 --- a/ld/testsuite/ld-x86-64/pr19609-7a.d +++ b/ld/testsuite/ld-x86-64/pr19609-7a.d @@ -1,4 +1,4 @@ #source: pr19609-7.s #as: --64 -mrelax-relocations=yes #ld: -melf_x86_64 -Ttext=0x80000000 -#error: .*relocation truncated to fit: R_X86_64_PC32 .* +#error: failed to convert GOTPCREL relocation; relink with --no-relax diff --git a/ld/testsuite/ld-x86-64/pr19609-7c.d b/ld/testsuite/ld-x86-64/pr19609-7c.d index 8bd919a..ff60049 100644 --- a/ld/testsuite/ld-x86-64/pr19609-7c.d +++ b/ld/testsuite/ld-x86-64/pr19609-7c.d @@ -1,4 +1,4 @@ #source: pr19609-7.s #as: --x32 -mrelax-relocations=yes #ld: -melf32_x86_64 -Ttext=0x80000000 -#error: .*relocation truncated to fit: R_X86_64_PC32 .* +#error: failed to convert GOTPCREL relocation; relink with --no-relax diff --git a/ld/testsuite/ld-x86-64/pr19636-2d-nacl.d b/ld/testsuite/ld-x86-64/pr19636-2d-nacl.d index 1bdbd8c..f584bda 100644 --- a/ld/testsuite/ld-x86-64/pr19636-2d-nacl.d +++ b/ld/testsuite/ld-x86-64/pr19636-2d-nacl.d @@ -1,6 +1,6 @@ #source: pr19636-2.s #as: --64 -mrelax-relocations=no -#ld: -pie -m elf_x86_64 --no-dynamic-linker +#ld: -pie -m elf_x86_64 --no-dynamic-linker --hash-style=sysv #objdump: -dw #target: x86_64-*-nacl* diff --git a/ld/testsuite/ld-x86-64/pr19636-2d.d b/ld/testsuite/ld-x86-64/pr19636-2d.d index 4f5c1f0..6f589ab 100644 --- a/ld/testsuite/ld-x86-64/pr19636-2d.d +++ b/ld/testsuite/ld-x86-64/pr19636-2d.d @@ -1,6 +1,6 @@ #source: pr19636-2.s #as: --64 -mrelax-relocations=no -#ld: -pie -m elf_x86_64 --no-dynamic-linker +#ld: -pie -m elf_x86_64 --no-dynamic-linker --hash-style=sysv #objdump: -dw #notarget: x86_64-*-nacl* diff --git a/ld/testsuite/ld-x86-64/pr19719.d b/ld/testsuite/ld-x86-64/pr19719.d index b2daf0e..03cfc15 100644 --- a/ld/testsuite/ld-x86-64/pr19719.d +++ b/ld/testsuite/ld-x86-64/pr19719.d @@ -1,3 +1,3 @@ #as: --64 #ld: -pie -melf_x86_64 -#error: .*relocation R_X86_64_32 against undefined symbol `foo' can not be used when making a shared object; recompile with -fPIC +#error: .*relocation R_X86_64_32 against undefined symbol `foo' can not be used when making a PIE object; recompile with -fPIC diff --git a/ld/testsuite/ld-x86-64/pr19807-2a.d b/ld/testsuite/ld-x86-64/pr19807-2a.d index 1357d72..c99852a 100644 --- a/ld/testsuite/ld-x86-64/pr19807-2a.d +++ b/ld/testsuite/ld-x86-64/pr19807-2a.d @@ -1,4 +1,4 @@ #source: pr19807-2.s #as: --64 #ld: -pie -melf_x86_64 -#error: .*relocation R_X86_64_32 against `.data' can not be used when making a shared object; recompile with -fPIC +#error: .*relocation R_X86_64_32 against `.data' can not be used when making a PIE object; recompile with -fPIC diff --git a/ld/testsuite/ld-x86-64/pr19969.d b/ld/testsuite/ld-x86-64/pr19969.d index c56af2f..1aea67c 100644 --- a/ld/testsuite/ld-x86-64/pr19969.d +++ b/ld/testsuite/ld-x86-64/pr19969.d @@ -1,4 +1,4 @@ #source: pr19969b.S #as: --64 #ld: -melf_x86_64 tmpdir/pr19969.so -#error: .*relocation R_X86_64_32 against symbol `foo' can not be used when making a shared object; recompile with -fPIC +#error: .*relocation R_X86_64_32 against symbol `foo' can not be used when making a PDE object; recompile with -fPIC diff --git a/ld/testsuite/ld-x86-64/pr20253-1d.d b/ld/testsuite/ld-x86-64/pr20253-1d.d index 6953c79..158178d 100644 --- a/ld/testsuite/ld-x86-64/pr20253-1d.d +++ b/ld/testsuite/ld-x86-64/pr20253-1d.d @@ -1,6 +1,6 @@ #source: pr20253-1.s #as: --64 -#ld: -pie -melf_x86_64 +#ld: -pie -melf_x86_64 --hash-style=sysv #objdump: -dw #notarget: x86_64-*-nacl* diff --git a/ld/testsuite/ld-x86-64/pr20253-1f.d b/ld/testsuite/ld-x86-64/pr20253-1f.d index 9319350..f1ffbab 100644 --- a/ld/testsuite/ld-x86-64/pr20253-1f.d +++ b/ld/testsuite/ld-x86-64/pr20253-1f.d @@ -1,6 +1,6 @@ #source: pr20253-1.s #as: --64 -#ld: -shared -melf_x86_64 +#ld: -shared -melf_x86_64 --hash-style=sysv #objdump: -dw #notarget: x86_64-*-nacl* diff --git a/ld/testsuite/ld-x86-64/pr20253-1j.d b/ld/testsuite/ld-x86-64/pr20253-1j.d index 5662e0c..b22d26a 100644 --- a/ld/testsuite/ld-x86-64/pr20253-1j.d +++ b/ld/testsuite/ld-x86-64/pr20253-1j.d @@ -1,6 +1,6 @@ #source: pr20253-1.s #as: --x32 -#ld: -pie -melf32_x86_64 +#ld: -pie -melf32_x86_64 --hash-style=sysv #objdump: -dw #notarget: x86_64-*-nacl* diff --git a/ld/testsuite/ld-x86-64/pr20253-1l.d b/ld/testsuite/ld-x86-64/pr20253-1l.d index 83a61db..cef309e 100644 --- a/ld/testsuite/ld-x86-64/pr20253-1l.d +++ b/ld/testsuite/ld-x86-64/pr20253-1l.d @@ -1,6 +1,6 @@ #source: pr20253-1.s #as: --x32 -#ld: -shared -melf32_x86_64 +#ld: -shared -melf32_x86_64 --hash-style=sysv #objdump: -dw #notarget: x86_64-*-nacl* diff --git a/ld/testsuite/ld-x86-64/pr20830a-now.d b/ld/testsuite/ld-x86-64/pr20830a-now.d index fda0d50..d2e99ab 100644 --- a/ld/testsuite/ld-x86-64/pr20830a-now.d +++ b/ld/testsuite/ld-x86-64/pr20830a-now.d @@ -1,7 +1,7 @@ #name: PR ld/20830 (.plt.got, -z now) #source: pr20830.s #as: --64 -#ld: -z now -melf_x86_64 -shared -z relro --ld-generated-unwind-info +#ld: -z now -melf_x86_64 -shared -z relro --ld-generated-unwind-info --hash-style=sysv #objdump: -dw -Wf .*: +file format .* diff --git a/ld/testsuite/ld-x86-64/pr20830a.d b/ld/testsuite/ld-x86-64/pr20830a.d index 3122ba7..8ae6b71 100644 --- a/ld/testsuite/ld-x86-64/pr20830a.d +++ b/ld/testsuite/ld-x86-64/pr20830a.d @@ -1,7 +1,7 @@ #name: PR ld/20830 (.plt.got) #source: pr20830.s #as: --64 -#ld: -melf_x86_64 -shared -z relro --ld-generated-unwind-info +#ld: -melf_x86_64 -shared -z relro --ld-generated-unwind-info --hash-style=sysv #objdump: -dw -Wf .*: +file format .* diff --git a/ld/testsuite/ld-x86-64/pr20830b-now.d b/ld/testsuite/ld-x86-64/pr20830b-now.d index 69120e1..bd9abc4 100644 --- a/ld/testsuite/ld-x86-64/pr20830b-now.d +++ b/ld/testsuite/ld-x86-64/pr20830b-now.d @@ -1,7 +1,7 @@ #name: PR ld/20830 (.plt.got, -z now) #source: pr20830.s #as: --x32 -#ld: -z now -melf32_x86_64 -shared -z relro --ld-generated-unwind-info +#ld: -z now -melf32_x86_64 -shared -z relro --ld-generated-unwind-info --hash-style=sysv #objdump: -dw -Wf .*: +file format .* diff --git a/ld/testsuite/ld-x86-64/pr20830b.d b/ld/testsuite/ld-x86-64/pr20830b.d index 0bb79a3..83067e0 100644 --- a/ld/testsuite/ld-x86-64/pr20830b.d +++ b/ld/testsuite/ld-x86-64/pr20830b.d @@ -1,7 +1,7 @@ #name: PR ld/20830 (.plt.got) #source: pr20830.s #as: --x32 -#ld: -melf32_x86_64 -shared -z relro --ld-generated-unwind-info +#ld: -melf32_x86_64 -shared -z relro --ld-generated-unwind-info --hash-style=sysv #objdump: -dw -Wf .*: +file format .* diff --git a/ld/testsuite/ld-x86-64/pr21038a-now.d b/ld/testsuite/ld-x86-64/pr21038a-now.d index ebc5128..1d5bec1 100644 --- a/ld/testsuite/ld-x86-64/pr21038a-now.d +++ b/ld/testsuite/ld-x86-64/pr21038a-now.d @@ -1,7 +1,7 @@ #name: PR ld/21038 (.plt.got, -z now) #source: pr21038a.s #as: --64 -#ld: -z now -z bndplt -melf_x86_64 -shared -z relro --ld-generated-unwind-info +#ld: -z now -z bndplt -melf_x86_64 -shared -z relro --ld-generated-unwind-info --hash-style=sysv #objdump: -dw -Wf .*: +file format .* @@ -41,11 +41,7 @@ Contents of the .eh_frame section: DW_CFA_nop DW_CFA_nop -0+58 0000000000000014 0000005c FDE cie=00000000 pc=0000000000000230..0000000000000238 - DW_CFA_nop - DW_CFA_nop - DW_CFA_nop - DW_CFA_nop +0+58 0000000000000010 0000005c FDE cie=00000000 pc=0000000000000230..0000000000000238 DW_CFA_nop DW_CFA_nop DW_CFA_nop diff --git a/ld/testsuite/ld-x86-64/pr21038a.d b/ld/testsuite/ld-x86-64/pr21038a.d index 81b26cb..01770ec 100644 --- a/ld/testsuite/ld-x86-64/pr21038a.d +++ b/ld/testsuite/ld-x86-64/pr21038a.d @@ -1,6 +1,6 @@ #name: PR ld/21038 (.plt.got) #as: --64 -#ld: -z bndplt -melf_x86_64 -shared -z relro --ld-generated-unwind-info +#ld: -z bndplt -melf_x86_64 -shared -z relro --ld-generated-unwind-info --hash-style=sysv #objdump: -dw -Wf .*: +file format .* @@ -40,11 +40,7 @@ Contents of the .eh_frame section: DW_CFA_nop DW_CFA_nop -0+58 0000000000000014 0000005c FDE cie=00000000 pc=0000000000000230..0000000000000238 - DW_CFA_nop - DW_CFA_nop - DW_CFA_nop - DW_CFA_nop +0+58 0000000000000010 0000005c FDE cie=00000000 pc=0000000000000230..0000000000000238 DW_CFA_nop DW_CFA_nop DW_CFA_nop diff --git a/ld/testsuite/ld-x86-64/pr21038b-now.d b/ld/testsuite/ld-x86-64/pr21038b-now.d index b9a8c4d..914b123 100644 --- a/ld/testsuite/ld-x86-64/pr21038b-now.d +++ b/ld/testsuite/ld-x86-64/pr21038b-now.d @@ -1,7 +1,7 @@ #name: PR ld/21038 (.plt.sec, -z now) #source: pr21038b.s #as: --64 -#ld: -z now -z bndplt -melf_x86_64 -shared -z relro --ld-generated-unwind-info +#ld: -z now -z bndplt -melf_x86_64 -shared -z relro --ld-generated-unwind-info --hash-style=sysv #objdump: -dw -Wf .*: +file format .* diff --git a/ld/testsuite/ld-x86-64/pr21038b.d b/ld/testsuite/ld-x86-64/pr21038b.d index 3457d4d..faeaf45 100644 --- a/ld/testsuite/ld-x86-64/pr21038b.d +++ b/ld/testsuite/ld-x86-64/pr21038b.d @@ -1,6 +1,6 @@ #name: PR ld/21038 (.plt.sec) #as: --64 -#ld: -z bndplt -melf_x86_64 -shared -z relro --ld-generated-unwind-info +#ld: -z bndplt -melf_x86_64 -shared -z relro --ld-generated-unwind-info --hash-style=sysv #objdump: -dw -Wf .*: +file format .* diff --git a/ld/testsuite/ld-x86-64/pr21038c-now.d b/ld/testsuite/ld-x86-64/pr21038c-now.d index 4b6db6f..640e821 100644 --- a/ld/testsuite/ld-x86-64/pr21038c-now.d +++ b/ld/testsuite/ld-x86-64/pr21038c-now.d @@ -1,7 +1,7 @@ #name: PR ld/21038 (.plt.got and .plt.sec, -z now) #source: pr21038c.s #as: --64 -#ld: -z now -z bndplt -melf_x86_64 -shared -z relro --ld-generated-unwind-info +#ld: -z now -z bndplt -melf_x86_64 -shared -z relro --ld-generated-unwind-info --hash-style=sysv #objdump: -dw -Wf .*: +file format .* diff --git a/ld/testsuite/ld-x86-64/pr21038c.d b/ld/testsuite/ld-x86-64/pr21038c.d index eb6f207..4b0bd89 100644 --- a/ld/testsuite/ld-x86-64/pr21038c.d +++ b/ld/testsuite/ld-x86-64/pr21038c.d @@ -1,6 +1,6 @@ #name: PR ld/21038 (.plt.got and .plt.sec) #as: --64 -#ld: -z bndplt -melf_x86_64 -shared -z relro --ld-generated-unwind-info +#ld: -z bndplt -melf_x86_64 -shared -z relro --ld-generated-unwind-info --hash-style=sysv #objdump: -dw -Wf .*: +file format .* diff --git a/ld/testsuite/ld-x86-64/pr21884-nacl.d b/ld/testsuite/ld-x86-64/pr21884-nacl.d new file mode 100644 index 0000000..8883505 --- /dev/null +++ b/ld/testsuite/ld-x86-64/pr21884-nacl.d @@ -0,0 +1,10 @@ +#source: dummy.s +#as: --64 +#ld: -m elf_x86_64 -T pr21884-nacl.t -b binary +#objdump: -b binary -s +#target: x86_64-*-nacl* + +.*: file format binary + +Contents of section .data: +#pass diff --git a/ld/testsuite/ld-x86-64/pr21884-nacl.t b/ld/testsuite/ld-x86-64/pr21884-nacl.t new file mode 100644 index 0000000..722312e --- /dev/null +++ b/ld/testsuite/ld-x86-64/pr21884-nacl.t @@ -0,0 +1,11 @@ +OUTPUT_FORMAT("elf64-x86-64-nacl"); +OUTPUT_ARCH(i386:x86-64); + +ENTRY(_start); +SECTIONS { + . = 0x10000; + _start = . ; + .data : { + *(.data) + } +} diff --git a/ld/testsuite/ld-x86-64/pr21884.d b/ld/testsuite/ld-x86-64/pr21884.d new file mode 100644 index 0000000..7a2a3f3 --- /dev/null +++ b/ld/testsuite/ld-x86-64/pr21884.d @@ -0,0 +1,10 @@ +#source: dummy.s +#as: --64 +#ld: -m elf_x86_64 -T pr21884.t -b binary +#objdump: -b binary -s +#notarget: x86_64-*-nacl* + +.*: file format binary + +Contents of section .data: +#pass diff --git a/ld/testsuite/ld-x86-64/pr21884.t b/ld/testsuite/ld-x86-64/pr21884.t new file mode 100644 index 0000000..edd2070 --- /dev/null +++ b/ld/testsuite/ld-x86-64/pr21884.t @@ -0,0 +1,11 @@ +OUTPUT_FORMAT("elf64-x86-64"); +OUTPUT_ARCH(i386:x86-64); + +ENTRY(_start); +SECTIONS { + . = 0x10000; + _start = . ; + .data : { + *(.data) + } +} diff --git a/ld/testsuite/ld-x86-64/pr21997-1a.S b/ld/testsuite/ld-x86-64/pr21997-1a.S new file mode 100644 index 0000000..cab99a9 --- /dev/null +++ b/ld/testsuite/ld-x86-64/pr21997-1a.S @@ -0,0 +1,24 @@ + .text + .p2align 4,,15 + .globl get_protected + .type get_protected, @function +get_protected: + movl protected(%rip), %eax + ret + .size get_protected, .-get_protected + .p2align 4,,15 + .globl get_protected_p + .type get_protected_p, @function +get_protected_p: + leaq protected(%rip), %rax + ret + .size get_protected_p, .-get_protected_p + .protected protected + .globl protected + .data + .align 4 + .type protected, @object + .size protected, 4 +protected: + .long 1 + .section .note.GNU-stack,"",@progbits diff --git a/ld/testsuite/ld-x86-64/pr21997-1a.err b/ld/testsuite/ld-x86-64/pr21997-1a.err new file mode 100644 index 0000000..5d663a3 --- /dev/null +++ b/ld/testsuite/ld-x86-64/pr21997-1a.err @@ -0,0 +1,2 @@ +.*relocation R_X86_64_PC32 against protected symbol `protected' can not be used when making a P(D|I)E object; recompile with -fPIC +#... diff --git a/ld/testsuite/ld-x86-64/pr21997-1b.c b/ld/testsuite/ld-x86-64/pr21997-1b.c new file mode 100644 index 0000000..ffed117 --- /dev/null +++ b/ld/testsuite/ld-x86-64/pr21997-1b.c @@ -0,0 +1,13 @@ +#include <stdio.h> + +extern int protected; +extern int get_protected (void); + +int +main () +{ + if (protected == get_protected ()) + printf ("PASS\n"); + + return 0; +} diff --git a/ld/testsuite/ld-x86-64/pr21997-1b.err b/ld/testsuite/ld-x86-64/pr21997-1b.err new file mode 100644 index 0000000..365de67 --- /dev/null +++ b/ld/testsuite/ld-x86-64/pr21997-1b.err @@ -0,0 +1,2 @@ +.*relocation R_X86_64_32S against protected symbol `protected' can not be used when making a P(D|I)E object; recompile with -fPIC +#... diff --git a/ld/testsuite/ld-x86-64/pr21997-1c.c b/ld/testsuite/ld-x86-64/pr21997-1c.c new file mode 100644 index 0000000..6d7b9dc --- /dev/null +++ b/ld/testsuite/ld-x86-64/pr21997-1c.c @@ -0,0 +1,13 @@ +#include <stdio.h> + +extern int protected; +extern int* get_protected_p (void); + +int +main () +{ + if (&protected == get_protected_p ()) + printf ("PASS\n"); + + return 0; +} diff --git a/ld/testsuite/ld-x86-64/pr22001-1a.c b/ld/testsuite/ld-x86-64/pr22001-1a.c new file mode 100644 index 0000000..2b55ea8 --- /dev/null +++ b/ld/testsuite/ld-x86-64/pr22001-1a.c @@ -0,0 +1,13 @@ +int copy = 1; + +int +get_copy () +{ + return copy; +} + +int * +get_copy_p () +{ + return © +} diff --git a/ld/testsuite/ld-x86-64/pr22001-1a.err b/ld/testsuite/ld-x86-64/pr22001-1a.err new file mode 100644 index 0000000..640aa07 --- /dev/null +++ b/ld/testsuite/ld-x86-64/pr22001-1a.err @@ -0,0 +1,2 @@ +.*relocation R_X86_64_PC32 against symbol `copy' can not be used when making a P(D|I)E object; recompile with -fPIC +#... diff --git a/ld/testsuite/ld-x86-64/pr22001-1b.c b/ld/testsuite/ld-x86-64/pr22001-1b.c new file mode 100644 index 0000000..a172236 --- /dev/null +++ b/ld/testsuite/ld-x86-64/pr22001-1b.c @@ -0,0 +1,13 @@ +#include <stdio.h> + +extern int copy; +extern int get_copy (void); + +int +main () +{ + if (copy == get_copy ()) + printf ("PASS\n"); + + return 0; +} diff --git a/ld/testsuite/ld-x86-64/pr22001-1b.err b/ld/testsuite/ld-x86-64/pr22001-1b.err new file mode 100644 index 0000000..9617e73 --- /dev/null +++ b/ld/testsuite/ld-x86-64/pr22001-1b.err @@ -0,0 +1,2 @@ +.*relocation R_X86_64_32S against symbol `copy' can not be used when making a P(D|I)E object; recompile with -fPIC +#... diff --git a/ld/testsuite/ld-x86-64/pr22001-1c.c b/ld/testsuite/ld-x86-64/pr22001-1c.c new file mode 100644 index 0000000..8fd925c --- /dev/null +++ b/ld/testsuite/ld-x86-64/pr22001-1c.c @@ -0,0 +1,12 @@ +#include <stdio.h> + +extern int copy; +extern int* get_copy_p (void); + +int main() +{ + if (© == get_copy_p ()) + printf ("PASS\n"); + + return 0; +} diff --git a/ld/testsuite/ld-x86-64/pr22048.d b/ld/testsuite/ld-x86-64/pr22048.d new file mode 100644 index 0000000..063d305 --- /dev/null +++ b/ld/testsuite/ld-x86-64/pr22048.d @@ -0,0 +1,25 @@ +#source: pr22048a.s +#source: pr22048b.s +#as: --64 +#ld: -melf_x86_64 -Ttext 0x400078 +#readelf: -wf + +Contents of the .eh_frame section: + +0+0000 0+014 0+0000 CIE + Version: 1 + Augmentation: "zR" + Code alignment factor: 1 + Data alignment factor: -8 + Return address column: 16 + Augmentation data: 1b + + DW_CFA_def_cfa: r7 \(rsp\) ofs 8 + DW_CFA_offset: r16 \(rip\) at cfa-8 + DW_CFA_nop + DW_CFA_nop + +0+0018 0+0010 0+001c FDE cie=0+0000 pc=0+400078\.\.0+40007a + DW_CFA_nop + DW_CFA_nop + DW_CFA_nop diff --git a/ld/testsuite/ld-x86-64/pr22048a.s b/ld/testsuite/ld-x86-64/pr22048a.s new file mode 100644 index 0000000..060bd01 --- /dev/null +++ b/ld/testsuite/ld-x86-64/pr22048a.s @@ -0,0 +1,4 @@ + .section .eh_frame,"a",@progbits + .align 4 + .zero 4 + .ident "GCC" diff --git a/ld/testsuite/ld-x86-64/pr22048b.s b/ld/testsuite/ld-x86-64/pr22048b.s new file mode 100644 index 0000000..eae6752 --- /dev/null +++ b/ld/testsuite/ld-x86-64/pr22048b.s @@ -0,0 +1,8 @@ + .text + .globl _start + .type _start, @function +_start: + .cfi_startproc + rep ret + .cfi_endproc + .size _start, .-_start diff --git a/ld/testsuite/ld-x86-64/pr22064a.S b/ld/testsuite/ld-x86-64/pr22064a.S new file mode 100644 index 0000000..8065a11 --- /dev/null +++ b/ld/testsuite/ld-x86-64/pr22064a.S @@ -0,0 +1,33 @@ + .section .rodata.str1.1,"aMS",@progbits,1 +.LC0: + .string "PASS" + .text + .globl main + .type main, @function +main: + movq foo@GOTPCREL(%rip), %rax + cmpl $0, (%rax) + jne .L4 + subq $8, %rsp + call foo_p@PLT + cmpq foo@GOTPCREL(%rip), %rax + jne .L2 + movq bar@GOTPCREL(%rip), %rax + cmpl $-1, (%rax) + jne .L2 + call bar_p@PLT + cmpq bar@GOTPCREL(%rip), %rax + jne .L2 + leaq .LC0(%rip), %rdi + call puts@PLT +.L2: + movl $0, %eax + addq $8, %rsp + ret +.L4: + movl $0, %eax + ret + .size main, .-main + .comm bar,8,4 + .comm foo,4,4 + .section .note.GNU-stack,"",@progbits diff --git a/ld/testsuite/ld-x86-64/pr22064b.c b/ld/testsuite/ld-x86-64/pr22064b.c new file mode 100644 index 0000000..d906545 --- /dev/null +++ b/ld/testsuite/ld-x86-64/pr22064b.c @@ -0,0 +1,14 @@ +int foo[2]; +int bar[2] = { -1, -1 }; + +int * +foo_p (void) +{ + return foo; +} + +int * +bar_p (void) +{ + return bar; +} diff --git a/ld/testsuite/ld-x86-64/pr22071.d b/ld/testsuite/ld-x86-64/pr22071.d new file mode 100644 index 0000000..741a722 --- /dev/null +++ b/ld/testsuite/ld-x86-64/pr22071.d @@ -0,0 +1,8 @@ +#as: --64 +#ld: -melf_x86_64 -shared +#readelf: -d --wide + +#... +.*\(TLSDESC_PLT\).* +.*\(TLSDESC_GOT\).* +#pass diff --git a/ld/testsuite/ld-x86-64/pr22071.s b/ld/testsuite/ld-x86-64/pr22071.s new file mode 100644 index 0000000..0e0b4e0 --- /dev/null +++ b/ld/testsuite/ld-x86-64/pr22071.s @@ -0,0 +1,78 @@ + .text + .p2align 4,,15 + .globl get_ld + .type get_ld, @function +get_ld: + subq $8, %rsp + leaq _TLS_MODULE_BASE_@TLSDESC(%rip), %rax + call *_TLS_MODULE_BASE_@TLSCALL(%rax) + addq $8, %rsp + addq $ld@dtpoff, %rax + addq %fs:0, %rax + ret + .size get_ld, .-get_ld + .p2align 4,,15 + .globl set_ld + .type set_ld, @function +set_ld: + subq $8, %rsp + leaq _TLS_MODULE_BASE_@TLSDESC(%rip), %rax + call *_TLS_MODULE_BASE_@TLSCALL(%rax) + movl %edi, %fs:ld@dtpoff(%rax) + addq $8, %rsp + ret + .size set_ld, .-set_ld + .p2align 4,,15 + .globl test_ld + .type test_ld, @function +test_ld: + subq $8, %rsp + leaq _TLS_MODULE_BASE_@TLSDESC(%rip), %rax + call *_TLS_MODULE_BASE_@TLSCALL(%rax) + cmpl %edi, %fs:ld@dtpoff(%rax) + sete %al + addq $8, %rsp + movzbl %al, %eax + ret + .size test_ld, .-test_ld + .p2align 4,,15 + .globl get_gd + .type get_gd, @function +get_gd: + subq $8, %rsp + leaq gd@TLSDESC(%rip), %rax + call *gd@TLSCALL(%rax) + addq $8, %rsp + addq %fs:0, %rax + ret + .size get_gd, .-get_gd + .p2align 4,,15 + .globl set_gd + .type set_gd, @function +set_gd: + subq $8, %rsp + leaq gd@TLSDESC(%rip), %rax + call *gd@TLSCALL(%rax) + movl %edi, %fs:(%rax) + addq $8, %rsp + ret + .size set_gd, .-set_gd + .p2align 4,,15 + .globl test_gd + .type test_gd, @function +test_gd: + subq $8, %rsp + leaq gd@TLSDESC(%rip), %rax + call *gd@TLSCALL(%rax) + cmpl %edi, %fs:(%rax) + sete %al + addq $8, %rsp + movzbl %al, %eax + ret + .size test_gd, .-test_gd + .section .tbss,"awT",@nobits + .align 4 + .type ld, @object + .size ld, 4 +ld: + .zero 4 diff --git a/ld/testsuite/ld-x86-64/pr22115-1.s b/ld/testsuite/ld-x86-64/pr22115-1.s new file mode 100644 index 0000000..8c01e50 --- /dev/null +++ b/ld/testsuite/ld-x86-64/pr22115-1.s @@ -0,0 +1,7 @@ + .text + .globl _start + .type _start, @function +_start: + movq __ehdr_start@GOTPCREL(%rip), %rax + .size _start, .-_start + .weak __ehdr_start diff --git a/ld/testsuite/ld-x86-64/pr22115-1a-x32.d b/ld/testsuite/ld-x86-64/pr22115-1a-x32.d new file mode 100644 index 0000000..8232589 --- /dev/null +++ b/ld/testsuite/ld-x86-64/pr22115-1a-x32.d @@ -0,0 +1,13 @@ +#source: pr22115-1.s +#as: --x32 -mrelax-relocations=yes +#ld: -pie -z text -m elf32_x86_64 +#objdump: -dw + +.*: +file format .* + + +Disassembly of section .text: + +[a-f0-9]+ <_start>: + +[a-f0-9]+: 48 8d 05 ([0-9a-f]{2} ){4} * lea -?0x[a-f0-9]+\(%rip\),%rax # [a-f0-9]+ <__ehdr_start> +#pass diff --git a/ld/testsuite/ld-x86-64/pr22115-1a.d b/ld/testsuite/ld-x86-64/pr22115-1a.d new file mode 100644 index 0000000..43dc787 --- /dev/null +++ b/ld/testsuite/ld-x86-64/pr22115-1a.d @@ -0,0 +1,13 @@ +#source: pr22115-1.s +#as: --64 -mrelax-relocations=yes +#ld: -pie -z text -m elf_x86_64 +#objdump: -dw + +.*: +file format .* + + +Disassembly of section .text: + +[a-f0-9]+ <_start>: + +[a-f0-9]+: 48 8d 05 ([0-9a-f]{2} ){4} * lea -?0x[a-f0-9]+\(%rip\),%rax # [a-f0-9]+ <__ehdr_start> +#pass diff --git a/ld/testsuite/ld-x86-64/pr22115-1b-x32.d b/ld/testsuite/ld-x86-64/pr22115-1b-x32.d new file mode 100644 index 0000000..949dc5f --- /dev/null +++ b/ld/testsuite/ld-x86-64/pr22115-1b-x32.d @@ -0,0 +1,6 @@ +#source: pr22115-1.s +#as: --x32 -mrelax-relocations=yes +#ld: -pie -z text -m elf32_x86_64 +#readelf: -r + +There are no relocations in this file. diff --git a/ld/testsuite/ld-x86-64/pr22115-1b.d b/ld/testsuite/ld-x86-64/pr22115-1b.d new file mode 100644 index 0000000..f1aaf72 --- /dev/null +++ b/ld/testsuite/ld-x86-64/pr22115-1b.d @@ -0,0 +1,6 @@ +#source: pr22115-1.s +#as: --64 -mrelax-relocations=yes +#ld: -pie -z text -m elf_x86_64 +#readelf: -r + +There are no relocations in this file. diff --git a/ld/testsuite/ld-x86-64/pr22115-1c-x32.d b/ld/testsuite/ld-x86-64/pr22115-1c-x32.d new file mode 100644 index 0000000..384f8f4 --- /dev/null +++ b/ld/testsuite/ld-x86-64/pr22115-1c-x32.d @@ -0,0 +1,13 @@ +#source: pr22115-1.s +#as: --x32 -mrelax-relocations=yes +#ld: -pie -z text -m elf32_x86_64 --no-dynamic-linker +#objdump: -dw + +.*: +file format .* + + +Disassembly of section .text: + +[a-f0-9]+ <_start>: + +[a-f0-9]+: 48 8d 05 ([0-9a-f]{2} ){4} * lea -?0x[a-f0-9]+\(%rip\),%rax # [a-f0-9]+ <__ehdr_start> +#pass diff --git a/ld/testsuite/ld-x86-64/pr22115-1c.d b/ld/testsuite/ld-x86-64/pr22115-1c.d new file mode 100644 index 0000000..ac147f8 --- /dev/null +++ b/ld/testsuite/ld-x86-64/pr22115-1c.d @@ -0,0 +1,13 @@ +#source: pr22115-1.s +#as: --64 -mrelax-relocations=yes +#ld: -pie -z text -m elf_x86_64 --no-dynamic-linker +#objdump: -dw + +.*: +file format .* + + +Disassembly of section .text: + +[a-f0-9]+ <_start>: + +[a-f0-9]+: 48 8d 05 ([0-9a-f]{2} ){4} * lea -?0x[a-f0-9]+\(%rip\),%rax # [a-f0-9]+ <__ehdr_start> +#pass diff --git a/ld/testsuite/ld-x86-64/pr22115-1d-x32.d b/ld/testsuite/ld-x86-64/pr22115-1d-x32.d new file mode 100644 index 0000000..755c827 --- /dev/null +++ b/ld/testsuite/ld-x86-64/pr22115-1d-x32.d @@ -0,0 +1,6 @@ +#source: pr22115-1.s +#as: --x32 -mrelax-relocations=yes +#ld: -pie -z text -m elf32_x86_64 --no-dynamic-linker +#readelf: -r + +There are no relocations in this file. diff --git a/ld/testsuite/ld-x86-64/pr22115-1d.d b/ld/testsuite/ld-x86-64/pr22115-1d.d new file mode 100644 index 0000000..2cb1c65 --- /dev/null +++ b/ld/testsuite/ld-x86-64/pr22115-1d.d @@ -0,0 +1,6 @@ +#source: pr22115-1.s +#as: --64 -mrelax-relocations=yes +#ld: -pie -z text -m elf_x86_64 --no-dynamic-linker +#readelf: -r + +There are no relocations in this file. diff --git a/ld/testsuite/ld-x86-64/pr22135.d b/ld/testsuite/ld-x86-64/pr22135.d new file mode 100644 index 0000000..2cd6861 --- /dev/null +++ b/ld/testsuite/ld-x86-64/pr22135.d @@ -0,0 +1,12 @@ +#as: --64 +#ld: -pie -melf_x86_64 --no-keep-memory +#objdump: -dw + +.*: +file format .* + + +Disassembly of section .text: + +#... +[ ]*[a-f0-9]+: 8d 05 ([0-9a-f]{2} ){4} * lea -0x[a-f0-9]+\(%rip\),%eax # [a-f0-9]+ <foo> +#pass diff --git a/ld/testsuite/ld-x86-64/pr22135.s b/ld/testsuite/ld-x86-64/pr22135.s new file mode 100644 index 0000000..f4dff5c --- /dev/null +++ b/ld/testsuite/ld-x86-64/pr22135.s @@ -0,0 +1,11 @@ + .text + .globl foo + .type foo, @function +foo: + ret + .size foo, .-foo + .globl _start + .type _start, @function +_start: + movl foo@GOTPCREL(%rip), %eax + .size _start, .-_start diff --git a/ld/testsuite/ld-x86-64/protected8.d b/ld/testsuite/ld-x86-64/protected8.d new file mode 100644 index 0000000..22a36ac --- /dev/null +++ b/ld/testsuite/ld-x86-64/protected8.d @@ -0,0 +1,13 @@ +#as: --64 +#ld: -shared -melf_x86_64 +#objdump: -drw + +.*: +file format .* + + +Disassembly of section .text: + +0+[a-f0-9]+ <bar>: +[ ]*[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/protected8.s b/ld/testsuite/ld-x86-64/protected8.s new file mode 100644 index 0000000..314433d --- /dev/null +++ b/ld/testsuite/ld-x86-64/protected8.s @@ -0,0 +1,31 @@ + .protected foo +.globl foo + .data + .align 4 + .type foo, @object + .size foo, 4 +foo: + .long 1 + .text +.globl bar + .type bar, @function +bar: + movl foo(%rip), %eax + ret + .size bar, .-bar + + .section ".note.gnu.property", "a" + .p2align 3 + .long 1f - 0f /* name length. */ + .long 3f - 2f /* data length. */ + /* NT_GNU_PROPERTY_TYPE_0 */ + .long 5 /* note type. */ +0: .asciz "GNU" /* vendor name. */ +1: + .p2align 3 +2: + /* GNU_PROPERTY_NO_COPY_ON_PROTECTED */ + .long 2 /* pr_type. */ + .long 0 /* pr_datasz. */ + .p2align 3 +3: diff --git a/ld/testsuite/ld-x86-64/tls.exp b/ld/testsuite/ld-x86-64/tls.exp index 4263d95..7896451 100644 --- a/ld/testsuite/ld-x86-64/tls.exp +++ b/ld/testsuite/ld-x86-64/tls.exp @@ -206,17 +206,31 @@ if { ![check_gnu2_tls_available] } { return } +if { [at_least_gcc_version 5 0] } { + run_ld_link_exec_tests [list \ + [list \ + "Run tlsdesc1" \ + "-Wl,--no-as-needed tmpdir/libtlsdesc1.so" \ + "" \ + { tlsdesc1a.c } \ + "tlsdesc1a" \ + "pass.out" \ + "$GNU2_CFLAGS" \ + ] \ + [list \ + "Run tlsdesc1 with PIE" \ + "-pie -Wl,--no-as-needed tmpdir/libtlsdesc1.so" \ + "" \ + { tlsdesc1a.c } \ + "tlsdesc1c" \ + "pass.out" \ + "-fPIE $GNU2_CFLAGS" \ + ] \ + ] +} + run_ld_link_exec_tests [list \ [list \ - "Run tlsdesc1" \ - "-Wl,--no-as-needed tmpdir/libtlsdesc1.so" \ - "" \ - { tlsdesc1a.c } \ - "tlsdesc1a" \ - "pass.out" \ - "$GNU2_CFLAGS" \ - ] \ - [list \ "Run tlsdesc1 (-z now)" \ "-Wl,-z,now -Wl,--no-as-needed tmpdir/libtlsdesc1n.so" \ "" \ @@ -226,15 +240,6 @@ run_ld_link_exec_tests [list \ "$GNU2_CFLAGS" \ ] \ [list \ - "Run tlsdesc1 with PIE" \ - "-pie -Wl,--no-as-needed tmpdir/libtlsdesc1.so" \ - "" \ - { tlsdesc1a.c } \ - "tlsdesc1c" \ - "pass.out" \ - "-fPIE $GNU2_CFLAGS" \ - ] \ - [list \ "Run tlsdesc1 with PIE (-z now)" \ "-pie -Wl,-z,now -Wl,--no-as-needed tmpdir/libtlsdesc1n.so" \ "" \ diff --git a/ld/testsuite/ld-x86-64/x86-64.exp b/ld/testsuite/ld-x86-64/x86-64.exp index 9b83e1c..676d44a 100644 --- a/ld/testsuite/ld-x86-64/x86-64.exp +++ b/ld/testsuite/ld-x86-64/x86-64.exp @@ -50,20 +50,20 @@ set x86_64tests { "-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" "" + "-shared -melf_x86_64 --no-ld-generated-unwind-info --hash-style=sysv" "" "--64" {tlspic1.s tlspic2.s} {{readelf -WSsrl tlspic.rd} {objdump -drj.text\ -Mintel64 tlspic.dd} {objdump -sj.got tlspic.sd} {objdump -sj.tdata tlspic.td}} "libtlspic.so"} {"TLS -fpic -shared transitions with r15 as GOT base" - "-shared -melf_x86_64 --no-ld-generated-unwind-info" "" + "-shared -melf_x86_64 --no-ld-generated-unwind-info --hash-style=sysv" "" "--64 -mrelax-relocations=yes" {tlspic3.s tlspic2.s} {{readelf -WSsrl tlspic2.rd} {objdump -drj.text\ -Mintel64 tlspic2.dd} {objdump -sj.got tlspic2.sd} {objdump -sj.tdata tlspic2.td}} "libtlspic2.so"} {"TLS descriptor -fpic -shared transitions" - "-shared -melf_x86_64 --no-ld-generated-unwind-info" "" + "-shared -melf_x86_64 --no-ld-generated-unwind-info --hash-style=sysv" "" "--64" {tlsdesc.s tlspic2.s} {{readelf -WSsrld tlsdesc.rd} {objdump -drj.text tlsdesc.dd} {objdump "-s -j.got -j.got.plt" tlsdesc.sd} {objdump -sj.tdata tlsdesc.td} @@ -71,25 +71,25 @@ set x86_64tests { {"Helper shared library" "-shared -melf_x86_64" "" "--64" {tlslib.s} {} "libtlslib.so"} {"TLS -fpic and -fno-pic exec transitions" - "-melf_x86_64 tmpdir/libtlslib.so --no-ld-generated-unwind-info" "" + "-melf_x86_64 tmpdir/libtlslib.so --no-ld-generated-unwind-info --hash-style=sysv" "" "--64" {tlsbinpic.s tlsbin.s} {{readelf -WSsrl tlsbin.rd} {objdump -drj.text tlsbin.dd} {objdump -sj.got tlsbin.sd} {objdump -sj.tdata tlsbin.td}} "tlsbin"} {"TLS -fpic and -fno-pic exec transitions without PLT" - "-melf_x86_64 tmpdir/libtlslib.so --no-ld-generated-unwind-info" "" + "-melf_x86_64 tmpdir/libtlslib.so --no-ld-generated-unwind-info --hash-style=sysv" "" "-mrelax-relocations=yes --64" {tlsbinpic2.s tlsbin.s} {{readelf -WSsrl tlsbin2.rd} {objdump -drj.text tlsbin2.dd} {objdump -sj.got tlsbin2.sd} {objdump -sj.tdata tlsbin2.td}} "tlsbin2"} {"TLS descriptor -fpic and -fno-pic exec transitions" - "-melf_x86_64 tmpdir/libtlslib.so --no-ld-generated-unwind-info" "" + "-melf_x86_64 tmpdir/libtlslib.so --no-ld-generated-unwind-info --hash-style=sysv" "" "--64" {tlsbindesc.s tlsbin.s} {{readelf -WSsrl tlsbindesc.rd} {objdump -drj.text tlsbindesc.dd} {objdump -sj.got tlsbindesc.sd} {objdump -sj.tdata tlsbindesc.td}} "tlsbindesc"} {"TLS with global dynamic and descriptors" - "-shared -melf_x86_64 --no-ld-generated-unwind-info" "" + "-shared -melf_x86_64 --no-ld-generated-unwind-info --hash-style=sysv" "" "--64" {tlsgdesc.s} {{readelf -WSsrl tlsgdesc.rd} {objdump -drj.text\ -Mintel64 tlsgdesc.dd}} "libtlsgdesc.so"} @@ -291,6 +291,7 @@ run_dump_test "protected6a" run_dump_test "protected6b" run_dump_test "protected7a" run_dump_test "protected7b" +run_dump_test "protected8" run_dump_test "tlsle1" run_dump_test "tlspie1" run_dump_test "tlspie2a" @@ -310,6 +311,8 @@ run_dump_test "pr14207" run_dump_test "gotplt1" run_dump_test "pie1" run_dump_test "pie2" +run_dump_test "pie3" +run_dump_test "pie3-nacl" run_dump_test "pic1" run_dump_test "largecomm-1a" run_dump_test "largecomm-1b" @@ -363,6 +366,18 @@ run_dump_test "property-x86-shstk4" run_dump_test "property-x86-shstk4-x32" run_dump_test "property-x86-shstk5" run_dump_test "property-x86-shstk5-x32" +run_dump_test "pr21884" +run_dump_test "pr21884-nacl" +run_dump_test "pr22071" +run_dump_test "pr22115-1a" +run_dump_test "pr22115-1a-x32" +run_dump_test "pr22115-1b" +run_dump_test "pr22115-1b-x32" +run_dump_test "pr22115-1c" +run_dump_test "pr22115-1c-x32" +run_dump_test "pr22115-1d" +run_dump_test "pr22115-1d-x32" +run_dump_test "pr22135" if { ![istarget "x86_64-*-linux*"] && ![istarget "x86_64-*-nacl*"]} { return @@ -565,6 +580,7 @@ run_dump_test "pr20253-4f" run_dump_test "pr20253-5a" run_dump_test "pr20253-5b" run_dump_test "tlsdesc2" +run_dump_test "pr22048" proc undefined_weak {cflags ldflags} { set testname "Undefined weak symbol" @@ -572,8 +588,8 @@ proc undefined_weak {cflags ldflags} { set testname "$testname ($cflags $ldflags)" } - if { [ regexp "\-fPIE" $cflags] - && ![ regexp "nodynamic-undefined-weak" $ldflags] } { + if { [string match "*-fPIE*" $cflags] + && ![string match "*nodynamic-undefined-weak*" $ldflags] } { set weak_symbol "Weak defined" } else { set weak_symbol "Weak undefined" @@ -1035,8 +1051,96 @@ if { [isnative] && [which $CC] != 0 } { {{readelf {-n} property-7.r}} \ "property-7b.o" \ ] \ + [list \ + "Build pr22001-1.so" \ + "-shared" \ + "-fPIC" \ + { pr22001-1a.c } \ + {} \ + "pr22001-1.so" \ + ] \ + [list \ + "Build pr22001-1a" \ + "$NOPIE_LDFLAGS -Wl,-z,nocopyreloc,--no-as-needed tmpdir/pr22001-1.so" \ + "$NOPIE_CFLAGS" \ + { pr22001-1b.c } \ + {{error_output "pr22001-1a.err"}} \ + "pr22001-1a" \ + ] \ + [list \ + "Build pr21997-1.so" \ + "-shared" \ + "" \ + { property-stack.S property-no-copy.S pr21997-1a.S } \ + {} \ + "pr21997-1.so" \ + ] \ + [list \ + "Build pr21997-1a" \ + "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/pr21997-1.so" \ + "$NOPIE_CFLAGS" \ + { pr21997-1b.c } \ + {{error_output "pr21997-1a.err"}} \ + "pr21997-1a" \ + ] \ + [list \ + "Build pr22064a.o" \ + "" \ + "" \ + { pr22064a.S } \ + ] \ + [list \ + "Build pr22064.so" \ + "-shared" \ + "-fPIC" \ + { pr22064b.c } \ + {} \ + "pr22064.so" \ + ] \ ] + if {[istarget "x86_64-*-linux*-gnux32"]} { + run_ld_link_exec_tests [list \ + [list \ + "Run pr22001-1b" \ + "$NOPIE_LDFLAGS -Wl,-z,nocopyreloc,--no-as-needed tmpdir/pr22001-1.so" \ + "" \ + { pr22001-1c.c } \ + "pr22001-1b" \ + "pass.out" \ + "$NOPIE_CFLAGS" \ + ] \ + [list \ + "Run pr21997-1b" \ + "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/pr21997-1.so" \ + "" \ + { pr21997-1c.c } \ + "pr21997-1b" \ + "pass.out" \ + "$NOPIE_CFLAGS" \ + ] \ + ] + } else { + run_cc_link_tests [list \ + [list \ + "Build pr22001-1b" \ + "$NOPIE_LDFLAGS -Wl,-z,nocopyreloc,--no-as-needed tmpdir/pr22001-1.so" \ + "$NOPIE_CFLAGS" \ + { pr22001-1c.c } \ + {{error_output "pr22001-1b.err"}} \ + "pr22001-1b" \ + ] \ + [list \ + "Build pr21997-1b" \ + "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/pr21997-1.so" \ + "$NOPIE_CFLAGS" \ + { pr21997-1c.c } \ + {{error_output "pr21997-1b.err"}} \ + "pr21997-1b" \ + ] \ + ] + } + run_ld_link_exec_tests [list \ [list \ "Run plt-main" \ @@ -1211,6 +1315,87 @@ if { [isnative] && [which $CC] != 0 } { {property-x86-2.S property-x86-1.S pass.c property-stack.S} \ "property-5-static" "pass.out" \ ] \ + [list \ + "Run pr22001-1a (PIC 1)" \ + "$NOPIE_LDFLAGS -Wl,-z,nocopyreloc,--no-as-needed tmpdir/pr22001-1.so" \ + "" \ + { pr22001-1b.c } \ + "pr22001-1a-pic-1" \ + "pass.out" \ + "-fPIC" \ + ] \ + [list \ + "Run pr22001-1a (PIC 2)" \ + "-pie -Wl,-z,nocopyreloc,--no-as-needed tmpdir/pr22001-1.so" \ + "" \ + { pr22001-1b.c } \ + "pr22001-1a-pic-2" \ + "pass.out" \ + "-fPIC" \ + ] \ + [list \ + "Run pr22001-1b (PIC 1)" \ + "$NOPIE_LDFLAGS -Wl,-z,nocopyreloc,--no-as-needed tmpdir/pr22001-1.so" \ + "" \ + { pr22001-1c.c } \ + "pr22001-1b-pic-1" \ + "pass.out" \ + "-fPIC" \ + ] \ + [list \ + "Run pr22001-1b (PIC 2)" \ + "-pie -Wl,-z,nocopyreloc,--no-as-needed tmpdir/pr22001-1.so" \ + "" \ + { pr22001-1c.c } \ + "pr22001-1b-pic-2" \ + "pass.out" \ + "-fPIC" \ + ] \ + [list \ + "Run pr21997-1a (PIC 1)" \ + "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/pr21997-1.so" \ + "" \ + { pr21997-1b.c } \ + "pr21997-1a-pic-1" \ + "pass.out" \ + "-fPIC" \ + ] \ + [list \ + "Run pr21997-1a (PIC 2)" \ + "-pie -Wl,--no-as-needed tmpdir/pr21997-1.so" \ + "" \ + { pr21997-1b.c } \ + "pr21997-1a-pic-2" \ + "pass.out" \ + "-fPIC" \ + ] \ + [list \ + "Run pr21997-1b (PIC 1)" \ + "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/pr21997-1.so" \ + "" \ + { pr21997-1c.c } \ + "pr21997-1b-pic-1" \ + "pass.out" \ + "-fPIC" \ + ] \ + [list \ + "Run pr21997-1b (PIC 2)" \ + "-pie -Wl,--no-as-needed tmpdir/pr21997-1.so" \ + "" \ + { pr21997-1c.c } \ + "pr21997-1b-pic-2" \ + "pass.out" \ + "-fPIC" \ + ] \ + [list \ + "Run pr22064" \ + "-pie -Wl,--no-as-needed tmpdir/pr22064a.o tmpdir/pr22064.so" \ + "" \ + { dummy.s } \ + "pr22064-pie" \ + "pass.out" \ + "-fPIE" \ + ] \ ] # Run-time tests which require working ifunc attribute support. @@ -1542,7 +1727,7 @@ if { ![istarget "x86_64-*-linux*"]} { run_ld_link_tests [list \ [list \ "basic PLT generation (-z now)" \ - "-z now -melf_x86_64 tmpdir/libpltlib.so" \ + "-z now -melf_x86_64 --hash-style=sysv tmpdir/libpltlib.so" \ "" \ "--64" \ {plt2.s} \ @@ -1570,7 +1755,11 @@ run_ld_link_tests [list \ ] # Linux only tests -run_dump_test "pr17618" +global LD_CLASS +if { "$LD_CLASS" == "64bit" } then { + # This test needs 64-bit linker. + run_dump_test "pr17618" +} run_dump_test "pltgot-1" run_dump_test "pltgot-2" run_dump_test "pr20830a" |