Re: __attribute__((constructor)) in dylib does not run with DYLD_INSERT_LIBRARIES
Re: __attribute__((constructor)) in dylib does not run with DYLD_INSERT_LIBRARIES
- Subject: Re: __attribute__((constructor)) in dylib does not run with DYLD_INSERT_LIBRARIES
- From: "Peter O'Gorman" <email@hidden>
- Date: Wed, 02 Mar 2005 08:24:36 +0900
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Andreas Tobler wrote:
|
| So if you build libhello with -bundle instead of -dynamiclib it works
| somehow. But this is a no go for me.
Why?
|
| I'm not aware of any workaround for panther.
Since you are dlopening the library, and panther uses dlcompat, and dlcompat
looks for a symbol named "_init", you can use a hack. Inserting a "void
_init() { ; }" into the .c file which has your static constructors should
cause them to be called. They must appear in the same translation unit as
the static constructor, or you must link your library using the
- -single_module flag if you want dyld to call them.
If I were you I'd check for different dlopen and dyld behavior on tiger...
There is no workaround for getting libraries inserted with
DYLD_INSERT_LIBRARIES to have their static constructors called on panther
that I know of. Nor is there any standard that I am aware of which requires
this functionality.
Peter
- --
Peter O'Gorman - http://www.pogma.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (Darwin)
iQCVAwUBQiT5s7iDAg3OZTLPAQIPogP/b0oAFLodhHCTH3aQHq7o++Za/b61kTm/
TpL8y9mSmtlqdxLKFdLklncZ8foGd+QE0sGDCGs6oJCwRQiYRga6lSFwnAqoe2aE
crLnwwKCKfUHlqfF4XZMdut7qu3BgrgBAVklKMCH5HzVx/NWwQmIMEp5x+MWalZK
hI4gzVszV3s=
=b4cx
-----END PGP SIGNATURE-----
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden