summaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-x86-64
diff options
context:
space:
mode:
Diffstat (limited to 'ld/testsuite/ld-x86-64')
-rw-r--r--ld/testsuite/ld-x86-64/mov2.s15
-rw-r--r--ld/testsuite/ld-x86-64/mov2a.d15
-rw-r--r--ld/testsuite/ld-x86-64/mov2b.d15
-rw-r--r--ld/testsuite/ld-x86-64/mov2c.d15
-rw-r--r--ld/testsuite/ld-x86-64/mov2d.d15
-rw-r--r--ld/testsuite/ld-x86-64/x86-64.exp4
6 files changed, 79 insertions, 0 deletions
diff --git a/ld/testsuite/ld-x86-64/mov2.s b/ld/testsuite/ld-x86-64/mov2.s
new file mode 100644
index 00000000000..95e474f0309
--- /dev/null
+++ b/ld/testsuite/ld-x86-64/mov2.s
@@ -0,0 +1,15 @@
+ .section my_section,"aw",@progbits
+ .long 0x12345678
+ .text
+ .globl foo
+ .type foo, @function
+foo:
+ ret
+ .size foo, .-foo
+ .globl _start
+ .type _start, @function
+_start:
+ movq foo@GOTPCREL+1(%rip), %rax
+ movq __start_my_section@GOTPCREL+1(%rip), %rax
+ movq __stop_my_section@GOTPCREL+1(%rip), %rax
+ .size _start, .-_start
diff --git a/ld/testsuite/ld-x86-64/mov2a.d b/ld/testsuite/ld-x86-64/mov2a.d
new file mode 100644
index 00000000000..aaf57070b1a
--- /dev/null
+++ b/ld/testsuite/ld-x86-64/mov2a.d
@@ -0,0 +1,15 @@
+#source: mov2.s
+#as: --64
+#ld: -shared -melf_x86_64
+#objdump: -dw
+
+.*: +file format .*
+
+
+Disassembly of section .text:
+
+#...
+[ ]*[a-f0-9]+: 48 8b 05 ([0-9a-f]{2} ){4} * mov 0x[a-f0-9]+\(%rip\),%rax # [a-f0-9]+ <_DYNAMIC\+0x[a-f0-9]+>
+[ ]*[a-f0-9]+: 48 8b 05 ([0-9a-f]{2} ){4} * mov 0x[a-f0-9]+\(%rip\),%rax # [a-f0-9]+ <_DYNAMIC\+0x[a-f0-9]+>
+[ ]*[a-f0-9]+: 48 8b 05 ([0-9a-f]{2} ){4} * mov 0x[a-f0-9]+\(%rip\),%rax # [a-f0-9]+ <_DYNAMIC\+0x[a-f0-9]+>
+#pass
diff --git a/ld/testsuite/ld-x86-64/mov2b.d b/ld/testsuite/ld-x86-64/mov2b.d
new file mode 100644
index 00000000000..ee1b308b6b2
--- /dev/null
+++ b/ld/testsuite/ld-x86-64/mov2b.d
@@ -0,0 +1,15 @@
+#source: mov2.s
+#as: --64
+#ld: -pie -melf_x86_64
+#objdump: -dw
+
+.*: +file format .*
+
+
+Disassembly of section .text:
+
+#...
+[ ]*[a-f0-9]+: 48 8b 05 ([0-9a-f]{2} ){4} * mov 0x[a-f0-9]+\(%rip\),%rax # [a-f0-9]+ <_DYNAMIC\+0x[a-f0-9]+>
+[ ]*[a-f0-9]+: 48 8b 05 ([0-9a-f]{2} ){4} * mov 0x[a-f0-9]+\(%rip\),%rax # [a-f0-9]+ <_DYNAMIC\+0x[a-f0-9]+>
+[ ]*[a-f0-9]+: 48 8b 05 ([0-9a-f]{2} ){4} * mov 0x[a-f0-9]+\(%rip\),%rax # [a-f0-9]+ <_DYNAMIC\+0x[a-f0-9]+>
+#pass
diff --git a/ld/testsuite/ld-x86-64/mov2c.d b/ld/testsuite/ld-x86-64/mov2c.d
new file mode 100644
index 00000000000..89911210626
--- /dev/null
+++ b/ld/testsuite/ld-x86-64/mov2c.d
@@ -0,0 +1,15 @@
+#source: mov2.s
+#as: --x32
+#ld: -shared -melf32_x86_64
+#objdump: -dw
+
+.*: +file format .*
+
+
+Disassembly of section .text:
+
+#...
+[ ]*[a-f0-9]+: 48 8b 05 ([0-9a-f]{2} ){4} * mov 0x[a-f0-9]+\(%rip\),%rax # [a-f0-9]+ <_DYNAMIC\+0x[a-f0-9]+>
+[ ]*[a-f0-9]+: 48 8b 05 ([0-9a-f]{2} ){4} * mov 0x[a-f0-9]+\(%rip\),%rax # [a-f0-9]+ <_DYNAMIC\+0x[a-f0-9]+>
+[ ]*[a-f0-9]+: 48 8b 05 ([0-9a-f]{2} ){4} * mov 0x[a-f0-9]+\(%rip\),%rax # [a-f0-9]+ <_DYNAMIC\+0x[a-f0-9]+>
+#pass
diff --git a/ld/testsuite/ld-x86-64/mov2d.d b/ld/testsuite/ld-x86-64/mov2d.d
new file mode 100644
index 00000000000..744028e6401
--- /dev/null
+++ b/ld/testsuite/ld-x86-64/mov2d.d
@@ -0,0 +1,15 @@
+#source: mov2.s
+#as: --x32
+#ld: -pie -melf32_x86_64
+#objdump: -dw
+
+.*: +file format .*
+
+
+Disassembly of section .text:
+
+#...
+[ ]*[a-f0-9]+: 48 8b 05 ([0-9a-f]{2} ){4} * mov 0x[a-f0-9]+\(%rip\),%rax # [a-f0-9]+ <_DYNAMIC\+0x[a-f0-9]+>
+[ ]*[a-f0-9]+: 48 8b 05 ([0-9a-f]{2} ){4} * mov 0x[a-f0-9]+\(%rip\),%rax # [a-f0-9]+ <_DYNAMIC\+0x[a-f0-9]+>
+[ ]*[a-f0-9]+: 48 8b 05 ([0-9a-f]{2} ){4} * mov 0x[a-f0-9]+\(%rip\),%rax # [a-f0-9]+ <_DYNAMIC\+0x[a-f0-9]+>
+#pass
diff --git a/ld/testsuite/ld-x86-64/x86-64.exp b/ld/testsuite/ld-x86-64/x86-64.exp
index f0f47eb891f..45b7f094ba1 100644
--- a/ld/testsuite/ld-x86-64/x86-64.exp
+++ b/ld/testsuite/ld-x86-64/x86-64.exp
@@ -321,6 +321,10 @@ run_dump_test "mov1a"
run_dump_test "mov1b"
run_dump_test "mov1c"
run_dump_test "mov1d"
+run_dump_test "mov2a"
+run_dump_test "mov2b"
+run_dump_test "mov2c"
+run_dump_test "mov2d"
run_dump_test "load1a"
run_dump_test "load1b"
run_dump_test "load1c"