[all-commits] [llvm/llvm-project] 3eb4bf: [ELF] Append " [--no-allow-shlib-undefined]" to th...

Fangrui Song via All-commits all-commits at lists.llvm.org
Wed Jun 3 08:00:33 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 3eb4bf13bae85fb48c4eca8c59c84491015fb4d6
      https://github.com/llvm/llvm-project/commit/3eb4bf13bae85fb48c4eca8c59c84491015fb4d6
  Author: Fangrui Song <maskray at google.com>
  Date:   2020-06-03 (Wed, 03 Jun 2020)

  Changed paths:
    M lld/ELF/Writer.cpp
    M lld/test/ELF/allow-shlib-undefined.s
    M lld/test/ELF/wrap-shlib-undefined.s

  Log Message:
  -----------
  [ELF] Append " [--no-allow-shlib-undefined]" to the corresponding diagnostics

--no-allow-shlib-undefined (enabled by default when linking an
executable) rejects unresolved references in shared objects.

Users may be confused by the common diagnostics of unresolved symbols in
object files (LLD: "undefined symbol: foo"; GNU ld/gold: "undefined reference to")

Learn from GCC/clang " [-Wfoo]": append the option name to the
diagnostics. Users can find relevant information by searching
"--no-allow-shlib-undefined".  It should also be obvious to them that
the positive form --allow-shlib-undefined can suppress the error.

Also downgrade the error to a warning if --noinhibit-exec is used (compatible
with GNU ld and gold).

Reviewed By: grimar, psmith

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




More information about the All-commits mailing list