[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Multiple definition of gnulib symbols
From: |
Bruno Haible |
Subject: |
Re: Multiple definition of gnulib symbols |
Date: |
Thu, 26 Apr 2007 11:52:00 +0200 |
User-agent: |
KMail/1.5.4 |
Simon Josefsson wrote:
> But yes, gc-libgcrypt and gc-gnulib are intended to be two mutually
> exclusive modules, since they provide the same symbols
... except for gc_hash_hmac_setkey.
> I had no idea that defining multiple symbols in a single object
> file could lead to trouble. Sigh.
That alone is not a problem. But if you have two object files with
_different_ but _overlapping_ set of symbols, you are in trouble.
Say, first.o defines 'aaa', and second.o defines 'aaa' and 'bbb'.
Then, when you link these:
cc (an object or library needing aaa) \
(a library containing first.o) \
(an object or library needing bbb) \
(a library containing second.o)
you will get an error, because the linker will
- see that it needs aaa, thus include first.o in the link,
- see that it needs bbb, thus include second.o in the link,
- and therefore give an error.
The linker does *not* remove first.o from the link when it decides to include
second.o.
Bruno
Re: Multiple definition of gnulib symbols, Simon Josefsson, 2007/04/26