[all-commits] [llvm/llvm-project] 997f2a: [ELF] Avoid wrapping unreferenced lazy symbols

Shoaib Meenai via All-commits all-commits at lists.llvm.org
Fri Feb 4 18:14:25 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 997f2a56dea16a8b0a8827ca00cbaa21fbcd2338
      https://github.com/llvm/llvm-project/commit/997f2a56dea16a8b0a8827ca00cbaa21fbcd2338
  Author: Shoaib Meenai <smeenai at fb.com>
  Date:   2022-02-04 (Fri, 04 Feb 2022)

  Changed paths:
    M lld/ELF/Driver.cpp
    A lld/test/ELF/wrap-lazy.test

  Log Message:
  -----------
  [ELF] Avoid wrapping unreferenced lazy symbols

There's a couple of motivations here:
* LLD 12 (which I was originally testing with) was adding an undefined
  symbol to the symbol table if you attempted to wrap an unreferenced
  lazy symbol, which would later break `--no-allow-shlib-undefined`. LLD
  on main actually produces a weak undefined symbol, so this doesn't
  break anyway, but it's cleaner to not have the weak undefined symbol
  as well. The new behavior also matches bfd and gold.
* PROVIDE in a linker script referencing a wrapped symbol would think
  that an otherwise-unreferenced lazy symbol which was wrapped was
  actually referenced, and therefore proceed with the definition, which
  goes against expectations. The new behavior also matches bfd and gold.

Reviewed By: MaskRay

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




More information about the All-commits mailing list