summaryrefslogtreecommitdiff
path: root/llvm/lib/Target/TargetLoweringObjectFile.cpp
AgeCommit message (Collapse)Author
2010-02-15Add suffix for stubs, so we won't have name clashes with private symbols.Anton Korobeynikov
llvm-svn: 96286
2010-02-15Preliminary patch to improve dwarf EH generation - Hooks to return ↵Anton Korobeynikov
Personality / FDE / LSDA / TType encoding depending on target / options (e.g. code model / relocation model) - MCIzation of Dwarf EH printer to use encoding information - Stub generation for ELF target (needed for indirect references) - Some other small changes here and there llvm-svn: 96285
2010-01-22Simplify some uses of str(n)cmp with StringRef.Benjamin Kramer
llvm-svn: 94189
2010-01-19stop using the .lcomm pseudoop on darwin, instead, directly use theChris Lattner
.zerofill directive. Streamerize its generation. llvm-svn: 93868
2010-01-19make TLOF subclassify BSS based on linkage type into private, externalChris Lattner
and everything else (weak). llvm-svn: 93846
2010-01-19fix a significant difference between llvm and gcc on ELF systems:Chris Lattner
GCC would put weak zero initialized mutable data in the .bss section, we would put it into a crasy '.gnu.linkonce.b.test,"aw",@nobits' section. Fixing this will allow simplifications next up. llvm-svn: 93844
2010-01-19introduce a section kind for common linkage. Use this to slightlyChris Lattner
simplify and commonize some of the asmprinter logic for globals. This also avoids printing the MCSection for .zerofill, which broke the llvm-gcc build. llvm-svn: 93843
2010-01-19Cleanup handling of .zerofill on darwin:Chris Lattner
1. TargetLoweringObjectFileMachO should decide if something goes in zerofill instead of having every target do it. 2. TargetLoweringObjectFileMachO should assign said symbols to the right MCSection, the asmprinters should just emit to the right section. 3. Since all zerofill stuff goes through mcstreamer anymore, MAI can have a bool "haszerofill" instead of having the textual directive to emit. llvm-svn: 93838
2010-01-17Get MCSymbol out of the mangling business, and move all the logicChris Lattner
to Mangler. Now MCSymbol just decides whether to slap quotes around a symbol when printing it. This also fixes some weirdness where two MCSymbols could be created for the same symbol, if one needed to be mangled and got mangled to the other one. llvm-svn: 93690
2010-01-16move the mangler into libtarget from vmcore.Chris Lattner
llvm-svn: 93664
2010-01-16fix build failure.Chris Lattner
llvm-svn: 93628
2010-01-16remove a couple of actively incorrect uses of getMangledName.Chris Lattner
llvm-svn: 93627
2010-01-13fix ELF section mangling stuff for weak symbols to not useChris Lattner
obsolete Mangler interfaces. llvm-svn: 93356
2010-01-13Use the GV version of getNameWithPrefix in TargetLoweringObjectFileCOFF::Chris Lattner
SelectSectionForGlobal, unbreaking weak globals with no-name. llvm-svn: 93336
2010-01-13add a fixme, ELF MCSection isn't quite right and weak unnamed globals are brokenChris Lattner
on linux (even though they are pointless, they shouldn't ICE). llvm-svn: 93308
2010-01-13eliminate some uses of Mangler::makeNameProper.Chris Lattner
llvm-svn: 93305
2010-01-13change Mangler::makeNameProper to return its result in a SmallVectorChris Lattner
instead of returning it in an std::string. Based on this change: 1. Change TargetLoweringObjectFileCOFF::getCOFFSection to take a StringRef 2. Change a bunch of targets to call makeNameProper with a smallstring, making several of them *much* more efficient. 3. Rewrite Mangler::makeNameProper to not build names and then prepend prefixes, not use temporary std::strings, and to avoid other crimes. llvm-svn: 93298
2010-01-07We need to put any kind of data with a relocation into aEric Christopher
not-readonly segment on darwin. llvm-svn: 92933
2009-11-19Reverting the EH table patches.Bill Wendling
$ svn merge -c -89279 https://llvm.org/svn/llvm-project/llvm/trunk --- Reverse-merging r89279 into '.': U lib/CodeGen/AsmPrinter/DwarfException.cpp U lib/Target/TargetLoweringObjectFile.cpp $ svn merge -c -89270 https://llvm.org/svn/llvm-project/llvm/trunk --- Reverse-merging r89270 into '.': G lib/CodeGen/AsmPrinter/DwarfException.cpp G lib/Target/TargetLoweringObjectFile.cpp llvm-svn: 89379
2009-11-19The "ReadOnlyWithRel" enum seems to apply more to what Darwin does with the EHBill Wendling
exception table than DataRel. llvm-svn: 89279
2009-11-18Attempt #2:Bill Wendling
Place the EH table in the __TEXT section on MachO. It saves space. llvm-svn: 89270
2009-11-07add some missing #includesChris Lattner
llvm-svn: 86367
2009-11-06Pass StringRef by value.Daniel Dunbar
llvm-svn: 86251
2009-09-20--- Reverse-merging r82282 into '.':Bill Wendling
U lib/CodeGen/AsmPrinter/DwarfException.cpp U lib/CodeGen/AsmPrinter/DwarfException.h --- Reverse-merging r82274 into '.': U lib/Target/TargetLoweringObjectFile.cpp G lib/CodeGen/AsmPrinter/DwarfException.cpp These revisions were breaking everything. llvm-svn: 82396
2009-09-20Still one more thing wrong here...Bill Wendling
llvm-svn: 82356
2009-09-20Here's fun! It turns out that these filter functions can be internal. If they'reBill Wendling
internal, they shouldn't use the indirect pointer stuff. In the case of throw_rethrow_test, it was marked as 'internal' and calculated its own offset to its contents. llvm-svn: 82354
2009-09-19Revert r82274. It's causing failures in the CINT2006 benchmarks.Bill Wendling
llvm-svn: 82336
2009-09-18It's inefficient to have place the exception tables (which contain the LSDA)Bill Wendling
into the __DATA section. At launch time, dyld has to update most of the section to fix up the type info pointers. It's better to place it into the __TEXT section and use pc-rel indirect pointer encodings. Similar to the personality routine. llvm-svn: 82274
2009-09-17pass machinemoduleinfo down into getSymbolForDwarfGlobalReference, Chris Lattner
currently unused. llvm-svn: 82157
2009-09-16Big change #1 for personality function references:Chris Lattner
Eliminate the PersonalityPrefix/Suffix & NeedsIndirectEncoding fields from MAI: they aren't part of the asm syntax, they are related to the structure of the object file. To replace their functionality, add a new TLOF::getSymbolForDwarfGlobalReference method which asks targets to decide how to reference a global from EH in a pc-relative way. The default implementation just returns the symbol. The default darwin implementation references the symbol through an indirect $non_lazy_ptr stub. The bizarro x86-64 darwin specialization handles the weird "foo@GOTPCREL+4" hack. DwarfException.cpp now uses this to emit the reference to the symbol in the right way, and this also eliminates another horrible hack from DwarfException.cpp: - if (strcmp(MAI->getPersonalitySuffix(), "+4@GOTPCREL")) - O << "-" << MAI->getPCSymbol(); llvm-svn: 81991
2009-09-09Provide proper section flags for various BSS flavoursAnton Korobeynikov
llvm-svn: 81322
2009-09-09Whitespace cleanupAnton Korobeynikov
llvm-svn: 81321
2009-08-26Simplify.Daniel Dunbar
llvm-svn: 80176
2009-08-18fix COFF targets (mingw/cygwin) to provide ehframe and LSDA sectionsChris Lattner
llvm-svn: 79346
2009-08-18Text sections should have 'exec' flag set. This seems to unbreak libstdc++ ↵Anton Korobeynikov
on linux. Patch by Dmitry Gorbachev! llvm-svn: 79334
2009-08-17Clear the uniquing table when initializing TLOF to avoid a crash when the ↵Benjamin Kramer
TLOF is reinitialized with a different MCContext. llvm-svn: 79253
2009-08-17Update getSectionForConstant() to to allow mergable sections to be nulled outRichard Osborne
if not supported by the ELF subtarget. llvm-svn: 79249
2009-08-15the .eh_frame sections we generate need to be writable (whichChris Lattner
is why they are datarel). This should fix PR4724, and is fallout from r78890. llvm-svn: 79111
2009-08-15If ELF subtargets don't want to support 4/8/16-byte mergable sections, allow Chris Lattner
them to null out the default section pointers. llvm-svn: 79078
2009-08-14Make these matching rules more strict so that they don'tDan Gohman
accidentally match unrelated things. llvm-svn: 78966
2009-08-13Remove HasCrazyBSS and add a flag in TAI to indicate that '.section' Bruno Cardoso Lopes
must be emitted for PowerPC-Linux '.bss' section llvm-svn: 78958
2009-08-13Change MCSectionELF to represent a section semantically instead ofBruno Cardoso Lopes
syntactically as a string, very similiar to what Chris did with MachO. The parsing support and validation is not introduced yet. llvm-svn: 78890
2009-08-13sink uniquing of sections out of MCContext into the ELF and PECOFF TLOF ↵Chris Lattner
implementations. MCContext no longer maintains a string -> section map. llvm-svn: 78874
2009-08-13add some comments: MCContext owns the MCSections, but it bump pointer allocatesChris Lattner
them, so it doesn't have to explicitly free them. llvm-svn: 78870
2009-08-13reject invalid code like:Chris Lattner
int x __attribute__((section("_foo, _bar"))) = 4; int y __attribute__((section("_foo, _bar, 4byte_literals"))) = 1; llvm-svn: 78867
2009-08-12implement support for uniquing MachO sections.Chris Lattner
llvm-svn: 78866
2009-08-12reduce #includageChris Lattner
llvm-svn: 78860
2009-08-11Tidy #includes.Dan Gohman
llvm-svn: 78677
2009-08-10split MachO section handling stuff out to its out .h/.cpp file.Chris Lattner
llvm-svn: 78576
2009-08-10Make the big switch: Change MCSectionMachO to represent a section *semantically*Chris Lattner
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? llvm-svn: 78547