aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/MC/MCSectionCOFF.cpp
AgeCommit message (Collapse)AuthorFilesLines
2015-09-03Sink COFF.h MC include into .cpp filesReid Kleckner1-0/+1
This prevents MC clients from getting COFF.h, which conflicts with winnt.h macros. Also a minor IWYU cleanup. Now the only public headers including COFF.h are in Object, and they actually need it. llvm-svn: 246784
2015-06-09MC: Add target hook to control symbol quotingMatt Arsenault1-1/+1
llvm-svn: 239370
2015-02-07MC: Emit COFF section flags in the "proper" orderDavid Majnemer1-4/+4
COFF section flags are not idempotent: 'rd' will make a read-write section because 'd' implies write 'dr' will make a read-only section because 'r' disables write llvm-svn: 228490
2014-09-20MC: Fix MCSectionCOFF::PrintSwitchToSectionDavid Majnemer1-7/+11
We had a few bugs: - We were considering the GVKind instead of just looking at the section characteristics - We would never print out 'y' when a section was meant to be unreadable - We would never print out 's' when a section was meant to be shared - We translated IMAGE_SCN_MEM_DISCARDABLE to 'n' when it should've meant IMAGE_SCN_LNK_REMOVE llvm-svn: 218189
2014-09-20MC: Treat ReadOnlyWithRel and ReadOnlyWithRelLocal as ReadOnly for COFFDavid Majnemer1-1/+1
A problem with our old behavior becomes observable under x86-64 COFF when we need a read-only GV which has an initializer which is referenced using a relocation: we would mark the section as writable. Marking the section as writable interferes with section merging. This fixes PR21009. llvm-svn: 218179
2014-06-06Fix a few issues with comdat handling on COFF.Rafael Espindola1-7/+2
* Section association cannot use just the section name as many sections can have the same name. With this patch, the comdat symbol in an assoc section is interpreted to mean a symbol in the associated section and the mapping is discovered from it. * Comdat symbols were not being set correctly. Instead we were getting whatever was output first for that section. A consequence is that associative sections now must use .section to set the association. Using .linkonce would not work since it is not possible to change a sections comdat symbol (it is used to decide if we should create a new section or reuse an existing one). This includes r210298, which was reverted because it was asserting on an associated section having the same comdat as the associated section. llvm-svn: 210367
2014-04-23MC: honour IMAGE_SCN_CNT_INITIALIZED_DATASaleem Abdulrasool1-1/+2
Emit the flag to indicate to the assembler that a section contains data if there is pre-populated data present. llvm-svn: 207028
2014-04-13[C++11] More 'nullptr' conversion or in some cases just using a boolean ↵Craig Topper1-1/+1
check instead of comparing to nullptr. llvm-svn: 206129
2013-12-17MC COFF: Emit the 'b' section flag for .bss sections in GNU assemblyReid Kleckner1-0/+2
Without this, assembling clang's disassembly would produce an object file with the IMAGE_SCN_CNT_INITIALIZED_DATA section characteristic rather than the uninitialized one. link.exe would warn when merging comdats with different flags. llvm-svn: 197529
2013-11-27Use simple section names for COMDAT sections on COFF.Rafael Espindola1-8/+15
With this patch we use simple names for COMDAT sections (like .text or .bss). This matches the MSVC behavior. When merging it is the COMDAT symbol that is used to decide if two sections should be merged, so there is no point in building a fancy name. This survived a bootstrap on mingw32. llvm-svn: 195798
2013-10-18Revert "Re-commit r192758 - MC: quote tricky symbol names in asm output"Hans Wennborg1-20/+1
This caused the clang-native-mingw32-win7 buildbot to break. The assembler was complaining about the following lines that were showing up in the asm for CrashRecoveryContext.cpp: movl $"__ZL16ExceptionHandlerP19_EXCEPTION_POINTERS@4", 4(%eax) calll "_AddVectoredExceptionHandler@8" .def "__ZL16ExceptionHandlerP19_EXCEPTION_POINTERS@4"; "__ZL16ExceptionHandlerP19_EXCEPTION_POINTERS@4": calll "_RemoveVectoredExceptionHandler@4" Reverting for now. llvm-svn: 192940
2013-10-17Re-commit r192758 - MC: quote tricky symbol names in asm outputHans Wennborg1-1/+20
The reason this got reverted was that the @feat.00 symbol which was emitted for every TU became quoted, and on cygwin/mingw we use the gas assembler which couldn't handle the quotes. This commit fixes the problem by only emitting @feat.00 for win32, where we use clang -cc1as to assemble. gas would just drop this symbol anyway, so there is no loss there. With @feat.00 gone, there shouldn't be quoted symbols showing up on cygwin since it uses the Itanium ABI, which doesn't put these funny characters in symbols. > Because of win32 mangling, we produce symbol and section names with > funny characters in them, most notably @ characters. > > MC would choke on trying to parse its own assembly output. This patch addresses > that by: > > - Making @ trigger quoting of symbol names > - Also quote section names in the same way > - Just parse section names like other identifiers (to allow for quotes) > - Don't assume @ signifies a symbol variant if it is in a string. llvm-svn: 192859
2013-10-16Revert r192758 (and r192759), "MC: Better handling of tricky symbol and ↵NAKAMURA Takumi1-20/+1
section names" GNU AS didn't like quotes in symbol names. Error: junk at end of line, first unrecognized character is `"' .def "@feat.00"; "@feat.00" = 1 Reproduced on Cygwin's 2.23.52.20130309 and mingw32's 2.20.1.20100303. llvm-svn: 192775
2013-10-16MC: Better handling of tricky symbol and section namesHans Wennborg1-1/+20
Because of win32 mangling, we produce symbol and section names with funny characters in them, most notably @ characters. MC would choke on trying to parse its own assembly output. This patch addresses that by: - Making @ trigger quoting of symbol names - Also quote section names in the same way - Just parse section names like other identifiers (to allow for quotes) - Don't assume @ signifies a symbol variant if it is in a string. Differential Revision: http://llvm-reviews.chandlerc.com/D1945 llvm-svn: 192758
2013-07-06MC: Implement COFF .linkonce directiveNico Rieck1-5/+19
llvm-svn: 185753
2013-04-17Add support for subsections to the ELF assembler. Fixes PR8717.Peter Collingbourne1-1/+2
Differential Revision: http://llvm-reviews.chandlerc.com/D598 llvm-svn: 179725
2012-05-11Tidy up. Trailing whitespace.Jim Grosbach1-3/+3
llvm-svn: 156602
2010-11-17make isVirtualSection a virtual method on MCSection. Chris' suggestion.Rafael Espindola1-0/+4
llvm-svn: 119547
2010-10-04Add hook in MCSection to decide when to use "optimized nops", for eachJan Wen Voung1-0/+4
section kind. Previously, optimized nops were only used for MachO. Also added tests for ELF and COFF. llvm-svn: 115523
2010-07-01MC: Move COFF enumeration constants to llvm/Support/COFF.h, patch by MichaelDaniel Dunbar1-7/+7
Spencer! llvm-svn: 107418
2010-05-12stylistic change to MCSectionCOFF::PrintSwitchToSection COMDAT handlingNathan Jeffords1-7/+7
Made a stylistic changed to the code/comments related to the unsupported COMDAT selection type IMAGE_COMDAT_SELECT_LARGEST based on from Anton Korobeynikov. llvm-svn: 103590
2010-05-12updated support for the COFF .linkonceNathan Jeffords1-0/+26
Now, the .linkonce directive is emitted as part of MCSectionCOFF::PrintSwitchToSection instead of AsmPrinter::EmitLinkage since it is an attribute of the section the symbol was placed into not the symbol itself. llvm-svn: 103568
2010-05-09test commit, added a comment to MCSectionCOFF::PrintSwitchToSection functionNathan Jeffords1-0/+1
llvm-svn: 103372
2010-05-07add COFF support for COMDAT sections, patch by Nathan Jeffords!Chris Lattner1-1/+1
llvm-svn: 103304
2010-05-07switch MCSectionCOFF from a syntactic to semantic representation,Chris Lattner1-0/+49
patch by Peter Housel! llvm-svn: 103267