• 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: loading executable code, NSBundle
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: loading executable code, NSBundle


  • Subject: Re: loading executable code, NSBundle
  • From: Douglas Davidson <email@hidden>
  • Date: Wed, 2 May 2001 14:40:02 -0700

On Wednesday, May 2, 2001, at 01:32 PM, Andreas Wolf wrote:

Thank you, Douglas!
I'd like to learn more about that, what would be a good reference for that?
Is it kernel specific, OS X specific or cocoa? Sounds like deep down in the kernel..
-Andreas


The behavior you see here is that of Mach-o binaries. There are many different types of Mach-o binaries, but the three you will see most often are stand-alone executables, dynamic shared libraries, and loadable bundles. These three all have different behaviors: stand-alone executables can be executed but not loaded; dynamic shared libraries can be loaded, but not unloaded or executed; bundles can be loaded and unloaded, but not executed. There are also a number of other subtler differences. Your application bundle had a Mach-o stand-alone executable as its binary, so it could not be loaded. When you changed it to a bundle, it was compiled to have a Mach-o loadable bundle as its binary, so it could then be loaded.

Douglas Davidson

This behavior is mostly determined by the dynamic link editor, dyld, which lives in userland but has an intimate relationship with the kernel. I don't know of any good references to point you to except the man pages (otool(1), lipo(1), dyld(1), dyld(3), etc.) and header files (in /usr/include/mach-o). Use the tools otool and lipo to find out about specific files; look at loader.h for the structure of Mach-o files, fat.h for the structure of fat files, dyld.h for the programmatic interface to dyld.

Douglas Davidson


References: 
 >Re: loading executable code, NSBundle (From: Andreas Wolf <email@hidden>)

  • Prev by Date: Re: D.O. won't pass NSBezierPath ???
  • Next by Date: Installing a Cocoa Applicatoin
  • Previous by thread: Re: loading executable code, NSBundle
  • Next by thread: Re: cocoa-dev digest, Vol 1 #2 - 10 msgs
  • Index(es):
    • Date
    • Thread