This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: arm-wince-pe-ld: Multiply defined symbols in libgcj


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




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]