From a6cbf936e3dce68114d28cdf60d510a3f78a6d40 Mon Sep 17 00:00:00 2001 From: Kuan-Lin Chen Date: Thu, 8 Jun 2017 11:54:14 -0700 Subject: RISC-V: Use pc-relative relocation for FDE initial location The symbol address in .eh_frame may be adjusted in _bfd_elf_discard_section_eh_frame, and the content of .eh_frame will be adjusted in _bfd_elf_write_section_eh_frame. Therefore, we cannot insert a relocation whose addend symbol is in .eh_frame. Othrewise, the value may be adjusted twice. bfd/ChangeLog 2017-06-26 Kuan-Lin Chen * elfnn-riscv.c (perform_relocation): Support the new R_RISCV_32_PCREL relocation. (riscv_elf_relocate_section): Likewise. * elfxx-riscv.c (howto_table): Likewise. (riscv_reloc_map): Likewise. * bfd-in2.h (BFD_RELOC_RISCV_32_PCREL): New relocation. * libbfd.h: Regenerate. gas/ChangeLog 2017-06-26 Kuan-Lin Chen * config/tc-riscv.c (md_apply_fix) [BFD_RELOC_32]: Convert to a R_RISCV_32_PCREL relocation. include/ChangeLog 2017-06-26 Kuan-Lin Chen * elf/riscv.h (R_RISCV_32_PCREL): New. --- bfd/libbfd.h | 1 + 1 file changed, 1 insertion(+) (limited to 'bfd/libbfd.h') diff --git a/bfd/libbfd.h b/bfd/libbfd.h index 09df3b2..ae9bf76 100644 --- a/bfd/libbfd.h +++ b/bfd/libbfd.h @@ -2215,6 +2215,7 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", "BFD_RELOC_RISCV_SET8", "BFD_RELOC_RISCV_SET16", "BFD_RELOC_RISCV_SET32", + "BFD_RELOC_RISCV_32_PCREL", "BFD_RELOC_RL78_NEG8", "BFD_RELOC_RL78_NEG16", "BFD_RELOC_RL78_NEG24", -- cgit v1.1