This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: arm-wince-pe-ld: Multiply defined symbols in libgcj
- From: Nick Clifton <nickc at redhat dot com>
- To: "Craig A. Vanderborgh" <craigv at voxware dot com>
- Cc: binutils at sources dot redhat dot com
- Date: Tue, 03 Jun 2003 15:45:28 +0100
- Subject: Re: arm-wince-pe-ld: Multiply defined symbols in libgcj
- References: <1054574568.16498.68.camel@zetar>
Hi Craig,
> By itself this should not be a problem because the assembler code
> contains the directive
>
> .linkonce discard
>
> Which is exactly what you'd want - The first instance of the function
> body is supposed to be linked, the other instances "silently discarded",
> according to the documentation.
>
> The trouble is it doesn't work: On arm-wince-pe, for the following gcj
> compile of HelloWorld.java, I see the following:
>
> /usr/local/wince/lib/gcc-lib/arm-wince-pe/3.3/../../../../arm-wince-pe/lib/libgcj.a(String.o)(.text+0x4fc):
> multiple definition of `java::lang::String::length()
> My conclusion: the ".linkonce discard" directive is not being honored by
> arm-wince-pe-ld. What should we do about this?
Find out why - it should work.
The problem appears to be that the symbols are being defined in the
.text section. If they were defined in a .gnu.linkonce.<section-name>
section then the discarding should work. (See
bfd/coffcode.h:styp_to_sec_flags). I guess that the .linkonce
directive in gas is not doing the right thing. Well at least not for
the arm-wince-pe port.
Cheers
Nick