• 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: Linker refuses to link my dylib? Why?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Linker refuses to link my dylib? Why?


  • Subject: Re: Linker refuses to link my dylib? Why?
  • From: Eric Albert <email@hidden>
  • Date: Thu, 15 Feb 2007 11:57:38 -0800

On Feb 15, 2007, at 11:52 AM, Jonas Maebe wrote:

On 15 feb 2007, at 20:12, Eric Albert wrote:

Mac OS X requires libraries to be relocatable, so you can't build them with -mdynamic-no-pic. The errors Theodore posted about are exactly what you'll see when you build a library with -mdynamic-no- pic. Non-PIC code in a library would be very slightly faster, but PIC code has the advantage of actually working....

Just a small remark: it is possible to create working non-pic dynamic libraries for ppc32 and i386 on at least Mac OS X 10.4.x (maybe not with gcc though, but I can create them using our own compiler). It is impossible for ppc64 though. I don't know about x86_64.

It definitely isn't supported. You can construct the code, but dyld assumes that all libraries are relocatable, so if the library has to be slid due to other things inserted into the process' address space it'll go ahead and slide the library. If the library is non-PIC, it'll run incorrectly when it's slid.


In other words, I'd strongly suggest that you not ship libraries built non-PIC.

-Eric

_______________________________________________
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: Linker refuses to link my dylib? Why?
      • From: Ladd Van Tol <email@hidden>
    • Re: Linker refuses to link my dylib? Why?
      • From: Jonas Maebe <email@hidden>
References: 
 >Re: Linker refuses to link my dylib? Why? (From: Greg Guerin <email@hidden>)
 >Re: Linker refuses to link my dylib? Why? (From: Eric Albert <email@hidden>)
 >Re: Linker refuses to link my dylib? Why? (From: Jonas Maebe <email@hidden>)

  • Prev by Date: Re: Linker refuses to link my dylib? Why?
  • Next by Date: Re: Linker refuses to link my dylib? Why?
  • Previous by thread: Re: Linker refuses to link my dylib? Why?
  • Next by thread: Re: Linker refuses to link my dylib? Why?
  • Index(es):
    • Date
    • Thread