• 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: Jonas Maebe <email@hidden>
  • Date: Fri, 16 Feb 2007 10:13:28 +0100


On 16 Feb 2007, at 00:03, Ladd Van Tol wrote:

It is actually possible to preserve relocation entries in a dylib, and have dyld rewrite them at runtime, allowing non-PIC code to slide. You do have to pass "-read_only_relocs supress" to ld.

That's what we do currently but from Eric's answer, I gathered this would only hide some warnings about things which could break anyway in some circumstances.


Another, related thing are common symbols. The linker barfs if you have one or more .comm sections in your assembler file and try to put the resulting object in a dynamic library, but it works fine if you do this:

.globl U_TA_A
.data
.zerofill __DATA, __common, U_TA_A, 184,3

I'm not sure what the difference is, since the documentation for .comm says:

"The link editor allocates storage for common symbols that aren’t otherwise defined. Enough space is left after the symbol to hold the maximum size (in bytes) seen for each symbol in the (__DATA,__common) section."

The error you get if you use .comm instead is:

Linking libtlibrary1.dylib
ld: for architecture ppc
ld: common symbols not allowed with MH_DYLIB output format with the - multi_module option
tlibrary1.o definition of common U_TA_A (size 4)


According to nm, the .comm symbols are put in the common symbol section, while the alternative ends up in a "symbol in a section other than those above".

Is this missing error checking in the linker, or is the above something which should work fine? (I haven't noticed any problems, but that's obviously not a guarantee)


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

  • Prev by Date: Re: Error message mentions nonexistent header
  • Next by Date: Re: XCode Compile Problem - HELP!!!
  • 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