search for: istargetelf

Displaying 20 results from an estimated 23 matches for "istargetelf".

2017 Oct 04
2
Relocations used for PPC32 in non-PIC mode
...nkers not implementing PLT-relative relocations. While it might be good for LLD to support R_PPC_PLTREL24, in my opinion there still is no reason for LLVM to emit this in non-PIC mode. If my understanding is correct, I can submit a patch that will replace bool UsePlt = !Local && Subtarget.isTargetELF() && !isPPC64; with bool UsePlt = !Local && Subtarget.isTargetELF() && !isPPC64 && DAG.getTarget().getRelocationModel() == Reloc::PIC_; Vit -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: appli...
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 other formats. This may have been the original intent. - pdox
2017 Oct 04
2
Relocations used for PPC32 in non-PIC mode
...relocations. >> >> While it might be good for LLD to support R_PPC_PLTREL24, in my opinion there still is no reason for LLVM to emit this in non-PIC mode. If my understanding is correct, I can submit a patch that will replace >> >> bool UsePlt = !Local && Subtarget.isTargetELF() && !isPPC64; >> >> with >> >> bool UsePlt = !Local && Subtarget.isTargetELF() && !isPPC64 && >> DAG.getTarget().getRelocationModel() == Reloc::PIC_; >> >> Vit >> >> >> >> ________...
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. for a shared library), it is not valid to use a call immediate. - David
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: > > $ 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 correct for other formats, since it is already broken for a format with no calls to immediate. > - pdox Cheers, Rafael
2011 Oct 21
0
[LLVMdev] Typo in IsLegalToCallImmediateAddr?
...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 > > 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 other > formats. This may have been the original intent. Could be, echristo, bigcheese, would this be correct for Mach-O and COFF? > - pdox > Cheers, Rafael
2008 Jun 06
2
[LLVMdev] [patch] add support for PIC on linux x86-64
On Fri, 2008-06-06 at 17:08 +0100, Rafael Espindola wrote: > 2008/6/6 Anton Korobeynikov <asl at math.spbu.ru>: > > Hello, Rafael > > > > Awesome! But... -ENOPATCH :( > > Attached now. Hi Rafael, Thanks a lot for working on this! I have one question about the patch; why did you choose too add a new enum, PICCallStyle, instead of reusing (possibly with some
2008 Jun 06
0
[LLVMdev] [patch] add support for PIC on linux x86-64
...his! > > I have one question about the patch; why did you choose too add a new > enum, PICCallStyle, instead of reusing (possibly with some > adjustments) > the existing PICStyle enum? Yes, please remove PICCallStyle and have printPLT check for pic relocation model and Subtarget.isTargetELF(). And where you are modifying this part of the code. Please rename printGOT, printStub, and printPLT to something that indicates they are predicate functions. Perhaps shouldPrintGOT, etc.? Thanks, Evan > > > Thanks, > > Dan > > > ____________________________________...
2016 Aug 05
2
XRay: Demo on x86_64/Linux almost done; some questions.
...4_t Address; uint64_t Function; unsigned char Kind; unsigned char AlwaysInstrument; unsigned char Padding[14]; // Need 32 bytes }; And the peer code in llvm/trunk/lib/Target/X86/X86MCInstLower.cpp : void X86AsmPrinter::EmitXRayTable() { if (Sleds.empty()) return; if (Subtarget->isTargetELF()) { auto *Section = OutContext.getELFSection( "xray_instr_map", ELF::SHT_PROGBITS, ELF::SHF_ALLOC | ELF::SHF_GROUP | ELF::SHF_MERGE, 0, CurrentFnSym->getName()); auto PrevSection = OutStreamer->getCurrentSectionOnly(); OutStreamer->SwitchSecti...
2009 Aug 25
0
[LLVMdev] RFC: Supporting ELF symbol aliases via GlobalAlias GEPs
I've attached a less-hackish implementation of this. This includes the following modifications: - getSupportsOverlappingAliases() method on TargetMachine which returns whether the target supports multiple symbols to the same object. This returns false in the superclass and needs to be explicitly overridden for each target to enable it. - An implementation of this method in
2009 Aug 23
3
[LLVMdev] RFC: Supporting ELF symbol aliases via GlobalAlias GEPs
Hi Everyone, Chris suggested[1] I should ask for feedback as to whether this is a desired feature before I put too much effort into it, so here goes: I would like to be able to export a symbol that is inside an LLVM structure. This is possible on ELF targets[2], and the attached proof- of-concept patch to AsmWriter makes it work (although in a hackish way that I am NOT suggesting be
2011 May 31
0
[LLVMdev] X86Subtarget.h could be beautified
Hi! when reading X86Subtarget.h the methods seem a bit disordered, therefore I would propose to sort them new: -getTargetTriple() -cpu features (e.g. hasSSE1()) -os types (e.g. isTargetDarwin()) -object types (e.g. isTargetELF()) -callconv related functions (e.g. isTargetWin64(), consider renaming to isCallConvWin64(), getStackAlignment()) -pic functions perhaps my problem of generating elf objects on windows can be easily solved by creating a new os type, just like mingw and cycwin, and patching X86Subtarget.h ac...
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 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 EL...
2011 Jul 02
0
[LLVMdev] Typo in IsLegalToCallImmediateAddr?
...hat 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. for a shared library), it > is not valid to use a call immediate. I think that on 32 bits it is legal, just not profitable. I tried compiling two .c files without -fPIC: --------------...
2011 Oct 21
2
[LLVMdev] Typo in IsLegalToCallImmediateAddr?
...d 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 with the commit :-) Cheers, Rafael
2008 May 30
1
[LLVMdev] implementing PIC for linux x86-64
I have been playing a bit with LLVM again and it looks like the current major missing feature on Linux x86-64 is PIC. Is anyone working on it? If not, I would like to do so. I have the ABI documentation (http://www.x86-64.org/documentation/abi.pdf), but would be glad if someone had some LLVM specific pointers. For example, from the targets that do have support for PIC, which one is the one to be
2008 Jun 07
1
[LLVMdev] [patch] add support for PIC on linux x86-64
> Yes, please remove PICCallStyle and have printPLT check for pic > relocation model and Subtarget.isTargetELF(). Done. > And where you are modifying this part of the code. Please rename > printGOT, printStub, and printPLT to something that indicates they are > predicate functions. Perhaps shouldPrintGOT, etc.? Done. Updated patch attached. > Thanks, > > Evan Cheers, -- Rafael Avila...
2008 Aug 03
0
[LLVMdev] Sparc assembly syntax
Hello, > As others mentioned, Anton is working on a significant cleanup to help > unify the asm printers. If you need to do this in the short term, I'd > add an "isTargetELF()" method to the SparcSubtarget class, and have it > autodetect it from the target triple as the x86 backend does. With > that, you can predicate the output based on whether the target is elf > or not. Please wait for few days, I'll switch SPARC to new section stuff soon af...
2008 Aug 01
2
[LLVMdev] Sparc assembly syntax
OK, so the next thing I found in Sparc world is that sparc-elf-as doesn't understand .bss as a directive for some reason. I modified the Sparc code generator to output .section ".bss" and that works just fine. My (temporary) solution is a hack, however: ================================================================== --- SparcAsmPrinter.cpp (revision 720) +++