[PATCH] D38239: [ELF] - Define linkerscript symbols early.

Rafael Avila de Espindola via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 26 14:34:01 PST 2017


George Rimar <grimar at accesssoftek.com> writes:

> Why symbols do not need CanInline anymore ? Is it because of Prevailing flag ?
> So does it mean that LTO will never try to inline symbols known to be
> defined in .o ?

It will drop them completely.

> (I would expect that it should not be problem to inline absolute symbols probably,
> and in that case it would fail as values would be not final. Do not know details of how
> LTO works..).
>
> I noticed you're using Out::ElfHeader as section for Defined symbols and supposed that was
> done to make them be non-absolute for some reason, but passing nullptr does not break anything it seems.
> (defsym.ll still failing with "duplicate symbol: bar2")

Yes, I think we replace the symbols before anything actually check if
they are absolute, so using nullptr is probably fine.

> Though currently with Out::ElfHeader following cast asserts for me, because Out::ElfHeader is an input section,
> not output: https://github.com/llvm-mirror/lld/blob/master/ELF/SymbolTable.cpp#L441
> Is section needed there for something unobvious ?

That is the thin lto case, no? That is where I think there is something
odd with thin lto. It is producing a symbol we didn't ask for. Since the
symbol is already defined, we end up trying to report a duplicated
symbol error and crashing.

If thin lto would omit that symbol like regular LTO does we would not
get any errors.

Cheers,
Rafael


More information about the llvm-commits mailing list