[Bug lto/85801] LTO linking fails to reconcile symbol from common an data sections (-fPIE -Wl,--as-needed -flto): unresolvable R_ARM_REL32 relocation against symbol `progname'
rearnsha at gcc dot gnu.org
Wed May 16 16:27:00 GMT 2018
--- Comment #7 from Richard Earnshaw <rearnsha at gcc dot gnu.org> ---
(In reply to email@example.com from comment #6)
> Can't we decide that per symbol? Or somehow force the dynamic linker to use
> the program symbol?
At what point? We've no idea during compilation which code would go in a
shared library if its not built with -fPIC, and we've no idea which symbols
might then need to be ripped out of an anchor group. Once in an anchor group
it isn't possible to undo that during linking (since the reference is to the
entire group and individual symbols are no longer referenced).
So this is a decision the compiler makes which the linker can never undo.
More information about the Gcc-bugs