[PATCH] x86: Only allow S - A relocations against absolute symbol

Fangrui Song i@maskray.me
Tue Mar 31 06:17:51 GMT 2020


On 2020-03-30, H.J. Lu via Binutils wrote:
>Since value of non-preemptible absolute symbol (SHN_ABS) won't change,
>only S - A relocations against non-preemptible absolute symbol are
>allowed in PIE and shared library.

Thanks for the patch. At some point we should define some generic
relocation categories (https://reviews.llvm.org/rL266158). For example,

- R_ABS: R_X86_64_8, R_X86_64_16, R_X86_64_32, R_X86_64_64
          R_AARCH64_ABS16, R_AARCH64_ABS32, R_AARCH64_ABS64
          R_PPC64_ADDR16, R_PPC64_ADDR16_DS, R_PPC64_ADDR16_HA, ...
- R_PCREL: R_X86_64_PC8, R_X86_64_PC16, R_X86_64_PC32, R_X86_64_PC64
          R_AARCH64_PREL16, R_AARCH64_PREL32, R_AARCH64_PREL64
- R_PLT_PCREL: R_X86_64_PLT32, R_AARCH64_CALL26
- R_GOT_PCREL: R_X86_64_GOTPCREL, R_X86_64_GOTPCRELX

Define a property is_preemptible as a more appropriate level of
abstraction for GENERATE_DYNAMIC_RELOCATION_P and some use cases of bfd_link_pic and bfd_link_executable...



More information about the Binutils mailing list