aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-x86-64
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2018-11-05 09:01:26 -0800
committerH.J. Lu <hjl.tools@gmail.com>2018-11-05 09:01:43 -0800
commite60f4d3bdac25f02875afe36b7436bc2dfbbb978 (patch)
treef657bb8dd416d712ec6ad3c6506348b85bd4db1c /ld/testsuite/ld-x86-64
parent713f1b445a18af04eafbf8df6f844bed8243963f (diff)
downloadgdb-e60f4d3bdac25f02875afe36b7436bc2dfbbb978.zip
gdb-e60f4d3bdac25f02875afe36b7436bc2dfbbb978.tar.gz
gdb-e60f4d3bdac25f02875afe36b7436bc2dfbbb978.tar.bz2
x86: Disable GOT relaxation with data prefix
Since linker GOT relaxation isn't valid for 16-bit GOT access, we should disable GOT relaxation with data prefix. gas/ PR gas/r23854 * config/tc-i386.c (output_disp): Disable GOT relaxation with data prefix. * testsuite/gas/i386/mixed-mode-reloc32.d: Updated. ld/ PR gas/r23854 * testsuite/ld-i386/i386.exp: Run pr23854. * testsuite/ld-x86-64/x86-64.exp: Likewwise. * testsuite/ld-i386/pr23854.d: New file. * testsuite/ld-i386/pr23854.s: Likewwise. * testsuite/ld-i386/pr23854.d: Likewwise. * testsuite/ld-x86-64/pr23854.d: Likewwise. * testsuite/ld-x86-64/pr23854.s: Likewwise.
Diffstat (limited to 'ld/testsuite/ld-x86-64')
-rw-r--r--ld/testsuite/ld-x86-64/pr23854.d28
-rw-r--r--ld/testsuite/ld-x86-64/pr23854.s33
-rw-r--r--ld/testsuite/ld-x86-64/x86-64.exp1
3 files changed, 62 insertions, 0 deletions
diff --git a/ld/testsuite/ld-x86-64/pr23854.d b/ld/testsuite/ld-x86-64/pr23854.d
new file mode 100644
index 0000000..95770d3
--- /dev/null
+++ b/ld/testsuite/ld-x86-64/pr23854.d
@@ -0,0 +1,28 @@
+#as: --64 -mrelax-relocations=yes
+#ld: -melf_x86_64
+#objdump: -dw
+
+.*: +file format .*
+
+Disassembly of section .text:
+
+[a-f0-9]+ <_start>:
+ +[a-f0-9]+: 66 13 05 ([0-9a-f]{2} ){4} * adc 0x[a-f0-9]+\(%rip\),%ax # [a-f0-9]+ <.got>
+ +[a-f0-9]+: 66 03 1d ([0-9a-f]{2} ){4} * add 0x[a-f0-9]+\(%rip\),%bx # [a-f0-9]+ <.got>
+ +[a-f0-9]+: 66 23 0d ([0-9a-f]{2} ){4} * and 0x[a-f0-9]+\(%rip\),%cx # [a-f0-9]+ <.got>
+ +[a-f0-9]+: 66 3b 15 ([0-9a-f]{2} ){4} * cmp 0x[a-f0-9]+\(%rip\),%dx # [a-f0-9]+ <.got>
+ +[a-f0-9]+: 66 0b 3d ([0-9a-f]{2} ){4} * or 0x[a-f0-9]+\(%rip\),%di # [a-f0-9]+ <.got>
+ +[a-f0-9]+: 66 1b 35 ([0-9a-f]{2} ){4} * sbb 0x[a-f0-9]+\(%rip\),%si # [a-f0-9]+ <.got>
+ +[a-f0-9]+: 66 2b 2d ([0-9a-f]{2} ){4} * sub 0x[a-f0-9]+\(%rip\),%bp # [a-f0-9]+ <.got>
+ +[a-f0-9]+: 66 44 33 05 ([0-9a-f]{2} ){4} * xor 0x[a-f0-9]+\(%rip\),%r8w # [a-f0-9]+ <.got>
+ +[a-f0-9]+: 66 85 0d ([0-9a-f]{2} ){4} * test %cx,0x[a-f0-9]+\(%rip\) # [a-f0-9]+ <.got>
+ +[a-f0-9]+: 66 13 05 ([0-9a-f]{2} ){4} * adc 0x[a-f0-9]+\(%rip\),%ax # [a-f0-9]+ <.got\+0x8>
+ +[a-f0-9]+: 66 03 1d ([0-9a-f]{2} ){4} * add 0x[a-f0-9]+\(%rip\),%bx # [a-f0-9]+ <.got\+0x8>
+ +[a-f0-9]+: 66 23 0d ([0-9a-f]{2} ){4} * and 0x[a-f0-9]+\(%rip\),%cx # [a-f0-9]+ <.got\+0x8>
+ +[a-f0-9]+: 66 3b 15 ([0-9a-f]{2} ){4} * cmp 0x[a-f0-9]+\(%rip\),%dx # [a-f0-9]+ <.got\+0x8>
+ +[a-f0-9]+: 66 0b 3d ([0-9a-f]{2} ){4} * or 0x[a-f0-9]+\(%rip\),%di # [a-f0-9]+ <.got\+0x8>
+ +[a-f0-9]+: 66 1b 35 ([0-9a-f]{2} ){4} * sbb 0x[a-f0-9]+\(%rip\),%si # [a-f0-9]+ <.got\+0x8>
+ +[a-f0-9]+: 66 2b 2d ([0-9a-f]{2} ){4} * sub 0x[a-f0-9]+\(%rip\),%bp # [a-f0-9]+ <.got\+0x8>
+ +[a-f0-9]+: 66 44 33 05 ([0-9a-f]{2} ){4} * xor 0x[a-f0-9]+\(%rip\),%r8w # [a-f0-9]+ <.got\+0x8>
+ +[a-f0-9]+: 66 85 0d ([0-9a-f]{2} ){4} * test %cx,0x[a-f0-9]+\(%rip\) # [a-f0-9]+ <.got\+0x8>
+#pass
diff --git a/ld/testsuite/ld-x86-64/pr23854.s b/ld/testsuite/ld-x86-64/pr23854.s
new file mode 100644
index 0000000..b720154
--- /dev/null
+++ b/ld/testsuite/ld-x86-64/pr23854.s
@@ -0,0 +1,33 @@
+ .data
+ .type bar, @object
+bar:
+ .byte 1
+ .size bar, .-bar
+ .globl foo
+ .type foo, @object
+foo:
+ .byte 1
+ .size foo, .-foo
+ .text
+ .globl _start
+ .type _start, @function
+_start:
+ adcw bar@GOTPCREL(%rip), %ax
+ addw bar@GOTPCREL(%rip), %bx
+ andw bar@GOTPCREL(%rip), %cx
+ cmpw bar@GOTPCREL(%rip), %dx
+ orw bar@GOTPCREL(%rip), %di
+ sbbw bar@GOTPCREL(%rip), %si
+ subw bar@GOTPCREL(%rip), %bp
+ xorw bar@GOTPCREL(%rip), %r8w
+ testw %cx, bar@GOTPCREL(%rip)
+ adcw foo@GOTPCREL(%rip), %ax
+ addw foo@GOTPCREL(%rip), %bx
+ andw foo@GOTPCREL(%rip), %cx
+ cmpw foo@GOTPCREL(%rip), %dx
+ orw foo@GOTPCREL(%rip), %di
+ sbbw foo@GOTPCREL(%rip), %si
+ subw foo@GOTPCREL(%rip), %bp
+ xorw foo@GOTPCREL(%rip), %r8w
+ testw %cx, foo@GOTPCREL(%rip)
+ .size _start, .-_start
diff --git a/ld/testsuite/ld-x86-64/x86-64.exp b/ld/testsuite/ld-x86-64/x86-64.exp
index db65810..8e5348d 100644
--- a/ld/testsuite/ld-x86-64/x86-64.exp
+++ b/ld/testsuite/ld-x86-64/x86-64.exp
@@ -421,6 +421,7 @@ run_dump_test "pr23486c"
run_dump_test "pr23486c-x32"
run_dump_test "pr23486d"
run_dump_test "pr23486d-x32"
+run_dump_test "pr23854"
if { ![istarget "x86_64-*-linux*"] && ![istarget "x86_64-*-nacl*"]} {
return