diff options
author | mengqinggang <mengqinggang@loongson.cn> | 2023-06-25 17:47:42 +0800 |
---|---|---|
committer | liuzhensong <liuzhensong@loongson.cn> | 2023-06-28 16:14:35 +0800 |
commit | be1ebb6710a8f707bd4b0eecbd00f4f4964050e5 (patch) | |
tree | 413bfa848b9cd768137c124d640890f63daf6fab /include | |
parent | 69933be89fe5002d2d541ecf2145d5ccac19bbac (diff) | |
download | gdb-be1ebb6710a8f707bd4b0eecbd00f4f4964050e5.zip gdb-be1ebb6710a8f707bd4b0eecbd00f4f4964050e5.tar.gz gdb-be1ebb6710a8f707bd4b0eecbd00f4f4964050e5.tar.bz2 |
LoongArch: Add R_LARCH_64_PCREL relocation support
Gas defaults to emit R_LARCH_ADD64/R_LARCH_SUB64 unless explcitly declared
to emit R_LARCH_64_PCREL.
The LoongArch ABI at here:
https://github.com/loongson/la-abi-specs/blob/release/la-abi.adoc
bfd/ChangeLog:
* bfd-in2.h (not): Add R_LARCH_64_PCREL
* elfnn-loongarch.c (perform_relocation): Likewise.
* elfxx-loongarch.c: Likewise.
* libbfd.h: Likewise.
* reloc.c: Likewise.
gas/ChangeLog:
* config/tc-loongarch.c (loongarch_args_parser_can_match_arg_helper):
(md_apply_fix): Add R_LARCH_64_PCREL.
* testsuite/gas/loongarch/64_pcrel.d: New test.
* testsuite/gas/loongarch/64_pcrel.s: New test.
include/ChangeLog:
* elf/loongarch.h (RELOC_NUMBER): Add R_LARCH_64_PCREL.
ld/ChangeLog:
* testsuite/ld-loongarch-elf/ld-loongarch-elf.exp: Add test.
* testsuite/ld-loongarch-elf/64_pcrel.d: New test.
* testsuite/ld-loongarch-elf/64_pcrel.s: New test.
Diffstat (limited to 'include')
-rw-r--r-- | include/elf/loongarch.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/elf/loongarch.h b/include/elf/loongarch.h index 71ab34f..e31395e 100644 --- a/include/elf/loongarch.h +++ b/include/elf/loongarch.h @@ -249,6 +249,8 @@ RELOC_NUMBER (R_LARCH_SUB6, 106) RELOC_NUMBER (R_LARCH_ADD_ULEB128, 107) RELOC_NUMBER (R_LARCH_SUB_ULEB128, 108) +RELOC_NUMBER (R_LARCH_64_PCREL, 109) + END_RELOC_NUMBERS (R_LARCH_count) /* Processor specific flags for the ELF header e_flags field. */ |