[all-commits] [llvm/llvm-project] 751f18: [ELF] Refine --export-dynamic-symbol semantics to ...

Fangrui Song via All-commits all-commits at lists.llvm.org
Mon Jun 1 11:30:25 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 751f18e7d46dbb53f62c4c567e331b9bc87febf6
      https://github.com/llvm/llvm-project/commit/751f18e7d46dbb53f62c4c567e331b9bc87febf6
  Author: Fangrui Song <maskray at google.com>
  Date:   2020-06-01 (Mon, 01 Jun 2020)

  Changed paths:
    M lld/ELF/Config.h
    M lld/ELF/Driver.cpp
    M lld/ELF/Options.td
    M lld/ELF/ScriptParser.cpp
    M lld/ELF/Symbols.cpp
    M lld/docs/ReleaseNotes.rst
    M lld/docs/ld.lld.1
    M lld/test/ELF/export-dynamic-symbol.s
    M lld/test/ELF/warn-backrefs.s

  Log Message:
  -----------
  [ELF] Refine --export-dynamic-symbol semantics to be compatible GNU ld 2.35

GNU ld from binutils 2.35 onwards will likely support
--export-dynamic-symbol but with different semantics.
https://sourceware.org/pipermail/binutils/2020-May/111302.html

Differences:

1. -export-dynamic-symbol is not supported
2. --export-dynamic-symbol takes a glob argument
3. --export-dynamic-symbol can suppress binding the references to the definition within the shared object if (-Bsymbolic or -Bsymbolic-functions)
4. --export-dynamic-symbol does not imply -u

I don't think the first three points can affect any user.
For the fourth point, Not implying -u can lead to some archive members unfetched.
Add -u foo to restore the previous behavior.

Exact semantics:

* -no-pie or -pie: matched non-local defined symbols will be added to the dynamic symbol table.
* -shared: matched non-local STV_DEFAULT symbols will not be bound to definitions within the shared object
  even if they would otherwise be due to -Bsymbolic, -Bsymbolic-functions, or --dynamic-list.

Reviewed By: psmith

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




More information about the All-commits mailing list