This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC 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: calling from one libfoo.a to another


My coworker said he tried an example similar to mine on gcc 3.x and
the weak reference remains uninitialized, if it is defined in another
library.  On the other hand, if it is defined in the main compilation
unit (.o), the weak reference is resolved properly.

Our example couldn't be fixed by using ordinary externs and ordering
the libraries properly when linking because we have inadvertently
introduced a circular dependency; we are modifying libc to call
another library, which itself uses a bunch of libc functions.  Yeah,
yuck.

Our best guess at this point is that the weak attribute was not fully
polished in gcc 3.x, but works on 4.x.  It appears that we've found
a work-around involving a function pointer we initialize at run-time.
-- 
A Weapon of Mass Construction
My emails do not have attachments; it's a digital signature that your mail
program doesn't understand. | http://www.subspacefield.org/~travis/ 
If you are a spammer, please email john@subspacefield.org to get blacklisted.

Attachment: pgp00000.pgp
Description: PGP signature


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