aboutsummaryrefslogtreecommitdiff
path: root/cpu
diff options
context:
space:
mode:
authorStafford Horne <shorne@gmail.com>2021-05-06 20:51:24 +0900
committerStafford Horne <shorne@gmail.com>2021-05-06 20:51:24 +0900
commit0b3e14c90283c5d234884d0ebe8510bc3c9bc687 (patch)
treefb335ba73d837382eb109019f7e4b8ac8f379501 /cpu
parenta76ef689b60405e494cb99e198acf3c82f467f7d (diff)
downloadgdb-0b3e14c90283c5d234884d0ebe8510bc3c9bc687.zip
gdb-0b3e14c90283c5d234884d0ebe8510bc3c9bc687.tar.gz
gdb-0b3e14c90283c5d234884d0ebe8510bc3c9bc687.tar.bz2
or1k: Implement relocation R_OR1K_GOT_AHI16 for gotha()
The gotha() relocation mnemonic will be outputted by OpenRISC GCC when using the -mcmodel=large option. This relocation is used along with got() to generate 32-bit GOT offsets. This increases the previous GOT offset limit from the previous 16-bit (64K) limit. This is needed on large binaries where the GOT grows larger than 64k. bfd/ChangeLog: PR 21464 * bfd-in2.h: Add BFD_RELOC_OR1K_GOT_AHI16 relocation. * elf32-or1k.c (or1k_elf_howto_table, or1k_reloc_map): Likewise. (or1k_final_link_relocate, or1k_elf_relocate_section, or1k_elf_check_relocs): Likewise. * libbfd.h (bfd_reloc_code_real_names): Likewise. * reloc.c: Likewise. cpu/ChangeLog: PR 21464 * or1k.opc (or1k_imm16_relocs, parse_reloc): Define parse logic for gotha() relocation. include/ChangeLog: PR 21464 * elf/or1k.h (elf_or1k_reloc_type): Define R_OR1K_GOT_AHI16 number. opcodes/ChangeLog: PR 21464 * or1k-asm.c: Regenerate. gas/ChangeLog: PR 21464 * testsuite/gas/or1k/reloc-1.s: Add test for new relocation. * testsuite/gas/or1k/reloc-1.d: Add test result for new relocation. Cc: Giulio Benetti <giulio.benetti@benettiengineering.com> fixup reloc, add tests
Diffstat (limited to 'cpu')
-rw-r--r--cpu/ChangeLog6
-rw-r--r--cpu/or1k.opc7
2 files changed, 12 insertions, 1 deletions
diff --git a/cpu/ChangeLog b/cpu/ChangeLog
index f6e5087..2739df0 100644
--- a/cpu/ChangeLog
+++ b/cpu/ChangeLog
@@ -1,3 +1,9 @@
+2021-05-06 Stafford Horne <shorne@gmail.com>
+
+ PR 21464
+ * or1k.opc (or1k_imm16_relocs, parse_reloc): Define parse logic
+ for gotha() relocation.
+
2021-03-31 Alan Modra <amodra@gmail.com>
* frv.opc: Replace bfd_boolean with bool, FALSE with false, and
diff --git a/cpu/or1k.opc b/cpu/or1k.opc
index f0adcbb..5d20a1f 100644
--- a/cpu/or1k.opc
+++ b/cpu/or1k.opc
@@ -193,7 +193,7 @@ static const bfd_reloc_code_real_type or1k_imm16_relocs[][6] = {
BFD_RELOC_OR1K_GOT_LO13,
BFD_RELOC_UNUSED,
BFD_RELOC_UNUSED,
- BFD_RELOC_UNUSED },
+ BFD_RELOC_OR1K_GOT_AHI16 },
{ BFD_RELOC_OR1K_GOTPC_LO16,
BFD_RELOC_UNUSED,
BFD_RELOC_UNUSED,
@@ -296,6 +296,11 @@ parse_reloc (const char **strp)
str += 5;
cls = RCLASS_TPOFF;
}
+ else if (strncasecmp (str, "got", 3) == 0)
+ {
+ str += 3;
+ cls = RCLASS_GOT;
+ }
if (strncasecmp (str, "hi(", 3) == 0)
{