Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Linker error



Turns out the Darwin linker does not like the jrcxz instruction for some reason.  Perhaps because it uses a 2 byte (length == 1) displacement?  The error message seemed to indicate only 4 byte displacements (length == 2) were valid.  

 

Replacing jrcxz with:

 

cmp $0, %rcx

je .LocalLabel

 

…fixes the problem.

 

It would seem the Darwin assembler and linker are not in sync.

 

Norm Green

 

 


From: Norm Green
Sent: Thursday, December 20, 2007 6:20 PM
To: 'email@hidden'
Subject: Linker error

 

I’m getting this error from the linker on Leopard:

 

ld: in intloop_darwin_x86_64.o, in section __TEXT,__text reloc 278: length != 2 and X86_64_RELOC_BRANCH not supported

 

Can someone please explain what I’m doing wrong?  This is being compiled/assembled/linked in 64 bit mode.

 

The file intloop_darwin_x86_64.o is generated by the assembler ‘as’.  Versions are below:

 

email@hidden:246 % as -v

Apple Computer, Inc. version cctools-667.3~21, GNU assembler version 1.38

 

email@hidden:250 % ld -v

@(#)PROGRAM:ld  PROJECT:ld64-77

 

 

 

Thanks,

 

Norm Green

 

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/darwin-dev/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.