This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH 3/9] Rework RISC-V relocations
On Sun, Dec 18, 2016 at 08:27:05PM -0800, Palmer Dabbelt wrote:
> 2016-12-14 Andrew Waterman <andrew@sifive.com>
> Kuan-Lin Chen <kuanlinchentw@gmail.com>
>
> * reloc.c (BFD_RELOC_RISCV_TPREL_I): New relocation.
> * reloc.c (BFD_RELOC_RISCV_TPREL_S): Likewise.
> * reloc.c (BFD_RELOC_RISCV_RELAX): Likewise.
> * reloc.c (BFD_RELOC_RISCV_CFA): Likewise.
> * reloc.c (BFD_RELOC_RISCV_SUB6): Likewise.
> * reloc.c (BFD_RELOC_RISCV_SET8): Likewise.
> * reloc.c (BFD_RELOC_RISCV_SET8): Likewise.
> * reloc.c (BFD_RELOC_RISCV_SET16): Likewise.
> * reloc.c (BFD_RELOC_RISCV_SET32): Likewise.
Omit repeating the file name.
> * bfd-in2.h: Regenerate.
> * libbfd.h: Likewise.
> * elfnn-riscv.c (perform_relocation): Handle the new
> relocations.
> * elfnn-riscv.c (_bfd_riscv_relax_tls_le): Likewise.
> * elfnn-riscv.c (_bfd_riscv_relax_align): Likewise.
> * elfnn-riscv.c (_bfd_riscv_relax_section): Likewise.
> * elfnn-riscv.c (howto_table): Likewise.
> * elfnn-riscv.c (riscv_reloc_map): Likewise.
Similarly, and merge below with above. If there is reason to separate
into two ChangeLog entries, then separate the patch too.
> 2016-12-14 Andrew Waterman <andrew@sifive.com>
> Kuan-Lin Chen <kuanlinchentw@gmail.com>
>
> * elfnn-riscv.c (relax_func_t): New type.
> * elfnn-riscv.c (_bfd_riscv_relax_call): Add reserve_size
> argument, which controls the maximal offset pessimism.
> * elfnn-riscv.c (_bfd_riscv_relax_lui): Likewise.
> * elfnn-riscv.c (_bfd_riscv_relax_tls_le): Likewise.
> * elfnn-riscv.c (_bfd_riscv_relax_align): Likewise.
> * elfnn-riscv.c (_bfd_riscv_relax_section): Compute the required
> reserve size when relocating and use it to when calling
> relax_func.
>
> gas/ChangeLog
>
> 2016-12-14 Andrew Waterman <andrew@sifive.com>
> Kuan-Lin Chen <kuanlinchentw@gmail.com>
>
> * config/tc-riscv.c (riscv_set_options): Add relax.
> * config/tc-riscv.c (riscv_opts): Likewise.
> * config/tc-riscv.c (s_riscv_option): Add relax and norelax.
> * config/tc-riscv.c (riscv_apply_const_reloc): New function.
> * config/tc-riscv.c (append_insn): Move constant relocation
> handling to riscv_apply_const_reloc.
> * config/tc-riscv.c (md_pcrel_from): Likewise.
> * config/tc-riscv.c (parse_relocation): Skip BFD_RELOC_UNUSED.
> * config/tc-riscv.c (md_pcrel_from): Handle
> BFD_RELOC_RISCV_SUB6, BFD_RELOC_RISCV_RELAX,
> BFD_RELOC_RISCV_CFA.
> * config/tc-riscv.c (md_apply_fix): Likewise.
> * config/tc-riscv.c (riscv_pre_output_hook): New function.
> * config/tc-riscv.h (md_pre_output_hook): Use
> riscv_pre_output_hook.
> * config/tc-riscv.h (DWARF_CIE_DATA_ALIGNMENT): Always -4.
Again, don't repeat file name. Same comment applies to following
patches, but otherwise looks reasonable.
--
Alan Modra
Australia Development Lab, IBM