aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2020-07-19 06:51:19 -0700
committerH.J. Lu <hjl.tools@gmail.com>2020-07-19 06:51:32 -0700
commit2585b7a5ce5830e60a089aa2316a329558902f0c (patch)
tree6ff218fb5b0fe5ad80a2cdabd0aa909416e0a6a2 /ld
parent4609ada49f559880e85aecc2f37f377e5bff8696 (diff)
downloadgdb-2585b7a5ce5830e60a089aa2316a329558902f0c.zip
gdb-2585b7a5ce5830e60a089aa2316a329558902f0c.tar.gz
gdb-2585b7a5ce5830e60a089aa2316a329558902f0c.tar.bz2
x86: Change PLT32 reloc against section to PC32
Commit 292676c1 resolved PLT32 reloc aganst local symbol to section. Since PLT32 relocation must be against symbols, turn such PLT32 relocation into PC32 relocation. gas/ PR gas/26263 * config/tc-i386.c (i386_validate_fix): Change PLT32 reloc against section to PC32 reloc. * testsuite/gas/i386/relax-5.d: Updated. * testsuite/gas/i386/x86-64-relax-4.d: Likewise. ld/ PR gas/26263 * testsuite/ld-i386/i386.exp: Run PR gas/26263 test. * testsuite/ld-x86-64/x86-64.exp: Likewise. * testsuite/ld-i386/pr26263.d: New file. * testsuite/ld-x86-64/pr26263.d: Likewise. * testsuite/ld-x86-64/pr26263.s: Likewise.
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog9
-rw-r--r--ld/testsuite/ld-i386/i386.exp1
-rw-r--r--ld/testsuite/ld-i386/pr26263.d19
-rw-r--r--ld/testsuite/ld-x86-64/pr26263.d18
-rw-r--r--ld/testsuite/ld-x86-64/pr26263.s8
-rw-r--r--ld/testsuite/ld-x86-64/x86-64.exp1
6 files changed, 56 insertions, 0 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 37a94aa..7478568 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,12 @@
+2020-07-19 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR gas/26263
+ * testsuite/ld-i386/i386.exp: Run PR gas/26263 test.
+ * testsuite/ld-x86-64/x86-64.exp: Likewise.
+ * testsuite/ld-i386/pr26263.d: New file.
+ * testsuite/ld-x86-64/pr26263.d: Likewise.
+ * testsuite/ld-x86-64/pr26263.s: Likewise.
+
2020-07-19 Hans-Peter Nilsson <hp@bitrange.com>
* scripttempl/elf.sc (ETEXT_LAST_IN_RODATA_SEGMENT): New variable.
diff --git a/ld/testsuite/ld-i386/i386.exp b/ld/testsuite/ld-i386/i386.exp
index e51981a..164c099 100644
--- a/ld/testsuite/ld-i386/i386.exp
+++ b/ld/testsuite/ld-i386/i386.exp
@@ -469,6 +469,7 @@ run_dump_test "pr24322a"
run_dump_test "pr24322b"
run_dump_test "align-branch-1"
run_dump_test "pr26018"
+run_dump_test "pr26263"
if { !([istarget "i?86-*-linux*"]
|| [istarget "i?86-*-gnu*"]
diff --git a/ld/testsuite/ld-i386/pr26263.d b/ld/testsuite/ld-i386/pr26263.d
new file mode 100644
index 0000000..8cf7c15
--- /dev/null
+++ b/ld/testsuite/ld-i386/pr26263.d
@@ -0,0 +1,19 @@
+#source: ../ld-x86-64/pr26263.s
+#as: --32
+#ld: -shared -melf_i386
+#objdump: -dw
+
+.*: +file format .*
+
+
+Disassembly of section .text:
+
+0+1000 <printk>:
+ +[a-f0-9]+: c3 ret
+
+Disassembly of section .init.text:
+
+0+1001 <foo>:
+ +[a-f0-9]+: e8 fa ff ff ff call 1000 <printk>
+ +[a-f0-9]+: e8 f5 ff ff ff call 1000 <printk>
+#pass
diff --git a/ld/testsuite/ld-x86-64/pr26263.d b/ld/testsuite/ld-x86-64/pr26263.d
new file mode 100644
index 0000000..375218c
--- /dev/null
+++ b/ld/testsuite/ld-x86-64/pr26263.d
@@ -0,0 +1,18 @@
+#as: --64
+#ld: -m elf_x86_64 -shared
+#objdump: -dw
+
+.*: +file format .*
+
+
+Disassembly of section .text:
+
+0+1000 <printk>:
+ +[a-f0-9]+: c3 ret
+
+Disassembly of section .init.text:
+
+0+1001 <foo>:
+ +[a-f0-9]+: e8 fa ff ff ff call 1000 <printk>
+ +[a-f0-9]+: e8 f5 ff ff ff call 1000 <printk>
+#pass
diff --git a/ld/testsuite/ld-x86-64/pr26263.s b/ld/testsuite/ld-x86-64/pr26263.s
new file mode 100644
index 0000000..5a3332c
--- /dev/null
+++ b/ld/testsuite/ld-x86-64/pr26263.s
@@ -0,0 +1,8 @@
+ .section .init.text,"ax",@progbits
+ .global foo
+foo:
+ call printk
+ call printk@PLT
+ .text
+printk:
+ ret
diff --git a/ld/testsuite/ld-x86-64/x86-64.exp b/ld/testsuite/ld-x86-64/x86-64.exp
index e687c42..21aa6a0 100644
--- a/ld/testsuite/ld-x86-64/x86-64.exp
+++ b/ld/testsuite/ld-x86-64/x86-64.exp
@@ -640,6 +640,7 @@ run_dump_test "pr20253-5b"
run_dump_test "tlsdesc2"
run_dump_test "pr22048"
run_dump_test "pr22929"
+run_dump_test "pr26263"
proc undefined_weak {cflags ldflags} {
set testname "Undefined weak symbol"