Richard Biener <rguenth at gcc dot> changed:

           What    |Removed                     |Added
                 CC|                            | at gmail dot com,
                   |                            |rguenth at gcc dot

--- Comment #1 from Richard Biener <rguenth at gcc dot> ---
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

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

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?

Reply via email to