Link Error -- Relocation Overflow [SOLVED]
site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com My original message is at: http://lists.apple.com/archives/Darwin-dev/2005/Jun/msg00120.html and my followup is at: http://lists.apple.com/archives/Darwin-dev/2005/Jul/msg00044.html How to avoid the problem: using -mlong-branch can help. 1: ... bne 1 And the fix (!) was to change it to look like this: 1: ... bne 1b --Bob _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... I ended up blowing a DTS incident and George Warner provided the help that led to a solution. For the benefit of Googlers Of The Future, I'm providing a synopsis of what DTS suggested, and a description of what turned out to solve my problem. What the error message means: the PowerPC unconditional branch is 24 bits and the conditional branches are 14 bits. How to diagnose more fully: extract the .o from the .a file using the ar command, then run otool -rv on the .o file. Also run nm -n on the .o file to match up the symbols. In my case I had a conditional branch that was trying to branch over more than 14 bits, and this branch was in raw assembly code. (If it was in C code, then the -mlong-branch flag would probably have helped, but since it was in raw assembly the bne wasn't translated to avoid the 14-bit branch.) Specifically, I had an inline assembly function that included code like this: Adding the "b" is a compiler hint to branch backwards. Without the "b", it seems that it was trying to branch to a different invocation of this (inline) function, which was a long long ways away. With the "b" it branches backwards to the correct label. Anyway, dunno if this is of interest to anyone, but if there's even a chance that this will help ease the next guy's frustration it'll be worth it. This email sent to site_archiver@lists.apple.com
participants (1)
-
Bob Clark