aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-x86-64
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2012-09-01 02:50:14 +0000
committerH.J. Lu <hjl.tools@gmail.com>2012-09-01 02:50:14 +0000
commit3f65f59941a8cf0895384bc4700f41a2f37e1ff2 (patch)
tree9be1e0f747711680687cd720580f4df267c44a3f /ld/testsuite/ld-x86-64
parentf25b8a5e715ce96f342f8cb7b39ac0781166a412 (diff)
downloadgdb-3f65f59941a8cf0895384bc4700f41a2f37e1ff2.zip
gdb-3f65f59941a8cf0895384bc4700f41a2f37e1ff2.tar.gz
gdb-3f65f59941a8cf0895384bc4700f41a2f37e1ff2.tar.bz2
Don't optimize relocation against _DYNAMIC
bfd/ * elf32-i386.c (elf_i386_convert_mov_to_lea): Don't optimize _DYNAMIC. * elf64-x86-64.c (elf_x86_64_convert_mov_to_lea): Likewise. ld/testsuite/ * ld-i386/i386.exp: Run mov1a, mov1b. * ld-x86-64/x86-64.exp: Run mov1a, mov1b, mov1c, mov1d. * ld-i386/mov1.s: New file. * ld-i386/mov1a.d: Likewise. * ld-i386/mov1b.d: Likewise. * ld-x86-64/mov1.s: Likewise. * ld-x86-64/mov1a.d: Likewise. * ld-x86-64/mov1b.d: Likewise. * ld-x86-64/mov1c.d: Likewise. * ld-x86-64/mov1d.d: Likewise.
Diffstat (limited to 'ld/testsuite/ld-x86-64')
-rw-r--r--ld/testsuite/ld-x86-64/mov1.s6
-rw-r--r--ld/testsuite/ld-x86-64/mov1a.d13
-rw-r--r--ld/testsuite/ld-x86-64/mov1b.d13
-rw-r--r--ld/testsuite/ld-x86-64/mov1c.d13
-rw-r--r--ld/testsuite/ld-x86-64/mov1d.d13
-rw-r--r--ld/testsuite/ld-x86-64/x86-64.exp4
6 files changed, 62 insertions, 0 deletions
diff --git a/ld/testsuite/ld-x86-64/mov1.s b/ld/testsuite/ld-x86-64/mov1.s
new file mode 100644
index 0000000..2a11b7a
--- /dev/null
+++ b/ld/testsuite/ld-x86-64/mov1.s
@@ -0,0 +1,6 @@
+ .text
+ .globl _start
+ .type _start, @function
+_start:
+ movq _DYNAMIC@GOTPCREL(%rip), %rax
+ .size _start, .-_start
diff --git a/ld/testsuite/ld-x86-64/mov1a.d b/ld/testsuite/ld-x86-64/mov1a.d
new file mode 100644
index 0000000..df156be
--- /dev/null
+++ b/ld/testsuite/ld-x86-64/mov1a.d
@@ -0,0 +1,13 @@
+#source: mov1.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]+>
+#pass
diff --git a/ld/testsuite/ld-x86-64/mov1b.d b/ld/testsuite/ld-x86-64/mov1b.d
new file mode 100644
index 0000000..2f2f6f5
--- /dev/null
+++ b/ld/testsuite/ld-x86-64/mov1b.d
@@ -0,0 +1,13 @@
+#source: mov1.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]+>
+#pass
diff --git a/ld/testsuite/ld-x86-64/mov1c.d b/ld/testsuite/ld-x86-64/mov1c.d
new file mode 100644
index 0000000..a57e1c1
--- /dev/null
+++ b/ld/testsuite/ld-x86-64/mov1c.d
@@ -0,0 +1,13 @@
+#source: mov1.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]+>
+#pass
diff --git a/ld/testsuite/ld-x86-64/mov1d.d b/ld/testsuite/ld-x86-64/mov1d.d
new file mode 100644
index 0000000..955d33e
--- /dev/null
+++ b/ld/testsuite/ld-x86-64/mov1d.d
@@ -0,0 +1,13 @@
+#source: mov1.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]+>
+#pass
diff --git a/ld/testsuite/ld-x86-64/x86-64.exp b/ld/testsuite/ld-x86-64/x86-64.exp
index 7eabf39..1ad54e6 100644
--- a/ld/testsuite/ld-x86-64/x86-64.exp
+++ b/ld/testsuite/ld-x86-64/x86-64.exp
@@ -288,6 +288,10 @@ run_dump_test "lea1i"
run_dump_test "lea1j"
run_dump_test "lea1k"
run_dump_test "lea1l"
+run_dump_test "mov1a"
+run_dump_test "mov1b"
+run_dump_test "mov1c"
+run_dump_test "mov1d"
# Must be native with the C compiler
if { [isnative] && [which $CC] != 0 } {