• 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
Link Errors -- Relocation Overflow
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Link Errors -- Relocation Overflow


  • Subject: Link Errors -- Relocation Overflow
  • From: Bob Clark <email@hidden>
  • Date: Sat, 25 Jun 2005 13:49:13 -0700

As Ned Flanders would say, I've got a dilly of a pickle.

The code base I'm trying to build first builds many (over a hundred) static libraries, then links 'em into an app.

That link is erroring out with a bunch of errors (over a hundred) like this:

ld: /foo.a(bar.o) relocation overflow for relocation entry 704 in section (__TEXT,__text) (displacement too large)

I've googled and searched through Apple's list archives and I'm about ready to throw in the towel and blow a DTS incident, but if anyone reading this knows:

(a) exactly what this means
(b) how to diagnose it more specifically than a hundred basically-identical link errors
(c) how to avoid the error


I'd love to hear your suggestions.


I'm on Panther (10.3.9) with XCode 1.5.

For what it's worth: the vast majority of this code is cross-platform (compiles, links, and runs on Windows and Linux at least) and the Mac-specific code works well for other products in which it's used.


Things I've tried:

As suggested in <http://lists.apple.com/archives/darwin-development/2001/Aug/ msg00213.html>, I've tried compiling all the sources with "-mlong_branch". This didn't work.

As suggested in <http://lists.apple.com/archives/darwin-development/2001/Aug/ msg00244.html>, I've tried (dubiously) to create stub functions for _carbon_init() and _objcInit(). This didn't work.

As suggested in <http://lists.apple.com/archives/unix-porting/2002/Apr/msg00149.html>, I've tried tweaking the stacksize ("limit stacksize"), even though this looks like a Jaguar problem and I'm on Panther. I couldn't get the environment variable for stacksize set above where Panther defaults it, and it didn't seem to have an effect.

As suggested in <http://lists.apple.com/archives/darwin-development/2003/Dec/ msg00147.html>, I've tried building with "-mdynamic-no-pic". This didn't work.

<http://lists.apple.com/archives/darwin-development/2001/May/ msg00620.html> suggests that data sizes bigger than 32MB won't work; hmmm. None of the individual libraries are larger than 32MB, but cumulatively they probably are. But if that's related, then why is the link failing for (as far as I can tell) all static libraries being linked? I don't think (although I could be wrong) that this is the issue.

<http://lists.apple.com/archives/darwinos-users/2001/Oct/msg00209.html> suggests that a huge static array may be the problem. I haven't found a huge static array in this code, although it's possible one exists. No other compilers (including the gcc toolchain used for Linux builds) complains.

Have I missed an obvious link flag or compile flag that will prevent this problem from occurring? (This is what I'm hoping for: a "magic incantation" that will effortlessly solve all my problems.)

Or does anyone have any suggestions for another angle for me to investigate this?

Thanks a lot in advance.
--Bob

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Link Errors -- Relocation Overflow
      • From: email@hidden (Peter Seebach)
  • Prev by Date: Re: geteuid() while debugging
  • Next by Date: Re: Link Errors -- Relocation Overflow
  • Previous by thread: Re: Hooks for notification of move/rename/delete file?
  • Next by thread: Re: Link Errors -- Relocation Overflow
  • Index(es):
    • Date
    • Thread