aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-i386/pr23854.s
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-i386/pr23854.s
parent713f1b445a18af04eafbf8df6f844bed8243963f (diff)
downloadbinutils-e60f4d3bdac25f02875afe36b7436bc2dfbbb978.zip
binutils-e60f4d3bdac25f02875afe36b7436bc2dfbbb978.tar.gz
binutils-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-i386/pr23854.s')
-rw-r--r--ld/testsuite/ld-i386/pr23854.s33
1 files changed, 33 insertions, 0 deletions
diff --git a/ld/testsuite/ld-i386/pr23854.s b/ld/testsuite/ld-i386/pr23854.s
new file mode 100644
index 0000000..565e747
--- /dev/null
+++ b/ld/testsuite/ld-i386/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@GOT(%ecx), %ax
+ addw bar@GOT(%ecx), %bx
+ andw bar@GOT(%ecx), %cx
+ cmpw bar@GOT(%ecx), %dx
+ orw bar@GOT(%ecx), %di
+ sbbw bar@GOT(%ecx), %si
+ subw bar@GOT(%ecx), %bp
+ xorw bar@GOT(%ecx), %sp
+ testw %cx, bar@GOT(%ecx)
+ adcw foo@GOT(%ecx), %ax
+ addw foo@GOT(%ecx), %bx
+ andw foo@GOT(%ecx), %cx
+ cmpw foo@GOT(%ecx), %dx
+ orw foo@GOT(%ecx), %di
+ sbbw foo@GOT(%ecx), %si
+ subw foo@GOT(%ecx), %bp
+ xorw foo@GOT(%ecx), %sp
+ testw %cx, foo@GOT(%ecx)
+ .size _start, .-_start