diff options
Diffstat (limited to 'ld/testsuite/ld-x86-64')
-rw-r--r-- | ld/testsuite/ld-x86-64/pr19807-1.s | 8 | ||||
-rw-r--r-- | ld/testsuite/ld-x86-64/pr19807-1a.d | 13 | ||||
-rw-r--r-- | ld/testsuite/ld-x86-64/pr19807-1b.d | 13 | ||||
-rw-r--r-- | ld/testsuite/ld-x86-64/pr19807-2.s | 8 | ||||
-rw-r--r-- | ld/testsuite/ld-x86-64/pr19807-2a.d | 4 | ||||
-rw-r--r-- | ld/testsuite/ld-x86-64/pr19807-2b.d | 8 | ||||
-rw-r--r-- | ld/testsuite/ld-x86-64/pr19807-2c.d | 13 | ||||
-rw-r--r-- | ld/testsuite/ld-x86-64/pr19807-2d.d | 8 | ||||
-rw-r--r-- | ld/testsuite/ld-x86-64/pr19807-2e.d | 13 | ||||
-rw-r--r-- | ld/testsuite/ld-x86-64/x86-64.exp | 7 |
10 files changed, 95 insertions, 0 deletions
diff --git a/ld/testsuite/ld-x86-64/pr19807-1.s b/ld/testsuite/ld-x86-64/pr19807-1.s new file mode 100644 index 0000000..0870f6a --- /dev/null +++ b/ld/testsuite/ld-x86-64/pr19807-1.s @@ -0,0 +1,8 @@ + .globl _start + .type _start, @function +_start: + movq $foo, %rax + .size _start, .-_start + .data +foo: + .quad 0 diff --git a/ld/testsuite/ld-x86-64/pr19807-1a.d b/ld/testsuite/ld-x86-64/pr19807-1a.d new file mode 100644 index 0000000..f3c5390 --- /dev/null +++ b/ld/testsuite/ld-x86-64/pr19807-1a.d @@ -0,0 +1,13 @@ +#source: pr19807-1.s +#as: --64 +#ld: -pie -melf_x86_64 -z noreloc-overflow +#objdump: -dw + +.*: +file format .* + + +Disassembly of section .text: + +[a-f0-9]+ <_start>: +[ ]*[a-f0-9]+: 48 c7 c0 ([0-9a-f]{2} ){4} mov \$0x[a-f0-9]+,%rax +#pass diff --git a/ld/testsuite/ld-x86-64/pr19807-1b.d b/ld/testsuite/ld-x86-64/pr19807-1b.d new file mode 100644 index 0000000..6af4985 --- /dev/null +++ b/ld/testsuite/ld-x86-64/pr19807-1b.d @@ -0,0 +1,13 @@ +#source: pr19807-1.s +#as: --x32 +#ld: -pie -melf32_x86_64 -z noreloc-overflow +#objdump: -dw + +.*: +file format .* + + +Disassembly of section .text: + +[a-f0-9]+ <_start>: +[ ]*[a-f0-9]+: 48 c7 c0 ([0-9a-f]{2} ){4} mov \$0x[a-f0-9]+,%rax +#pass diff --git a/ld/testsuite/ld-x86-64/pr19807-2.s b/ld/testsuite/ld-x86-64/pr19807-2.s new file mode 100644 index 0000000..2b309f2 --- /dev/null +++ b/ld/testsuite/ld-x86-64/pr19807-2.s @@ -0,0 +1,8 @@ + .globl _start + .type _start, @function +_start: + movl $foo, %eax + .size _start, .-_start + .data +foo: + .quad 0 diff --git a/ld/testsuite/ld-x86-64/pr19807-2a.d b/ld/testsuite/ld-x86-64/pr19807-2a.d new file mode 100644 index 0000000..1357d72 --- /dev/null +++ b/ld/testsuite/ld-x86-64/pr19807-2a.d @@ -0,0 +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 diff --git a/ld/testsuite/ld-x86-64/pr19807-2b.d b/ld/testsuite/ld-x86-64/pr19807-2b.d new file mode 100644 index 0000000..a781b30 --- /dev/null +++ b/ld/testsuite/ld-x86-64/pr19807-2b.d @@ -0,0 +1,8 @@ +#source: pr19807-2.s +#as: --x32 +#ld: -pie -melf32_x86_64 +#readelf: -r --wide + +Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 1 entries: + Offset Info Type Sym. Value Symbol's Name \+ Addend +[0-9a-f]+ +[0-9a-f]+ +R_X86_64_RELATIVE +[0-9a-f]+ diff --git a/ld/testsuite/ld-x86-64/pr19807-2c.d b/ld/testsuite/ld-x86-64/pr19807-2c.d new file mode 100644 index 0000000..83ac641 --- /dev/null +++ b/ld/testsuite/ld-x86-64/pr19807-2c.d @@ -0,0 +1,13 @@ +#source: pr19807-2.s +#as: --x32 +#ld: -pie -melf32_x86_64 +#objdump: -dw + +.*: +file format .* + + +Disassembly of section .text: + +[a-f0-9]+ <_start>: +[ ]*[a-f0-9]+: b8 ([0-9a-f]{2} ){4} mov \$0x[a-f0-9]+,%eax +#pass diff --git a/ld/testsuite/ld-x86-64/pr19807-2d.d b/ld/testsuite/ld-x86-64/pr19807-2d.d new file mode 100644 index 0000000..1171283 --- /dev/null +++ b/ld/testsuite/ld-x86-64/pr19807-2d.d @@ -0,0 +1,8 @@ +#source: pr19807-2.s +#as: --64 +#ld: -pie -melf_x86_64 -z noreloc-overflow +#readelf: -r --wide + +Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 1 entries: + Offset Info Type Symbol's Value Symbol's Name \+ Addend +[0-9a-f]+ +[0-9a-f]+ +R_X86_64_RELATIVE +[0-9a-f]+ diff --git a/ld/testsuite/ld-x86-64/pr19807-2e.d b/ld/testsuite/ld-x86-64/pr19807-2e.d new file mode 100644 index 0000000..f26616a --- /dev/null +++ b/ld/testsuite/ld-x86-64/pr19807-2e.d @@ -0,0 +1,13 @@ +#source: pr19807-2.s +#as: --64 +#ld: -pie -melf_x86_64 -z noreloc-overflow +#objdump: -dw + +.*: +file format .* + + +Disassembly of section .text: + +[a-f0-9]+ <_start>: +[ ]*[a-f0-9]+: b8 ([0-9a-f]{2} ){4} mov \$0x[a-f0-9]+,%eax +#pass diff --git a/ld/testsuite/ld-x86-64/x86-64.exp b/ld/testsuite/ld-x86-64/x86-64.exp index 49f9fa3..8f29761 100644 --- a/ld/testsuite/ld-x86-64/x86-64.exp +++ b/ld/testsuite/ld-x86-64/x86-64.exp @@ -247,6 +247,13 @@ run_dump_test "largecomm-1e" run_dump_test "largecomm-1f" run_dump_test "pr19539a" run_dump_test "pr19539b" +run_dump_test "pr19807-1a" +run_dump_test "pr19807-1b" +run_dump_test "pr19807-2a" +run_dump_test "pr19807-2b" +run_dump_test "pr19807-2c" +run_dump_test "pr19807-2d" +run_dump_test "pr19807-2e" if { ![istarget "x86_64-*-linux*"] && ![istarget "x86_64-*-nacl*"]} { return |