[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 3785a413 / 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.
parent
f4bc1891
Please register or sign in to comment