x86_64 and large call offsets

Hi all,

I use a plain LLVM 2.6 to jit code for x86_64. My setup falls into the following problem:

The generated code calls some external function whose address is set via addGlobalMapping(), but is more than 2GB away from the generated call.
However, a call imm instruction using a 32bit offset is generated, which due to wrap around calls the wrong address.
After digging for some time in the LLVM source I could not find code that handle this case.

Is there something wrong in my setup? Should I use pre2.7 for this use case?

Thanks in advance,

Yeah, I fixed this on x86 for llvm-2.7. It's broken in 2.6. (And it's
still broken on 2.7 for arm and ppc.)