aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/TargetLoweringObjectFile.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Provide proper section flags for various BSS flavoursAnton Korobeynikov2009-09-091-1/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81322 91177308-0d34-0410-b5e6-96231b3b80d8
* Whitespace cleanupAnton Korobeynikov2009-09-091-163/+162
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81321 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify.Daniel Dunbar2009-08-261-3/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80176 91177308-0d34-0410-b5e6-96231b3b80d8
* fix COFF targets (mingw/cygwin) to provide ehframe and LSDA sectionsChris Lattner2009-08-181-0/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79346 91177308-0d34-0410-b5e6-96231b3b80d8
* Text sections should have 'exec' flag set. This seems to unbreak libstdc++ ↵Anton Korobeynikov2009-08-181-0/+3
| | | | | | | | on linux. Patch by Dmitry Gorbachev! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79334 91177308-0d34-0410-b5e6-96231b3b80d8
* Clear the uniquing table when initializing TLOF to avoid a crash when the ↵Benjamin Kramer2009-08-171-0/+6
| | | | | | TLOF is reinitialized with a different MCContext. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79253 91177308-0d34-0410-b5e6-96231b3b80d8
* Update getSectionForConstant() to to allow mergable sections to be nulled outRichard Osborne2009-08-171-3/+3
| | | | | | | if not supported by the ELF subtarget. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79249 91177308-0d34-0410-b5e6-96231b3b80d8
* the .eh_frame sections we generate need to be writable (whichChris Lattner2009-08-151-1/+2
| | | | | | | | is why they are datarel). This should fix PR4724, and is fallout from r78890. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79111 91177308-0d34-0410-b5e6-96231b3b80d8
* If ELF subtargets don't want to support 4/8/16-byte mergable sections, allow Chris Lattner2009-08-151-3/+3
| | | | | | | them to null out the default section pointers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79078 91177308-0d34-0410-b5e6-96231b3b80d8
* Make these matching rules more strict so that they don'tDan Gohman2009-08-141-3/+3
| | | | | | | accidentally match unrelated things. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78966 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove HasCrazyBSS and add a flag in TAI to indicate that '.section' Bruno Cardoso Lopes2009-08-131-2/+2
| | | | | | | must be emitted for PowerPC-Linux '.bss' section git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78958 91177308-0d34-0410-b5e6-96231b3b80d8
* Change MCSectionELF to represent a section semantically instead ofBruno Cardoso Lopes2009-08-131-58/+162
| | | | | | | | syntactically as a string, very similiar to what Chris did with MachO. The parsing support and validation is not introduced yet. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78890 91177308-0d34-0410-b5e6-96231b3b80d8
* sink uniquing of sections out of MCContext into the ELF and PECOFF TLOF ↵Chris Lattner2009-08-131-6/+32
| | | | | | | | | implementations. MCContext no longer maintains a string -> section map. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78874 91177308-0d34-0410-b5e6-96231b3b80d8
* add some comments: MCContext owns the MCSections, but it bump pointer allocatesChris Lattner2009-08-131-2/+0
| | | | | | | them, so it doesn't have to explicitly free them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78870 91177308-0d34-0410-b5e6-96231b3b80d8
* reject invalid code like:Chris Lattner2009-08-131-27/+34
| | | | | | | | | | int x __attribute__((section("_foo, _bar"))) = 4; int y __attribute__((section("_foo, _bar, 4byte_literals"))) = 1; git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78867 91177308-0d34-0410-b5e6-96231b3b80d8
* implement support for uniquing MachO sections.Chris Lattner2009-08-121-8/+31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78866 91177308-0d34-0410-b5e6-96231b3b80d8
* reduce #includageChris Lattner2009-08-121-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78860 91177308-0d34-0410-b5e6-96231b3b80d8
* Tidy #includes.Dan Gohman2009-08-111-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78677 91177308-0d34-0410-b5e6-96231b3b80d8
* split MachO section handling stuff out to its out .h/.cpp file.Chris Lattner2009-08-101-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78576 91177308-0d34-0410-b5e6-96231b3b80d8
* Make the big switch: Change MCSectionMachO to represent a section *semantically*Chris Lattner2009-08-101-61/+119
| | | | | | | | | | | | | | | | | | instead of syntactically as a string. This means that it keeps track of the segment, section, flags, etc directly and asmprints them in the right format. This also includes parsing and validation support for llvm-mc and "attribute(section)", so we should now start getting errors about invalid section attributes from the compiler instead of the assembler on darwin. Still todo: 1) Uniquing of darwin mcsections 2) Move all the Darwin stuff out to MCSectionMachO.[cpp|h] 3) there are a few FIXMEs, for example what is the syntax to get the S_GB_ZEROFILL segment type? git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78547 91177308-0d34-0410-b5e6-96231b3b80d8
* 1. Make MCSection an abstract class.Chris Lattner2009-08-081-100/+0
| | | | | | | | | | | 2. Move section switch printing to MCSection virtual method which takes a TAI. This eliminates textual formatting stuff from TLOF. 3. Eliminate SwitchToSectionDirective, getSectionFlagsAsString, and TLOFELF::AtIsCommentChar. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78510 91177308-0d34-0410-b5e6-96231b3b80d8
* make target-specific TLOF impls (except PIC16) create target-specificChris Lattner2009-08-081-3/+3
| | | | | | | MCSection instances. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78500 91177308-0d34-0410-b5e6-96231b3b80d8
* eliminate TargetLoweringObjectFileSparc in favor of a TAI hook.Chris Lattner2009-08-081-3/+23
| | | | | | | | | A TAI hook is appropriate in this case because this is just an asm syntax issue, not a semantic difference. TLOF should model the semantics of the section. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78498 91177308-0d34-0410-b5e6-96231b3b80d8
* now that getOrCreateSection is all object-file specific,Chris Lattner2009-08-081-138/+122
| | | | | | | | give the impls an object-file-specific name. In the future they can take different arguments etc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78495 91177308-0d34-0410-b5e6-96231b3b80d8
* sink getOrCreateSection down into all the object file implementations,Chris Lattner2009-08-081-8/+21
| | | | | | | now that they create *all* the sections. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78494 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix several fixmes and clean up code by sinking *all* sectionChris Lattner2009-08-061-16/+29
| | | | | | | | | | | | | | | | | | creation activity into the target-specific subclasses of TLOF. Before this, globals with explicit sections could be created by the base class. 1. make getOrCreateSection protected, add a new getExplicitSectionGlobal pure virtual method to assign sections to globals with a specified section. 2. eliminate getSpecialCasedSectionGlobals, which is now PIC specific. 3. eliminate the getKindForNamedSection virtual method, which is now just a static method for ELF. 4. Add implementions of getExplicitSectionGlobal for ELF/PECOFF/Darwin/PIC16. They are now all detangled and understandable, woo! :) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78319 91177308-0d34-0410-b5e6-96231b3b80d8
* expose SectionKindForGlobal to curious clients, named asChris Lattner2009-08-051-9/+8
| | | | | | | getKindForGlobal. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78156 91177308-0d34-0410-b5e6-96231b3b80d8
* enhance codegen to put 16-bit character strings into the Chris Lattner2009-08-041-17/+15
| | | | | | | __TEXT,__ustring section on darwin. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78068 91177308-0d34-0410-b5e6-96231b3b80d8
* fix a fixme: don't create an explicit "CStringSection" for ELF,Chris Lattner2009-08-041-9/+4
| | | | | | | it is just being used as a prefix, so forward substitute it directly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78067 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support emiting for 2/4 byte mergable strings to the ".rodata.str*"Chris Lattner2009-08-041-12/+39
| | | | | | | section on ELF targets. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78066 91177308-0d34-0410-b5e6-96231b3b80d8
* make MergeableCString be a SectionKind "abstract class", andChris Lattner2009-08-041-13/+35
| | | | | | | | | add new concrete versions for 1/2/4-byte mergable strings. These are not actually created yet. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78055 91177308-0d34-0410-b5e6-96231b3b80d8
* Eliminate textual section switching from the x86 backend, oneChris Lattner2009-08-031-0/+13
| | | | | | | more step towards "semantics sections" git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78002 91177308-0d34-0410-b5e6-96231b3b80d8
* move dwarf debug info section selection stuff from TAI toChris Lattner2009-08-021-0/+116
| | | | | | | TLOF, unifying all the dwarf targets at the same time. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77889 91177308-0d34-0410-b5e6-96231b3b80d8
* convert EHFrameSection to be managed by TLOF instead of TAI.Chris Lattner2009-08-021-0/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77888 91177308-0d34-0410-b5e6-96231b3b80d8
* move getDwarfExceptionSection from TAI to TLOF and rename it to Chris Lattner2009-08-021-0/+11
| | | | | | | | | | | | getLSDASection() to be more specific. This makes it pretty obvious that the ELF LSDA section is being specified wrong in PIC mode. We're probably getting a lot of startup-time relocations to a readonly page, which is expensive and bad. Someone who cares about ELF C++ should investigate this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77847 91177308-0d34-0410-b5e6-96231b3b80d8
* convert ctors/dtors section to be in TLOF instead ofChris Lattner2009-08-021-0/+24
| | | | | | | TAI. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77842 91177308-0d34-0410-b5e6-96231b3b80d8
* (re)introduce new simpler apis for creation sectionkinds.Chris Lattner2009-08-011-56/+50
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77834 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove "JumpTableDataSection" from TAI, instead, have AsmPrinterChris Lattner2009-08-011-7/+5
| | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77833 91177308-0d34-0410-b5e6-96231b3b80d8
* fix a fixme by sinking various target-specific directives down into Chris Lattner2009-08-011-16/+13
| | | | | | | the appropriate subclasses. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77815 91177308-0d34-0410-b5e6-96231b3b80d8
* coff also doesn't have a ReadOnlySection yet, (!)Chris Lattner2009-08-011-3/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77814 91177308-0d34-0410-b5e6-96231b3b80d8
* coff doesn't set a .bss seciton, so this is dead.Chris Lattner2009-08-011-3/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77813 91177308-0d34-0410-b5e6-96231b3b80d8
* it turns out that isWeak() was basically dead anyway. Kill off SectionInfo :-/Chris Lattner2009-08-011-44/+43
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77812 91177308-0d34-0410-b5e6-96231b3b80d8
* don't use isWeak anymore.Chris Lattner2009-08-011-4/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77810 91177308-0d34-0410-b5e6-96231b3b80d8
* Change SectionKind to be a property that is true of a *section*, itChris Lattner2009-08-011-114/+132
| | | | | | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77803 91177308-0d34-0410-b5e6-96231b3b80d8
* All MCSections are now required to have a SectionKind.Chris Lattner2009-08-011-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77787 91177308-0d34-0410-b5e6-96231b3b80d8
* move emitUsedDirectiveFor to TargetLoweringObjectFile and rename it toChris Lattner2009-07-311-0/+23
| | | | | | | | | indicate that it is a predicate, not an emitter. This eliminates TAI dependencies on Mangler and GlobalValue. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77726 91177308-0d34-0410-b5e6-96231b3b80d8
* switch off of 'Section' onto MCSection. We're not properly usingChris Lattner2009-07-311-24/+23
| | | | | | | | MCSection subclasses yet, but this is a step in the right direction. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77708 91177308-0d34-0410-b5e6-96231b3b80d8
* refactor section construction in TLOF to be through an explicitChris Lattner2009-07-311-7/+6
| | | | | | | initialize method, which can be called when an MCContext is available. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77687 91177308-0d34-0410-b5e6-96231b3b80d8
* fix PR4650: we only track sizes for certain objects, so only put somethingChris Lattner2009-07-311-1/+4
| | | | | | | | | into the mergable section if it is one of our special cases. This could obviously be improved, but this is the minimal fix and restores us to the previous behavior. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77679 91177308-0d34-0410-b5e6-96231b3b80d8
* mingw uses .data and .text, not _data and _text.Chris Lattner2009-07-291-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77435 91177308-0d34-0410-b5e6-96231b3b80d8