• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: dlopen and RTLD_LOCAL
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Re: dlopen and RTLD_LOCAL (From: Rainer Brockerhoff <email@hidden>)
 >Re: dlopen and RTLD_LOCAL (From: "Peter O'Gorman" <email@hidden>)

  • Prev by Date: Why won't Xcode find my framework?
  • Next by Date: Re: One byte bool
  • Previous by thread: Re: dlopen and RTLD_LOCAL
  • Next by thread: Re: dlopen and RTLD_LOCAL
  • Index(es):
    • Date
    • Thread