aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorNelson Chu <nelson.chu@sifive.com>2020-08-26 01:19:13 -0700
committerNelson Chu <nelson.chu@sifive.com>2020-08-28 09:37:35 +0800
commit3b1450b38c644f99aa2e211747b428b9f8d15cca (patch)
treea75075ca5c25bb1bbe1b2e3a5138f6cb0d8f3280 /ld
parentf2f08254b11c2248dc3fd9440b2bad29c74357e4 (diff)
downloadgdb-3b1450b38c644f99aa2e211747b428b9f8d15cca.zip
gdb-3b1450b38c644f99aa2e211747b428b9f8d15cca.tar.gz
gdb-3b1450b38c644f99aa2e211747b428b9f8d15cca.tar.bz2
RISC-V: Treat R_RISCV_CALL and R_RISCV_CALL_PLT as the same in check_relocs.
In fact, we can treate these two relocation as the same one in the riscv_elf_check_relocs. I have heard that RISC-V lld had made this improvement, and so had GNU AARCH64, they only need R_AARCH64_CALL26 for calls rather than two seperate relocations. Beside, the following PLT issue for RISC-V 32-bit glibc seems to be fixed by applying at least this patch. <https://sourceware.org/pipermail/libc-alpha/2020-August/117214.html> I have ran the toolchain regression, and everything seems fine for now. bfd/ * elfnn-riscv.c (riscv_elf_check_relocs): Treat R_RISCV_CALL and R_RISCV_CALL_PLT as the same in the riscv_elf_check_relocs. (riscv_elf_relocate_section): Remove the R_RISCV_CALL for the unresolved reloc checks. ld/ testsuite/ld-riscv-elf/lib-nopic-01a.s: Use R_RISCV_JAL rather than R_RISCV_CALL. testsuite/ld-riscv-elf/lib-nopic-01b.d: Likewise. testsuite/ld-riscv-elf/lib-nopic-01b.s: Likewise.
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog7
-rw-r--r--ld/testsuite/ld-riscv-elf/lib-nopic-01a.s2
-rw-r--r--ld/testsuite/ld-riscv-elf/lib-nopic-01b.d2
-rw-r--r--ld/testsuite/ld-riscv-elf/lib-nopic-01b.s2
4 files changed, 10 insertions, 3 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 7881dd1..787d760 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,10 @@
+2020-08-28 Nelson Chu <nelson.chu@sifive.com>
+
+ testsuite/ld-riscv-elf/lib-nopic-01a.s: Use R_RISCV_JAL rather
+ than R_RISCV_CALL.
+ testsuite/ld-riscv-elf/lib-nopic-01b.d: Likewise.
+ testsuite/ld-riscv-elf/lib-nopic-01b.s: Likewise.
+
2020-08-27 Jozef Lawrynowicz <jozef.l@mittosystems.com>
* emultempl/msp430.em: Remove unused variable "buf".
diff --git a/ld/testsuite/ld-riscv-elf/lib-nopic-01a.s b/ld/testsuite/ld-riscv-elf/lib-nopic-01a.s
index c95cda0..632875d 100644
--- a/ld/testsuite/ld-riscv-elf/lib-nopic-01a.s
+++ b/ld/testsuite/ld-riscv-elf/lib-nopic-01a.s
@@ -4,6 +4,6 @@
.globl func1
.type func1, @function
func1:
- call func2
+ jal func2
jr ra
.size func1, .-func1
diff --git a/ld/testsuite/ld-riscv-elf/lib-nopic-01b.d b/ld/testsuite/ld-riscv-elf/lib-nopic-01b.d
index 0d758a4..1c2c907 100644
--- a/ld/testsuite/ld-riscv-elf/lib-nopic-01b.d
+++ b/ld/testsuite/ld-riscv-elf/lib-nopic-01b.d
@@ -2,4 +2,4 @@
#source: lib-nopic-01b.s
#as:
#ld: -shared tmpdir/lib-nopic-01a.so
-#error: .*relocation R_RISCV_CALL against `func1' can not be used when making a shared object; recompile with -fPIC
+#error: .*relocation R_RISCV_JAL against `func1' can not be used when making a shared object; recompile with -fPIC
diff --git a/ld/testsuite/ld-riscv-elf/lib-nopic-01b.s b/ld/testsuite/ld-riscv-elf/lib-nopic-01b.s
index 97fe137..ea7b029 100644
--- a/ld/testsuite/ld-riscv-elf/lib-nopic-01b.s
+++ b/ld/testsuite/ld-riscv-elf/lib-nopic-01b.s
@@ -4,6 +4,6 @@
.globl func2
.type func2, @function
func2:
- call func1
+ jal func1
jr ra
.size func2, .-func2