[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'
rguenth at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed May 16 09:24:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85801
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |hjl.tools at gmail dot com,
| |rguenth at gcc dot gnu.org
--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
I think this is valid from an ELF perspective. But ca you really expect
char *progname to resolve to the library copy? In fact the linker resolution
here is
1
t2.o 4
207 b42c927210240321 PREVAILING_DEF main
349 b42c927210240321 PREVAILING_DEF_IRONLY_EXP progname
351 b42c927210240321 RESOLVED_DYN stderr
347 b42c927210240321 UNDEF my_name
and thus it correctly(?) resolves to a non-exported local copy
(GNU ld 2.30 branch). Note that without --as-needed I get
1
t2.o 4
207 226c604d5f4407d9 PREVAILING_DEF main
349 226c604d5f4407d9 RESOLVED_DYN progname
351 226c604d5f4407d9 RESOLVED_DYN stderr
347 226c604d5f4407d9 RESOLVED_DYN my_name
so I think this points to a GNU ld bug (and gold behaves the same).
HJ? I think for the purpose of generating the resolution we have to
ignore --as-needed?
More information about the Gcc-bugs
mailing list