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