summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/ELFWriter.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* Introduce new BinaryObject (blob) class, ELF Writer modified to use it. ↵Bruno Cardoso Lopes2009-06-141-162/+141
| | | | | | BinaryObject.h by Aaron Gray llvm-svn: 73333
* Support for ELF VisibilityBruno Cardoso Lopes2009-06-111-63/+220
| | | | | | | | Emission for globals, using the correct data sections Function alignment can be computed for each target using TargetELFWriterInfo Some small fixes llvm-svn: 73201
* Delete comment and fix typoBruno Cardoso Lopes2009-06-071-1/+0
| | | | llvm-svn: 73040
* Simple ELF32/64 binary files can now be emitted for x86 and x86_64 withoutBruno Cardoso Lopes2009-06-071-35/+55
| | | | | | relocation sections. llvm-svn: 73038
* Remove elf specific info from ELFWriter.h to Elf.h. Code cleanup and more ↵Bruno Cardoso Lopes2009-06-061-27/+46
| | | | | | comments added llvm-svn: 72982
* Move ELFCodeEmiter stuff to new filesBruno Cardoso Lopes2009-06-031-140/+2
| | | | llvm-svn: 72785
* Rename PaddedSize to AllocSize, in the hope that thisDuncan Sands2009-05-091-1/+1
| | | | | | | will make it more obvious what it represents, and stop it being confused with the StoreSize. llvm-svn: 71349
* Introduce new linkage types linkonce_odr, weak_odr, common_odrDuncan Sands2009-03-071-2/+4
| | | | | | | | | | | | | | | | | | | | | and extern_weak_odr. These are the same as the non-odr versions, except that they indicate that the global will only be overridden by an *equivalent* global. In C, a function with weak linkage can be overridden by a function which behaves completely differently. This means that IP passes have to skip weak functions, since any deductions made from the function definition might be wrong, since the definition could be replaced by something completely different at link time. This is not allowed in C++, thanks to the ODR (One-Definition-Rule): if a function is replaced by another at link-time, then the new function must be the same as the original function. If a language knows that a function or other global can only be overridden by an equivalent global, it can give it the weak_odr linkage type, and the optimizers will understand that it is alright to make deductions based on the function body. The code generators on the other hand map weak and weak_odr linkage to the same thing. llvm-svn: 66339
* Add support to the JIT for true non-lazy operation. When a call to a functionNate Begeman2009-02-181-0/+4
| | | | | | | | | | | | | | | | | | | | that has not been JIT'd yet, the callee is put on a list of pending functions to JIT. The call is directed through a stub, which is updated with the address of the function after it has been JIT'd. A new interface for allocating and updating empty stubs is provided. Add support for removing the ModuleProvider the JIT was created with, which would otherwise invalidate the JIT's PassManager, which is initialized with the ModuleProvider's Module. Add support under a new ExecutionEngine flag for emitting the infomration necessary to update Function and GlobalVariable stubs after JITing them, by recording the address of the stub and the name of the GlobalValue. This allows code to be copied from one address space to another, where libraries may live at different virtual addresses, and have the stubs updated with their new correct target addresses. llvm-svn: 64906
* Add the private linkage.Rafael Espindola2009-01-151-1/+4
| | | | llvm-svn: 62279
* Rename getABITypeSize to getTypePaddedSize, asDuncan Sands2009-01-121-1/+1
| | | | | | suggested by Chris. llvm-svn: 62099
* elf writer really wants the size of the global, not the size Chris Lattner2009-01-041-3/+3
| | | | | | of the pointer to the global. llvm-svn: 61630
* The llvm::ELFWriter::EmitGlobal() method is calling theBill Wendling2009-01-041-0/+1
| | | | | | | | | | llvm::PATypeHolder::get() method when LLVM is self-hosted in Release mode. Before the parser changed, there was a definition of llvm::PAHolder::get() in llvmAsmParser.y. This was probably a bug that no-one noticed. Explicitly #include the Type.h file as a temporary fix for now. llvm-svn: 61620
* Fix MachineCodeEmitter to use uintptr_t instead of intptr_t. This avoids ↵Evan Cheng2008-12-101-4/+4
| | | | | | some overflow issues. Patch by Thomas Jablin. llvm-svn: 60828
* Rename startFunctionStub to startGVStub since it's also used for GV non-lazy ↵Evan Cheng2008-11-081-3/+3
| | | | | | ptr. llvm-svn: 58897
* Tidy up several unbeseeming casts from pointer to intptr_t.Dan Gohman2008-09-041-1/+1
| | | | llvm-svn: 55779
* Use raw_ostream throughout the AsmPrinter.Owen Anderson2008-08-211-4/+5
| | | | llvm-svn: 55092
OpenPOWER on IntegriCloud