Re: dlopen and RTLD_LOCAL
Re: dlopen and RTLD_LOCAL
- Subject: Re: dlopen and RTLD_LOCAL
- From: Rainer Brockerhoff <email@hidden>
- Date: Thu, 16 Mar 2006 15:41:18 -0300
At 23:36 +0900 16/3/06, Peter O'Gorman wrote:
>On Thu, 2006-03-16 at 09:12 -0300, Rainer Brockerhoff wrote:
> > The problem with the new dl* APIs is they don't support loading libraries from memory,
>
>So, please tell me, under which situations is it required to use the
>APIs in mach-o/dyld.h? Do you really have to load the code from memory?
>I just quickly looked for an api to do this on other unix and found
>nothing (bad google search string?).
Well, it is somewhat esoteric. One of the reasons is, the standard routines force you to keep all your binaries available in a file which is easy to read, in a known format, and thus also easily modified. So if you want to encrypt your binaries, or generate them on-the-fly, you're forced to write them out in clear.
You can't even pass a pipe to dlopen()... allowing that would be a one-line modification.
Looking at the implementation (at least the one in the latest PPC Darwin), it seems that the new dl* calls are the ones so optimized that prebinding isn't necessary, and that's why they're recommended for normal use.
At 11:36 -0500 16/3/06, Sean McBride wrote:
>On 2006-03-16 09:12, Rainer Brockerhoff said:
>
>>I've looked at the docs and the headers; the "Mac OS X ABI Dynamic
>>Loader Reference" says dl* calls are "recommended" and use of NS* calls
>>is "discouraged"
>
>yet tn2071 says:
>"...APIs such as dlopen, dlgets, and dlclose these are not supported on
>Mac OS X..."
>
><http://developer.apple.com/technotes/tn2002/tn2071.html>
Well, this TN is from 2003, when they really weren't implemented yet.
--
Rainer Brockerhoff <email@hidden>
Belo Horizonte, Brazil
"In the affairs of others even fools are wise
In their own business even sages err."
Weblog: http://www.brockerhoff.net/bb/viewtopic.php
_______________________________________________
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