aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-x86-64
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2016-05-06 05:28:18 -0700
committerH.J. Lu <hjl.tools@gmail.com>2016-05-06 05:28:18 -0700
commit2856a6272397d159aa2a21fd2ef0f1a6e80f5e41 (patch)
tree37fb96014b48aa3a36a7d311a2be2d1f29301866 /ld/testsuite/ld-x86-64
parentfd7ed446fbee07c70ebc7d1e92f1ece665d7fc64 (diff)
downloadgdb-2856a6272397d159aa2a21fd2ef0f1a6e80f5e41.zip
gdb-2856a6272397d159aa2a21fd2ef0f1a6e80f5e41.tar.gz
gdb-2856a6272397d159aa2a21fd2ef0f1a6e80f5e41.tar.bz2
Test load conversion with symbol versioning for x86
* testsuite/ld-i386/i386.exp: Run load7. * testsuite/ld-i386/load7.d: New file. * testsuite/ld-i386/load7.map: Likewise. * testsuite/ld-i386/load7.s: Likewise. * testsuite/ld-x86-64/load2.d: Likewise. * testsuite/ld-x86-64/load2.map: Likewise. * testsuite/ld-x86-64/load2.s: Likewise. * testsuite/ld-x86-64/x86-64.exp: Run load2.
Diffstat (limited to 'ld/testsuite/ld-x86-64')
-rw-r--r--ld/testsuite/ld-x86-64/load2.d18
-rw-r--r--ld/testsuite/ld-x86-64/load2.map6
-rw-r--r--ld/testsuite/ld-x86-64/load2.s20
-rw-r--r--ld/testsuite/ld-x86-64/x86-64.exp1
4 files changed, 45 insertions, 0 deletions
diff --git a/ld/testsuite/ld-x86-64/load2.d b/ld/testsuite/ld-x86-64/load2.d
new file mode 100644
index 0000000..f76ba9d
--- /dev/null
+++ b/ld/testsuite/ld-x86-64/load2.d
@@ -0,0 +1,18 @@
+#as: --64
+#ld: -shared -melf_x86_64 --version-script load2.map
+#objdump: -dw
+
+.*: +file format .*
+
+
+Disassembly of section .text:
+
+#...
+[a-f0-9]+ <_start>:
+[ ]*[a-f0-9]+: 8d 05 ([0-9a-f]{2} ){4} * lea -0x[a-f0-9]+\(%rip\),%eax # [a-f0-9]+ <foo>
+[ ]*[a-f0-9]+: 44 8d 1d ([0-9a-f]{2} ){4} * lea 0x[a-f0-9]+\(%rip\),%r11d # [a-f0-9]+ <bar>
+[ ]*[a-f0-9]+: 48 8d 05 ([0-9a-f]{2} ){4} * lea -0x[a-f0-9]+\(%rip\),%rax # [a-f0-9]+ <foo>
+[ ]*[a-f0-9]+: 4c 8d 1d ([0-9a-f]{2} ){4} * lea 0x[a-f0-9]+\(%rip\),%r11 # [a-f0-9]+ <bar>
+[ ]*[a-f0-9]+: 48 8d 05 ([0-9a-f]{2} ){4} * lea 0x[a-f0-9]+\(%rip\),%rax # [a-f0-9]+ <__start_my_section>
+[ ]*[a-f0-9]+: 4c 8d 1d ([0-9a-f]{2} ){4} * lea 0x[a-f0-9]+\(%rip\),%r11 # [a-f0-9]+ <__stop_my_section>
+#pass
diff --git a/ld/testsuite/ld-x86-64/load2.map b/ld/testsuite/ld-x86-64/load2.map
new file mode 100644
index 0000000..a0a5e0f
--- /dev/null
+++ b/ld/testsuite/ld-x86-64/load2.map
@@ -0,0 +1,6 @@
+{
+global:
+ _start;
+local:
+ *;
+};
diff --git a/ld/testsuite/ld-x86-64/load2.s b/ld/testsuite/ld-x86-64/load2.s
new file mode 100644
index 0000000..2c9982e
--- /dev/null
+++ b/ld/testsuite/ld-x86-64/load2.s
@@ -0,0 +1,20 @@
+ .section my_section,"aw",@progbits
+ .long 0x12345678
+ .text
+ .globl foo
+ .type foo, @function
+foo:
+ ret
+ .size foo, .-foo
+ .globl _start
+ .type _start, @function
+_start:
+ movl foo@GOTPCREL(%rip), %eax
+ movl bar@GOTPCREL(%rip), %r11d
+ movq foo@GOTPCREL(%rip), %rax
+ movq bar@GOTPCREL(%rip), %r11
+ movq __start_my_section@GOTPCREL(%rip), %rax
+ movq __stop_my_section@GOTPCREL(%rip), %r11
+ .size _start, .-_start
+ .comm pad,4,4
+ .comm bar,4,4
diff --git a/ld/testsuite/ld-x86-64/x86-64.exp b/ld/testsuite/ld-x86-64/x86-64.exp
index b48f3c7..d3990d0 100644
--- a/ld/testsuite/ld-x86-64/x86-64.exp
+++ b/ld/testsuite/ld-x86-64/x86-64.exp
@@ -363,6 +363,7 @@ run_dump_test "load1a-nacl"
run_dump_test "load1b-nacl"
run_dump_test "load1c-nacl"
run_dump_test "load1d-nacl"
+run_dump_test "load2"
run_dump_test "call1a"
run_dump_test "call1b"
run_dump_test "call1c"