RISC-V: Extract the ld code which are too complicated, and may be reused.
authorNelson Chu <nelson@rivosinc.com>
Sat, 25 Mar 2023 00:41:11 +0000 (08:41 +0800)
committerNelson Chu <nelson@rivosinc.com>
Wed, 29 Mar 2023 23:40:02 +0000 (07:40 +0800)
commit23068b02d3a6743658110c7662178fdebbe2ac6a
treefc44873b1f3c23c36c214916978456ee4b2d1c24
parent2fc3b8a4cb8439fc53975c4e70336d76e3ddc531
RISC-V: Extract the ld code which are too complicated, and may be reused.

These types of codes are different for each target, I am not sure what are the
best for RISC-V, so extract them out may be more easy to compare what's the
difference.

bfd/
    * elfnn-riscv.c (RISCV_NEED_DYNAMIC_RELOC): New defined.  Extracted
    from riscv_elf_check_relocs, to see if dynamic reloc is needed for the
    specific relocation.
    (RISCV_GENERATE_DYNAMIC_RELOC): New defined.  Extracted from
    riscv_elf_relocate_section, to see if R_RISCV_32/64 need to generate
    dynamic relocation.
    (RISCV_COPY_INPUT_RELOC): New defined.  Extracted from
    riscv_elf_relocate_section, to see if R_RISCV_32/64 need to copy itslef
    tp output file.
    (RISCV_RESOLVED_LOCALLY): New defined.  Extracted from
    riscv_elf_relocate_section, to see if R_RISCV_GOT_HI20 can be resolved
    locally.
bfd/elfnn-riscv.c