This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: unnecessary multiple definition error on link using 3.03
- From: Daniel Jacobowitz <drow at mvista dot com>
- To: Ken Faiczak <kfaiczak at SANDVINE dot com>
- Cc: "'binutils at sources dot redhat dot com'" <binutils at sources dot redhat dot com>
- Date: Mon, 18 Feb 2002 13:06:55 -0500
- Subject: Re: unnecessary multiple definition error on link using 3.03
- References: <FE045D4D9F7AED4CBFF1B3B813C853370361C1@mail.sandvine.com>
GCC 3.0.3 is more likely to emit calls to builtin memory functions;
perhaps memcpy is in that first module?
Try the -Map option to ld (-Wl,-Map from GCC). That will tell you why
each given module is being pulled in.
On Mon, Feb 18, 2002 at 11:56:33AM -0500, Ken Faiczak wrote:
> I am getting the following errors on link
> (gcc 3.03, ld 2.11.2)
>
> The same thing worked fine on 2.95....
>
> *****
> libeverything.a(mem.o): In function `malloc':
> mem.o(.text+0xb70): multiple definition of `malloc'
> libmem.a(misc.o)(.text+0x208): first defined here
>
> libeverything.a(mem.o): In function `free':
> mem.o(.text+0xba0): multiple definition of `free'
> libmem.a(misc.o)(.text+0x428): first defined here
> *****
>
> I have a debug library libmem.a
> which contains malloc(), free() etc...
> in several .o files
>
> it is also in the main library libeverything.a
> in a single .o file (mem.o)
>
> When I want to use the debug version I used to
> (2.95) just added my libmem.a before libeverything.a
> and it would ignore the multiple definitions since everything
> was satisfied by the earlier .a file, and there were no unresolved
> symbols requiring anything from mem.o
>
> Q: Is this a bug in the latest binutils?
> Q: How do I get rid of this new behaviour
> without pulling mem.o out of libeverything.a?
>
>
> ken
> kfaiczak@sandvine.com
>
--
Daniel Jacobowitz Carnegie Mellon University
MontaVista Software Debian GNU/Linux Developer