[all-commits] [llvm/llvm-project] 885fb9: [ELF][PPC32] Make R_PPC32_PLTREL retain .got

George Koehler via All-commits all-commits at lists.llvm.org
Thu Dec 2 15:28:50 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 885fb9a257faa14ec33ad972df81801483c85da2
      https://github.com/llvm/llvm-project/commit/885fb9a257faa14ec33ad972df81801483c85da2
  Author: George Koehler <kernigh at gmail.com>
  Date:   2021-12-02 (Thu, 02 Dec 2021)

  Changed paths:
    M lld/ELF/Relocations.cpp
    M lld/test/ELF/ppc32-ifunc-nonpreemptible-pic.s
    A lld/test/ELF/ppc32-reloc-pltrel.s
    M lld/test/ELF/ppc32-reloc-rel.s

  Log Message:
  -----------
  [ELF][PPC32] Make R_PPC32_PLTREL retain .got

PLT usage needs the first 12 bytes of the .got section. We need to keep .got and
DT_GOT_PPC even if .got/_GLOBAL_OFFSET_TABLE_ are not referenced (large PIC code
may only reference .got2), which is the case in OpenBSD's ld.so, leading
to a misleading error, "unsupported insecure BSS PLT object".

Fix this by adding R_PPC32_PLTREL to the list of hasGotOffRel.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D114982




More information about the All-commits mailing list