[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 gcc-bugzilla@gcc.gnu.org
Wed May 16 15:08:00 GMT 2018


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85801

--- Comment #5 from Richard Earnshaw <rearnsha at gcc dot gnu.org> ---
> ld: relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol `progname' which may bind externally can not be used when making a shared object; recompile with -fPIC

So this is the start of the problem.  Changing the behaviour to remove this
would involve disabling section anchors for all code (rather than just PIC): we
wouldn't know when a symbol might be pre-empted during linking.

I don't think we want to fix this, even if we could...  there would be a large
performance penalty for lazy build systems.

That this works on X86 is not enough, IMO.  x86 doesn't use section anchors.


More information about the Gcc-bugs mailing list