diff options
author | Stafford Horne <shorne@gmail.com> | 2021-05-06 20:51:24 +0900 |
---|---|---|
committer | Stafford Horne <shorne@gmail.com> | 2021-05-06 20:51:24 +0900 |
commit | 0b3e14c90283c5d234884d0ebe8510bc3c9bc687 (patch) | |
tree | fb335ba73d837382eb109019f7e4b8ac8f379501 /gas | |
parent | a76ef689b60405e494cb99e198acf3c82f467f7d (diff) | |
download | gdb-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 'gas')
-rw-r--r-- | gas/ChangeLog | 7 | ||||
-rw-r--r-- | gas/testsuite/gas/or1k/reloc-1.d | 4 | ||||
-rw-r--r-- | gas/testsuite/gas/or1k/reloc-1.s | 4 |
3 files changed, 14 insertions, 1 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index fa1c100..790951a 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,10 @@ +2021-05-06 Stafford Horne <shorne@gmail.com> + + 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. + 2021-05-03 Christoph Muellner <cmuellner@gcc.gnu.org> PR 27764 diff --git a/gas/testsuite/gas/or1k/reloc-1.d b/gas/testsuite/gas/or1k/reloc-1.d index d1bcf56..3a001c4 100644 --- a/gas/testsuite/gas/or1k/reloc-1.d +++ b/gas/testsuite/gas/or1k/reloc-1.d @@ -68,5 +68,7 @@ OFFSET TYPE VALUE 000000ec R_OR1K_LO13 x 000000f0 R_OR1K_GOT_LO13 x 000000f4 R_OR1K_SLO13 x - +000000f8 R_OR1K_GOT_AHI16 x +000000fc R_OR1K_GOT_AHI16 x +00000100 R_OR1K_GOT_AHI16 x diff --git a/gas/testsuite/gas/or1k/reloc-1.s b/gas/testsuite/gas/or1k/reloc-1.s index e76abef..562609a 100644 --- a/gas/testsuite/gas/or1k/reloc-1.s +++ b/gas/testsuite/gas/or1k/reloc-1.s @@ -74,3 +74,7 @@ l.lbz r5,po(x)(r3) l.lbz r5,gotpo(x)(r3) l.sb po(x)(r3),r6 + + l.movhi r4,gotha(x) + l.ori r3,r4,gotha(x) + l.addi r3,r4,gotha(x) |