Re: Static initialisers in static libraries
Re: Static initialisers in static libraries
- Subject: Re: Static initialisers in static libraries
- From: "Peter O'Gorman" <email@hidden>
- Date: Tue, 30 Aug 2005 07:40:13 +0900
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Dair Grant wrote:
| We'd rather not use -all_load, so is there any other flag we can use to
| persuade the linker to treat static initialisers consistently no matter
| how they're introduced into the link?
|
I don't think ld is smart enough to load foo.o from libfoo.a if it has a
static initializer but no other references to it. I suggest that instead of
creating a static library, you either create a reloadable object which
contains all the objects you have with initializers. E.g."gcc -r -o
foostuff.o foo.o bar.o", and then use the reloadable object in place of you
static archives, or just use the object files directly and don't create an
archive.
Peter
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (Darwin)
iQCVAwUBQxOOzLiDAg3OZTLPAQLlYwQAuXhf1N1DkGXrsIS2bqHrLYCvmhNh7cHW
zU7DQPgIf4TLahmPx2wszEoDFXWw+rVzwgs6G1wnCXkj04xrRePeiNsxcPiWm4Vs
XkQSKnTQC5AfRi1HH1rSOyxkXkHCHjFxrVT1JZDuEfWCYduUyfT36KKKhBvfWMtL
GChRH7BL6cg=
=enq+
-----END PGP SIGNATURE-----
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden