[all-commits] [llvm/llvm-project] 1d95a0: [LLD] [COFF] Handle undefined weak symbols in LTO ...
Martin Storsjö via All-commits
all-commits at lists.llvm.org
Sun Nov 5 14:00:37 PST 2023
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 1d95a071d6fc43fb413a0d3f5a9d1e52a18abab0
https://github.com/llvm/llvm-project/commit/1d95a071d6fc43fb413a0d3f5a9d1e52a18abab0
Author: Martin Storsjö <martin at martin.st>
Date: 2023-11-06 (Mon, 06 Nov 2023)
Changed paths:
M lld/COFF/InputFiles.cpp
A lld/test/COFF/lto-weak-undefined.ll
Log Message:
-----------
[LLD] [COFF] Handle undefined weak symbols in LTO (#70430)
When reading the bitcode input, undefined weak symbols will show up as
undefined symbols - which fails the early pass of checking for missing
symbols in symtab.reportUnresolvable(), before doing the actual LTO
compilation.
Mark such symbols as deferUndefined (added in
3785a413feef896e8a022731cc6ed405d5ebe81b /
https://reviews.llvm.org/D89004 for the -wrap option), to let them pass
through this LTO precheck. After the LTO compilation, the weak undefined
symbols will point towards an absolute null symbol as default.
Such weak undefined symbols are used for the TLS init function in the
Itanium C++ ABI, for TLS variables that potentially need to run a
constructor, when accessed across translation units.
This fixes https://github.com/llvm/llvm-project/issues/64513.
More information about the All-commits
mailing list