Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: DYLD_INSERT_LIBRARIES doesn't work with Leopard?




On Nov 11, 2007, at 1:02 PM, Błażej Biesiada wrote:

I'm trying to interpose system's open() function with my own using the dyld, I had no problem with that on Tiger, but the same code on Leopard doesn't work any longer. I compile my library this way:
gcc -arch ppc -dynamiclib -fno-common -o open_interposer.dylib open_interposer.c
and then I run my app this way:
DYLD_INSERT_LIBRARIES=open_interposer.dylib DYLD_FORCE_FLAT_NAMESPACE=1 ./my_app


and the application is still using system's open() function instead of mine :(. DYLD_PRINT_LIBRARIES=1 shows that pen_interposer.dylib is loaded before other libs.

This approach works for me on Leopard (it's how DarwinBuild tracks dependency information).


Does anything changed about dyld in Leopard? :|

I'm not sure whether it's a Leopard change or not, but I believe that DYLD_INSERT_LIBRARIES is ignored if the target binary is setuid. I also notice you're only compiling with -arch ppc; is it possible the target binary is compiled for a different architecture (i.e. ppc64?).


- Kevin _______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/darwin-dev/email@hidden

This email sent to email@hidden
References: 
 >DYLD_INSERT_LIBRARIES doesn't work with Leopard? (From: Błażej Biesiada <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.