[all-commits] [llvm/llvm-project] 7b06bf: [ELF] -pie: produce dynamic relocations for absolu...

Fangrui Song via All-commits all-commits at lists.llvm.org
Wed Jun 30 09:43:40 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7b06bfc49ec9d560fa50996ecf7f16b7c2f47c9d
      https://github.com/llvm/llvm-project/commit/7b06bfc49ec9d560fa50996ecf7f16b7c2f47c9d
  Author: Fangrui Song <i at maskray.me>
  Date:   2021-06-30 (Wed, 30 Jun 2021)

  Changed paths:
    M lld/ELF/Relocations.cpp
    M lld/test/ELF/weak-undef-rw.s

  Log Message:
  -----------
  [ELF] -pie: produce dynamic relocations for absolute relocations referencing undef weak

See the comment for my understanding of -no-pie and -shared expectation.
-no-pie has freedom on choices. We choose dynamic relocations to be consistent
with the handling of GOT-generating relocations.

Note: GNU ld has arch-varying behaviors and its x86 -pie has a very
complex rule:
if there is at least one GOT-generating or PLT-generating relocation and
-z dynamic-undefined-weak (enabled by default) is in effect, generate a
dynamic relocation.

We don't emulate its rule.

Reviewed By: peter.smith

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




More information about the All-commits mailing list