• 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 09:12:23 -0300

At 23:43 -0800 15/3/06, email@hidden wrote:
>From: j o a r <email@hidden>
>References: <email@hidden>
>	<email@hidden>
>	<email@hidden>
>In-Reply-To: <email@hidden>
>Date: Wed, 15 Mar 2006 21:12:46 +0100
>Message-ID: <email@hidden>
>
>On 15 mar 2006, at 20.10, Lyndsey D. Ferguson wrote:
>
>>Do you think I could accomplish the same thing if I call:
>>
>>dlopen = CFBundleCreate
>>		 CFBundleLoadExecutable
>>
>>dlsym = CFBundleGetFunctionPointerForName
>>
>>dlclose = CFBundleUnloadExecutable
>>
>>Using the same file path to my dynamic libraries? Or does each dynamic library need to live within a *.bundle directory?
>
>I'm going to outline the implementation we used before we migrated to using the functions from dlfcn.h. I don't want to promote this solution, as it's using deprecated API, and seems very unsupported (read fragile). I hope that someone else will help you with a better solution. You've been warned!   :-)
>
>We used "bundle style dynamic libraries" (with the MACH_O_TYPE set to mh_bundle) and the NS* functions documented at the link below. You don't need a bundle directory.
>
><http://developer.apple.com/documentation/DeveloperTools/Reference/MachOReference/index.html>

The problem with the new dl* APIs is they don't support loading libraries from memory, which sometimes is necessary.

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", as the others are now more efficient. However, interpreting this as meaning "deprecated" and "fragile" is a bit of a stretch IMHO...

Yes, I agree that for normal purposes the new dl* functions are the way to go, but they don't cover all necessities. A function like dlload(void* image, size_t size, int mode) would come in handy. I'll file an enhancement request anyway.

--
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

  • Follow-Ups:
    • Re: dlopen and RTLD_LOCAL
      • From: "Sean McBride" <email@hidden>
    • Re: dlopen and RTLD_LOCAL
      • From: "Peter O'Gorman" <email@hidden>
  • Prev by Date: Re: Programmatically changing "Open using Rosetta" flag
  • Next by Date: Re: Xcode 2.2.1: Debugger shows truncated stack display
  • Previous by thread: Re: dlopen and RTLD_LOCAL
  • Next by thread: Re: dlopen and RTLD_LOCAL
  • Index(es):
    • Date
    • Thread