summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/ELFWriter.cpp
Commit message (Collapse)AuthorAgeFilesLines
* rename TAI -> MAI, being careful not to make MAILJMP instructions :)Chris Lattner2009-08-221-2/+2
| | | | llvm-svn: 79777
* Rename TargetAsmInfo (and its subclasses) to MCAsmInfo.Chris Lattner2009-08-221-2/+2
| | | | llvm-svn: 79763
* Convert DOUT to DEBUG(errs()...).Bill Wendling2009-08-221-6/+5
| | | | llvm-svn: 79749
* *try* to use a better name to describe how common symbols are marked on the ↵Bruno Cardoso Lopes2009-08-141-1/+1
| | | | | | elf object file. llvm-svn: 79029
* Push LLVMContexts through the IntegerType APIs.Owen Anderson2009-08-131-7/+9
| | | | llvm-svn: 78948
* Remove hack used to strip unwanted chars from section nameBruno Cardoso Lopes2009-08-131-98/+64
| | | | | | | Use MCSectionELF methods as much as possible, removing some ELFWriter methods which are now unused llvm-svn: 78940
* Change MCSectionELF to represent a section semantically instead ofBruno Cardoso Lopes2009-08-131-16/+20
| | | | | | | syntactically as a string, very similiar to what Chris did with MachO. The parsing support and validation is not introduced yet. llvm-svn: 78890
* Move ConstantExpr handling to ResolveConstantExpr method and alsoBruno Cardoso Lopes2009-08-101-27/+84
| | | | | | add support for PtrToInt, Add, Mul. llvm-svn: 78552
* sink the 'name' and 'isdirective' state out of MCSection into its derived ↵Chris Lattner2009-08-081-8/+12
| | | | | | | | classes. This totally optimizes PIC16 sections by not having an 'isdirective' bit anymore!! ;-) llvm-svn: 78517
* ELF improvements:Bruno Cardoso Lopes2009-08-081-53/+87
| | | | | | | | | | | Handle large integers, x86_fp80, ConstantAggregateZero, and two more ConstantExpr: GetElementPtr and IntToPtr Set SHF_MERGE bit for mergeable strings Avoid zero initialized strings to be classified as a bss symbol Don't allow common symbols to be classified as STB_WEAK Add a constant to be used as a global value offset in data relocations llvm-svn: 78476
* - Remove custom handling of jumptables by the elf writter (this wasBruno Cardoso Lopes2009-08-051-77/+157
| | | | | | | | | | | | a dirty hack and isn't need anymore since the last x86 code emitter patch) - Add a target-dependent modifier to addend calculation - Use R_X86_64_32S relocation for X86::reloc_absolute_word_sext - Use getELFSectionFlags whenever possible - fix getTextSection to use TLOF and emit the right text section - Handle global emission for static ctors, dtors and Type::PointerTyID - Some minor fixes llvm-svn: 78176
* remove the dead ELFTargetAsmInfo.h/cpp file. TargetAsmInfoChris Lattner2009-08-021-1/+1
| | | | | | defaults to being ELF. llvm-svn: 77866
* (re)introduce new simpler apis for creation sectionkinds.Chris Lattner2009-08-011-8/+7
| | | | llvm-svn: 77834
* Remove "JumpTableDataSection" from TAI, instead, have AsmPrinterChris Lattner2009-08-011-2/+8
| | | | | | | | | | | | compute it based on what it knows. As part of this, rename getSectionForMergeableConstant to getSectionForConstant because it works for non-mergable constants also. The only functionality change from this is that Xcore will start dropping its jump tables into readonly section instead of data section in -static mode. This should be fine as the linker resolves the relocations. If this is a problem, let me know and we'll come up with another solution. llvm-svn: 77833
* Change SectionKind to be a property that is true of a *section*, itChris Lattner2009-08-011-6/+6
| | | | | | | | | | | | | | | | | | should have no state that is specific to particular globals in the section. In this case, it means the removal of the "isWeak" and "ExplicitSection" bits. MCSection uses the new form of SectionKind. To handle isWeak, I introduced a new SectionInfo class, which is SectionKind + isWeak, and it is used by the part of the code generator that does classification of a specific global. The ExplicitSection disappears. It is moved onto MCSection as a new "IsDirective" bit. Since the Name of a section is either a section or directive, it makes sense to keep this bit in MCSection. Ultimately the creator of MCSection should canonicalize (e.g.) .text to whatever the actual section is. llvm-svn: 77803
* switch off of 'Section' onto MCSection. We're not properly usingChris Lattner2009-07-311-2/+3
| | | | | | MCSection subclasses yet, but this is a step in the right direction. llvm-svn: 77708
* refactor section construction in TLOF to be through an explicitChris Lattner2009-07-311-0/+8
| | | | | | initialize method, which can be called when an MCContext is available. llvm-svn: 77687
* pass the mangler down into the various SectionForGlobal methods.Chris Lattner2009-07-291-1/+1
| | | | | | No functionality change. llvm-svn: 77432
* Handle null and file symbol on doInitializationBruno Cardoso Lopes2009-07-281-8/+7
| | | | llvm-svn: 77354
* Rip all of the global variable lowering logic out of TargetAsmInfo. SinceChris Lattner2009-07-281-2/+10
| | | | | | | | | | | | | | | | | | | | it is highly specific to the object file that will be generated in the end, this introduces a new TargetLoweringObjectFile interface that is implemented for each of ELF/MachO/COFF/Alpha/PIC16 and XCore. Though still is still a brutal and ugly refactoring, this is a major step towards goodness. This patch also: 1. fixes a bunch of dangling pointer problems in the PIC16 backend. 2. disables the TargetLowering copy ctor which PIC16 was accidentally using. 3. gets us closer to xcore having its own crazy target section flags and pic16 not having to shadow sections with its own objects. 4. fixes wierdness where ELF targets would set CStringSection but not CStringSection_. Factor the code better. 5. fixes some bugs in string lowering on ELF targets. llvm-svn: 77294
* add module identifier to the elf object fileBruno Cardoso Lopes2009-07-271-3/+8
| | | | llvm-svn: 77238
* Handle external symbols for ELF and add some static methods to ELFSymBruno Cardoso Lopes2009-07-271-21/+55
| | | | llvm-svn: 77232
* Eliminate SectionFlags, just embed a SectionKind into SectionChris Lattner2009-07-271-7/+7
| | | | | | instead and drive things based off of that. llvm-svn: 77184
* make SectionKind know whether a symbol is weak or not in additionChris Lattner2009-07-261-6/+8
| | | | | | to its classification. llvm-svn: 77140
* rename Mergable -> Mergeable and Writable -> WriteableChris Lattner2009-07-261-6/+5
| | | | llvm-svn: 77138
* two files I missed in the last commit.Chris Lattner2009-07-261-6/+6
| | | | llvm-svn: 77137
* simplify getSectionForMergableConstant to take a SectionKind.Chris Lattner2009-07-261-4/+14
| | | | llvm-svn: 77134
* this is (unfortunately) several changes mixed together:Chris Lattner2009-07-251-1/+1
| | | | | | | | | | | | | | 1. Spell SectionFlags::Writeable as "Writable". 2. Add predicates for deriving SectionFlags from SectionKinds. 3. Sink ELF-specific getSectionPrefixForUniqueGlobal impl into ELFTargetAsmInfo. 4. Fix SectionFlagsForGlobal to know that BSS/ThreadBSS has the BSS bit set (the real fix for PR4619). 5. Fix isSuitableForBSS to not put globals with explicit sections set in BSS (which was the reason #4 wasn't fixed earlier). 6. Remove my previous hack for PR4619. llvm-svn: 77085
* remove the SelectSectionForMachineConst hook, replacing it withChris Lattner2009-07-221-1/+3
| | | | | | | | a new getSectionForMergableConstant hook. This removes one dependence of TAI on Type, and provides the hook with enough info to make the right decision based on whether the global has relocations etc. llvm-svn: 76705
* Support adding relocations for data sections, handling the cases whereBruno Cardoso Lopes2009-07-211-24/+48
| | | | | | | global declared symbols are initialized with references from other global symbols. llvm-svn: 76540
* For PC relative relocations where symbols are defined in the same section theyBruno Cardoso Lopes2009-07-201-27/+53
| | | | | | | are referenced, ignore the relocation entry and patch the relocatable field with the computed symbol offset directly llvm-svn: 76414
* Use R_X86_64_32S to handle Jump Table Index relocation entries. Hide TAI ↵Bruno Cardoso Lopes2009-07-181-2/+25
| | | | | | usage inside getSection* functions llvm-svn: 76347
* Add support to properly reference private symbols on relocation entries.Bruno Cardoso Lopes2009-07-181-8/+32
| | | | | | | Use proper relocation type to build relocations for JumpTables (rodata sections). llvm-svn: 76326
* revert one of the loops to use indicies over iterators because there are ↵Bruno Cardoso Lopes2009-07-171-4/+3
| | | | | | vector insertions inside the loop llvm-svn: 76195
* Fix coding style issues pointed by Bill.Bruno Cardoso Lopes2009-07-161-18/+19
| | | | llvm-svn: 75898
* use std::vector instead of std::list for both Section and Symbol lists becauseBruno Cardoso Lopes2009-07-151-97/+99
| | | | | | we care more about random access than insertion/deletion of elements. llvm-svn: 75828
* Reapply my previous asmprinter changes now with more testing and two Chris Lattner2009-07-141-1/+1
| | | | | | | | | | | | | | | | | | | | additional bug fixes: 1. The bug that everyone hit was a problem in the asmprinter where it would remove $stub but keep the L prefix on a name when emitting the indirect symbol. This is easy to fix by keeping the name of the stub and the name of the symbol in a StringMap instead of just keeping a StringSet and trying to reconstruct it late. 2. There was a problem printing the personality function. The current logic to print out the personality function from the DWARF information is a bit of a cesspool right now that duplicates a bunch of other logic in the asm printer. The short version of it is that it depends on emitting both the L and _ prefix for symbols (at least on darwin) and until I can untangle it, it is best to switch the mangler back to emitting both prefixes. llvm-svn: 75646
* llvm_unreachable->llvm_unreachable(0), LLVM_UNREACHABLE->llvm_unreachable.Torok Edwin2009-07-141-5/+5
| | | | | | | | | This adds location info for all llvm_unreachable calls (which is a macro now) in !NDEBUG builds. In NDEBUG builds location info and the message is off (it only prints "UREACHABLE executed"). llvm-svn: 75640
* Revert r7561{9,8,7,6}, which depend on r75610. Daniel Dunbar2009-07-141-1/+1
| | | | | | | | | | | | | | | | | | --- Reverse-merging r75619 into '.': U lib/Target/DarwinTargetAsmInfo.cpp U lib/CodeGen/AsmPrinter/AsmPrinter.cpp --- Reverse-merging r75618 into '.': U lib/CodeGen/ELFWriter.cpp U lib/CodeGen/MachOCodeEmitter.cpp U lib/CodeGen/MachOWriter.cpp --- Reverse-merging r75617 into '.': U lib/Target/CBackend/CBackend.cpp --- Reverse-merging r75616 into '.': U tools/bugpoint/Miscompilation.cpp U tools/lto/LTOCodeGenerator.cpp U tools/lto/LTOModule.cpp llvm-svn: 75638
* Rename getValueName -> getMangledNameChris Lattner2009-07-141-1/+1
| | | | llvm-svn: 75618
* Cleanup the global emission and refactor some codeBruno Cardoso Lopes2009-07-131-89/+100
| | | | llvm-svn: 75537
* assert(0) -> LLVM_UNREACHABLE.Torok Edwin2009-07-111-5/+6
| | | | | | | | | Make llvm_unreachable take an optional string, thus moving the cerr<< out of line. LLVM_UNREACHABLE is now a simple wrapper that makes the message go away for NDEBUG builds. llvm-svn: 75379
* Changed ELFCodeEmitter to inherit from ObjectCodeEmitterBruno Cardoso Lopes2009-07-061-19/+10
| | | | llvm-svn: 74821
* Add the Object Code Emitter class. Original patch by Aaron Gray, I did someBruno Cardoso Lopes2009-07-061-2/+4
| | | | | | cleanup, removed some #includes and moved Object Code Emitter out-of-line. llvm-svn: 74813
* Factor some code out and support for Jump Table relocationsBruno Cardoso Lopes2009-07-031-20/+28
| | | | llvm-svn: 74760
* shrinking down #includesBruno Cardoso Lopes2009-07-021-5/+24
| | | | llvm-svn: 74718
* Support Constant Pool SectionsBruno Cardoso Lopes2009-06-251-4/+37
| | | | | | Add section symbols to the symbol table llvm-svn: 74170
* Use a default alignment for data and bss sections.Bruno Cardoso Lopes2009-06-231-17/+19
| | | | | | | | Only pad when the section size > 0 and move the code that deals with globals initializers to a place we know for sure the global is initialized. llvm-svn: 73944
* Use different functions to emit the string and symbol tables.Bruno Cardoso Lopes2009-06-221-7/+16
| | | | llvm-svn: 73895
* Add more methods to gather target specific elf stuffBruno Cardoso Lopes2009-06-221-119/+208
| | | | | | | | Support for .text relocations, implementing TargetELFWriter overloaded methods for x86/x86_64. Use a map to track global values to their symbol table indexes Code cleanup and small fixes llvm-svn: 73894
OpenPOWER on IntegriCloud