This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: PATCH: PR ld/15323: Unable to redefine weak function in -flto incrementally-linked executable
- From: Alan Modra <amodra at gmail dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: binutils at sourceware dot org
- Date: Sat, 30 Mar 2013 12:00:27 +1030
- Subject: Re: PATCH: PR ld/15323: Unable to redefine weak function in -flto incrementally-linked executable
- References: <20130330004050 dot GA19236 at intel dot com>
On Fri, Mar 29, 2013 at 05:40:50PM -0700, H.J. Lu wrote:
> PR ld/15323
> * ld-plugin/lto.exp (lto_link_tests): Add pr15323a-r.o.
> (lto_run_tests): Add a test for PR ld/15323.
>
> * ld-plugin/pr15323.out: New file.
> * ld-plugin/pr15323a.c: Likewise.
> * ld-plugin/pr15323b.c: Likewise.
I just had a quick look at this PR, and it seems to me that the real
problem has nothing to do with -r. Please simplify your testcase to
do without the misleading -r step.
$ gcc -g -O2 -c /src/cygnus/ld/testsuite/ld-plugin/pr15323a.c
$ gcc -flto -g -O2 -c /src/cygnus/ld/testsuite/ld-plugin/pr15323b.c
$ gcc -flto -g -O2 pr15323a.o pr15323b.o
`foobar' referenced in section `.text.startup' of pr15323a.o: defined in discarded section `.text' of pr15323b.o (symbol from plugin)
collect2: ld returned 1 exit status
--
Alan Modra
Australia Development Lab, IBM