search for: islegaltocallimmediateaddr

Displaying 14 results from an estimated 14 matches for "islegaltocallimmediateaddr".

2011 Jul 01
2
[LLVMdev] Typo in IsLegalToCallImmediateAddr?
It seems that the || should be && here? /// IsLegalToCallImmediateAddr - Return true if the subtarget allows calls /// to immediate address. bool X86Subtarget::IsLegalToCallImmediateAddr(const TargetMachine &TM) const { if (Is64Bit) return false; return isTargetELF() || TM.getRelocationModel() == Reloc::Static; } For example, if you are doing ELF PIC (i.e...
2011 Jul 02
0
[LLVMdev] Typo in IsLegalToCallImmediateAddr?
On 2011-07-01 17:13, David Meyer wrote: > It seems that the || should be && here? > > /// IsLegalToCallImmediateAddr - Return true if the subtarget allows calls > /// to immediate address. > bool X86Subtarget::IsLegalToCallImmediateAddr(const TargetMachine &TM) const { > if (Is64Bit) > return false; > return isTargetELF() || TM.getRelocationModel() == Reloc::Static; > } > > Fo...
2011 Oct 16
0
[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 thin...
2011 Oct 17
2
[LLVMdev] Typo in IsLegalToCallImmediateAddr?
Rafael, I believe your example is not related to IsLegalToCallImmediateAddr. This is an example of calling to an immediate address: typedef int (*funcptr)(void); int main() { funcptr foo = (funcptr)0x100; foo(); } If IsLegalToCallImmedateAddr is true, this generates a call to absolute address 0x100: call 0x100 This requires a relocation of the value 0x100 - PC. (...
2011 Oct 20
0
[LLVMdev] Typo in IsLegalToCallImmediateAddr?
2011/10/17 David Meyer <pdox at google.com>: > Rafael, > > I believe your example is not related to IsLegalToCallImmediateAddr. > > This is an example of calling to an immediate address: > > typedef int (*funcptr)(void); > > int main() { >  funcptr foo = (funcptr)0x100; >  foo(); > } > > If IsLegalToCallImmedateAddr is true, this generates a call to > absolute address 0x100: > > ca...
2011 Oct 21
2
[LLVMdev] Typo in IsLegalToCallImmediateAddr?
Rafael, Use this bitcode: define i32 @main() nounwind { entry: %call = tail call i32 inttoptr (i64 256 to i32 ()*)() nounwind ret i32 0 } And this command: $ llc -mtriple "i686-linux-gnu" test.ll -o test.s -filetype=asm -relocation-model=pic - pdox
2011 Oct 21
0
[LLVMdev] Typo in IsLegalToCallImmediateAddr?
> And this command: > > $ llc -mtriple "i686-linux-gnu" test.ll -o test.s -filetype=asm > -relocation-model=pic I can reproduce it now. Sorry, I was using a test returning void and we don't have tail call of immediate. My impression in that the right fix would be to just remove the "isTargetELF()". It would make the function correct for ELF and not less
2011 Oct 21
2
[LLVMdev] Typo in IsLegalToCallImmediateAddr?
Rafael, I believe MachO can't represent this relocation, even in non-PIC mode. On my Mac, I tried compiling "call 256". I got: in section __TEXT,__text reloc 0: R_ABS reloc but no absolute symbol at target address I believe the correct thing to do is: isTargetELF() && TM.getRelocationModel() == Reloc::Static This will do the right thing on ELF, and the right thing on
2011 Oct 21
0
[LLVMdev] Typo in IsLegalToCallImmediateAddr?
2011/10/21 David Meyer <pdox at google.com>> Rafael, > > I believe MachO can't represent this relocation, even in non-PIC mode. > On my Mac, I tried compiling "call 256". I got: I think PIC is just the default (the kernel being non-PIC for example), but I am not sure. > in section __TEXT,__text reloc 0: R_ABS reloc but no absolute symbol > at target address
2011 Oct 21
2
[LLVMdev] Typo in IsLegalToCallImmediateAddr?
> Could be, echristo, bigcheese, would this be correct for Mach-O and COFF? bigcheese noted on IRC that the test crashes the COFF emitter. For some reason I am always getting movl $256, %eax ## imm = 0x100 calll *%eax on darwin already, so I guess you are right, the correct would be isTargetELF() && TM.getRelocationModel() == Reloc::Static; Please include a test
2011 Oct 21
0
[LLVMdev] Typo in IsLegalToCallImmediateAddr?
IIRC the kernel uses relocation model as static. -eric On Oct 21, 2011, at 3:57 PM, David Meyer wrote: > Eli, > > Hm. There's a test in (CodeGen/X86/call-imm.ll) which uses darwin with > relocation model static. It expects to use call-to-immediate. > > Is this in error? Should I disable this check? > > - pdox > > On Fri, Oct 21, 2011 at 11:49 AM, Eli
2011 Oct 21
0
[LLVMdev] Typo in IsLegalToCallImmediateAddr?
2011/10/21 Rafael Ávila de Espíndola <rafael.espindola at gmail.com>: >> Could be, echristo, bigcheese, would this be correct for Mach-O and COFF? > > bigcheese noted on IRC that the test crashes the COFF emitter. For some > reason I am always getting > >        movl    $256, %eax              ## imm = 0x100 >        calll   *%eax > > on darwin already IIRC, we
2011 Oct 21
1
[LLVMdev] Typo in IsLegalToCallImmediateAddr?
Thought a bit more. There's also -mdynamic-no-pic. Not typically used these days, but is still there AFAIK. -Jim On Oct 21, 2011, at 4:05 PM, Eric Christopher wrote: > IIRC the kernel uses relocation model as static. > > -eric > > On Oct 21, 2011, at 3:57 PM, David Meyer wrote: > >> Eli, >> >> Hm. There's a test in (CodeGen/X86/call-imm.ll) which
2011 Oct 21
2
[LLVMdev] Typo in IsLegalToCallImmediateAddr?
Eli, Hm. There's a test in (CodeGen/X86/call-imm.ll) which uses darwin with relocation model static. It expects to use call-to-immediate. Is this in error? Should I disable this check? - pdox On Fri, Oct 21, 2011 at 11:49 AM, Eli Friedman <eli.friedman at gmail.com> wrote: > 2011/10/21 Rafael Ávila de Espíndola <rafael.espindola at gmail.com>: >>> Could be,