aboutsummaryrefslogtreecommitdiff
path: root/gas/testsuite
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2020-04-01 05:40:45 -0700
committerH.J. Lu <hjl.tools@gmail.com>2020-04-01 05:41:06 -0700
commitefc3a950394676d0781f0397655d1e8be56450bf (patch)
tree1052e935c34a5ebe3f01be8cd9b22e66c60ab257 /gas/testsuite
parent15d47c3a70526cce7bb6a9dcdbd1c19c40247e32 (diff)
downloadgdb-efc3a950394676d0781f0397655d1e8be56450bf.zip
gdb-efc3a950394676d0781f0397655d1e8be56450bf.tar.gz
gdb-efc3a950394676d0781f0397655d1e8be56450bf.tar.bz2
x86: Force relocation against local absolute symbol
Define TC_FORCE_RELOCATION_ABS to force relocation against local absolute symbol. PR gas/25756 * config/tc-i386.h (TC_FORCE_RELOCATION_ABS): New. * testsuite/gas/i386/localpic.s: Add a test for relocation against local absolute symbol. * testsuite/gas/i386/x86-64-localpic.s: Likewise. * testsuite/gas/i386/localpic.d: Updated. * testsuite/gas/i386/x86-64-localpic.d: Likewise. * testsuite/gas/i386/ilp32/x86-64-localpic.d: Likewise.
Diffstat (limited to 'gas/testsuite')
-rw-r--r--gas/testsuite/gas/i386/ilp32/x86-64-localpic.d4
-rw-r--r--gas/testsuite/gas/i386/localpic.d4
-rw-r--r--gas/testsuite/gas/i386/localpic.s2
-rw-r--r--gas/testsuite/gas/i386/x86-64-localpic.d4
-rw-r--r--gas/testsuite/gas/i386/x86-64-localpic.s2
5 files changed, 13 insertions, 3 deletions
diff --git a/gas/testsuite/gas/i386/ilp32/x86-64-localpic.d b/gas/testsuite/gas/i386/ilp32/x86-64-localpic.d
index e9b77f2..d0cc4e8 100644
--- a/gas/testsuite/gas/i386/ilp32/x86-64-localpic.d
+++ b/gas/testsuite/gas/i386/ilp32/x86-64-localpic.d
@@ -3,9 +3,11 @@
#readelf: -rsW
#name: x86-64 (ILP32) local PIC
-Relocation section '.rela.text' at offset 0x[0-9a-f]+ contains 1 entry:
+Relocation section '.rela.text' at offset 0x[0-9a-f]+ contains 2 entries:
+Offset +Info +Type +Sym. Value +Symbol's Name \+ Addend
[0-9a-f]+ +[0-9a-f]+ R_X86_64_REX_GOTPCRELX +[0-9a-f]+ +foo - 4
+[0-9a-f]+ +[0-9a-f]+ R_X86_64_REX_GOTPCRELX +[0-9a-f]+ +bar - 4
#...
+[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +NOTYPE +LOCAL +DEFAULT +[0-9]+ +foo
+ +[0-9]+: +fffffff0 +[0-9a-f]+ +NOTYPE +LOCAL +DEFAULT +ABS +bar
#pass
diff --git a/gas/testsuite/gas/i386/localpic.d b/gas/testsuite/gas/i386/localpic.d
index 88d3566..b06137f 100644
--- a/gas/testsuite/gas/i386/localpic.d
+++ b/gas/testsuite/gas/i386/localpic.d
@@ -2,9 +2,11 @@
#readelf: -rs
#name: i386 local PIC
-Relocation section '.rel.text' at offset 0x[0-9a-f]+ contains 1 entry:
+Relocation section '.rel.text' at offset 0x[0-9a-f]+ contains 2 entries:
Offset Info Type Sym.Value Sym. Name
[0-9a-f]+ +[0-9a-f]+ R_386_GOT32X +[0-9a-f]+ +foo
+[0-9a-f]+ +[0-9a-f]+ R_386_GOT32X +[0-9a-f]+ +bar
#...
+[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +NOTYPE +LOCAL +DEFAULT +[0-9]+ +foo
+ +[0-9]+: +fffffff0 +[0-9a-f]+ +NOTYPE +LOCAL +DEFAULT +ABS +bar
#pass
diff --git a/gas/testsuite/gas/i386/localpic.s b/gas/testsuite/gas/i386/localpic.s
index e633944..f57fb18 100644
--- a/gas/testsuite/gas/i386/localpic.s
+++ b/gas/testsuite/gas/i386/localpic.s
@@ -3,3 +3,5 @@ foo:
.long 0
.text
movl foo@GOT(%ecx), %eax
+movl bar@GOT(%ecx), %eax
+ bar = 0xfffffff0
diff --git a/gas/testsuite/gas/i386/x86-64-localpic.d b/gas/testsuite/gas/i386/x86-64-localpic.d
index 9f8b43e..62030d4 100644
--- a/gas/testsuite/gas/i386/x86-64-localpic.d
+++ b/gas/testsuite/gas/i386/x86-64-localpic.d
@@ -2,9 +2,11 @@
#readelf: -rsW
#name: x86-64 local PIC
-Relocation section '.rela.text' at offset 0x[0-9a-f]+ contains 1 entry:
+Relocation section '.rela.text' at offset 0x[0-9a-f]+ contains 2 entries:
+Offset +Info +Type +Symbol's Value +Symbol's Name \+ Addend
[0-9a-f]+ +[0-9a-f]+ R_X86_64_REX_GOTPCRELX +[0-9a-f]+ +foo - 4
+[0-9a-f]+ +[0-9a-f]+ R_X86_64_REX_GOTPCRELX +[0-9a-f]+ +bar - 4
#...
+[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +NOTYPE +LOCAL +DEFAULT +[0-9]+ +foo
+ +[0-9]+: +0+fffffff0 +[0-9a-f]+ +NOTYPE +LOCAL +DEFAULT +ABS +bar
#pass
diff --git a/gas/testsuite/gas/i386/x86-64-localpic.s b/gas/testsuite/gas/i386/x86-64-localpic.s
index c73a7c5..beda94d 100644
--- a/gas/testsuite/gas/i386/x86-64-localpic.s
+++ b/gas/testsuite/gas/i386/x86-64-localpic.s
@@ -2,3 +2,5 @@
foo:
.quad 0
movq foo@GOTPCREL(%rip), %rax
+ movq bar@GOTPCREL(%rip), %rax
+ bar = 0xfffffff0