From 0b3e14c90283c5d234884d0ebe8510bc3c9bc687 Mon Sep 17 00:00:00 2001 From: Stafford Horne Date: Thu, 6 May 2021 20:51:24 +0900 Subject: 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 fixup reloc, add tests --- include/ChangeLog | 5 +++++ include/elf/or1k.h | 1 + 2 files changed, 6 insertions(+) (limited to 'include') diff --git a/include/ChangeLog b/include/ChangeLog index aed37fd..621045e 100644 --- a/include/ChangeLog +++ b/include/ChangeLog @@ -1,3 +1,8 @@ +2021-05-06 Stafford Horne + + PR 21464 + * elf/or1k.h (elf_or1k_reloc_type): Define R_OR1K_GOT_AHI16 number. + 2021-05-06 Nick Alcock * ctf.h (CTF_K_UNKNOWN): Document that it can be used for diff --git a/include/elf/or1k.h b/include/elf/or1k.h index 7f28148..69ab905 100644 --- a/include/elf/or1k.h +++ b/include/elf/or1k.h @@ -77,6 +77,7 @@ START_RELOC_NUMBERS (elf_or1k_reloc_type) RELOC_NUMBER (R_OR1K_TLS_IE_LO13, 51) RELOC_NUMBER (R_OR1K_SLO13, 52) RELOC_NUMBER (R_OR1K_PLTA26, 53) + RELOC_NUMBER (R_OR1K_GOT_AHI16, 54) END_RELOC_NUMBERS (R_OR1K_max) #define EF_OR1K_NODELAY (1UL << 0) -- cgit v1.1