David Meyer
2011-Oct-16 07:44 UTC
[LLVMdev] Problem with X86Subtarget::IsLegalToCallImmediateAddr()
The current rule is: /// IsLegalToCallImmediateAddr - Return true if the subtarget allows calls /// to immediate address. bool X86Subtarget::IsLegalToCallImmediateAddr(const TargetMachine &TM) const { if (In64BitMode) return false; return isTargetELF() || TM.getRelocationModel() == Reloc::Static; } But this is not doing the correct thing for ELF PIC. The straight-forward way to fix this is to change the || to &&. However, this would make the function always return false for other object file formats. I was under the impression only ELF had the ability to emit this type of relocation anyway. Am I mistaken? Thanks, David