summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCSectionCOFF.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [MC] Clean up unused inline function and non-anchor defaulted destructors; NFCIHubert Tong2019-02-091-2/+0
| | | | | | | | | | | | | | | | | | | | | | Summary: Take care of some missing clean-ups that belong with r249548 and some other copy/paste that had happened. In particular, the destructors are no longer vtable anchors after r249548; and `setSectionName` in `MCSectionWasm` is private and unused since r313058 culled its only caller. The destructors are now implicitly defined, and the unused function is removed. Reviewers: nemanjai, jasonliu, grosbach Reviewed By: nemanjai Subscribers: sbc100, aheejin, sunfish, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D57182 llvm-svn: 353597
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* [COFF] Fix assembly output of comdat sections without an attached symbolMartin Storsjo2018-07-231-10/+15
| | | | | | | | | | | | | | | | Since SVN r335286, the .xdata sections are produced without an attached symbol, which requires using a different syntax when printing assembly output. Instead of the usual syntax of '.section <name>,"dr",discard,<symbol>', use '.section <name>,"dr"' + '.linkonce discard' (which is what GCC uses for all assembly output). This fixes PR38254. Differential Revision: https://reviews.llvm.org/D49651 llvm-svn: 337756
* Move Object format code to lib/BinaryFormat.Zachary Turner2017-06-071-1/+1
| | | | | | | | | | | | This creates a new library called BinaryFormat that has all of the headers from llvm/Support containing structure and layout definitions for various types of binary formats like dwarf, coff, elf, etc as well as the code for identifying a file from its magic. Differential Revision: https://reviews.llvm.org/D33843 llvm-svn: 304864
* [MC] Fix some Clang-tidy modernize and Include What You Use warnings; other ↵Eugene Zelenko2017-02-101-5/+4
| | | | | | minor fixes (NFC). llvm-svn: 294685
* Only print architecture dependent flags for that architecture.Rafael Espindola2017-01-301-1/+1
| | | | | | | | | | Different architectures can have different meaning for flags in the SHF_MASKPROC mask, so we should always check what the architecture use before checking the flag. NFC for now, but will allow fixing the value of an xmos flag. llvm-svn: 293484
* [MC] Handle discardable COFF sections in assemblyReid Kleckner2016-09-141-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This fixes a dumpbin warning on objects produced by the MC assembler when starting from text. All .debug$S sections are supposed to be marked IMAGE_SCN_MEM_DISCARDABLE. The main, non-COMDAT .debug$S section had this set, but any comdat ones were not being marked discardable because there was no .section flag for it. This change does two things: - If the section name starts with .debug, implicitly mark the section as discardable. This means we do the same thing as gas on .s files with DWARF from GCC, which is important. - Adds the 'D' flag to the .section directive on COFF to explicitly say a section is discardable. We only emit this flag if the section name does not start with .debug. This allows the user to explicitly tweak their section flags without worrying about magic section names. The only thing you can't do in this scheme is to create a non-discardable section with a name starting with ".debug", but hopefully users don't need that. Reviewers: majnemer, rafael Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D24582 llvm-svn: 281554
* Sink COFF.h MC include into .cpp filesReid Kleckner2015-09-031-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
* MC: Add target hook to control symbol quotingMatt Arsenault2015-06-091-1/+1
| | | | llvm-svn: 239370
* MC: Emit COFF section flags in the "proper" orderDavid Majnemer2015-02-071-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
* MC: Fix MCSectionCOFF::PrintSwitchToSectionDavid Majnemer2014-09-201-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
* MC: Treat ReadOnlyWithRel and ReadOnlyWithRelLocal as ReadOnly for COFFDavid Majnemer2014-09-201-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
* Fix a few issues with comdat handling on COFF.Rafael Espindola2014-06-061-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
* MC: honour IMAGE_SCN_CNT_INITIALIZED_DATASaleem Abdulrasool2014-04-231-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
* [C++11] More 'nullptr' conversion or in some cases just using a boolean ↵Craig Topper2014-04-131-1/+1
| | | | | | check instead of comparing to nullptr. llvm-svn: 206129
* MC COFF: Emit the 'b' section flag for .bss sections in GNU assemblyReid Kleckner2013-12-171-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
* Use simple section names for COMDAT sections on COFF.Rafael Espindola2013-11-271-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
* Revert "Re-commit r192758 - MC: quote tricky symbol names in asm output"Hans Wennborg2013-10-181-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
* Re-commit r192758 - MC: quote tricky symbol names in asm outputHans Wennborg2013-10-171-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
* Revert r192758 (and r192759), "MC: Better handling of tricky symbol and ↵NAKAMURA Takumi2013-10-161-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
* MC: Better handling of tricky symbol and section namesHans Wennborg2013-10-161-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
* MC: Implement COFF .linkonce directiveNico Rieck2013-07-061-5/+19
| | | | llvm-svn: 185753
* Add support for subsections to the ELF assembler. Fixes PR8717.Peter Collingbourne2013-04-171-1/+2
| | | | | | Differential Revision: http://llvm-reviews.chandlerc.com/D598 llvm-svn: 179725
* Tidy up. Trailing whitespace.Jim Grosbach2012-05-111-3/+3
| | | | llvm-svn: 156602
* make isVirtualSection a virtual method on MCSection. Chris' suggestion.Rafael Espindola2010-11-171-0/+4
| | | | llvm-svn: 119547
* Add hook in MCSection to decide when to use "optimized nops", for eachJan Wen Voung2010-10-041-0/+4
| | | | | | | section kind. Previously, optimized nops were only used for MachO. Also added tests for ELF and COFF. llvm-svn: 115523
* MC: Move COFF enumeration constants to llvm/Support/COFF.h, patch by MichaelDaniel Dunbar2010-07-011-7/+7
| | | | | | Spencer! llvm-svn: 107418
* stylistic change to MCSectionCOFF::PrintSwitchToSection COMDAT handlingNathan Jeffords2010-05-121-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
* updated support for the COFF .linkonceNathan Jeffords2010-05-121-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
* test commit, added a comment to MCSectionCOFF::PrintSwitchToSection functionNathan Jeffords2010-05-091-0/+1
| | | | llvm-svn: 103372
* add COFF support for COMDAT sections, patch by Nathan Jeffords!Chris Lattner2010-05-071-1/+1
| | | | llvm-svn: 103304
* switch MCSectionCOFF from a syntactic to semantic representation,Chris Lattner2010-05-071-0/+49
patch by Peter Housel! llvm-svn: 103267
OpenPOWER on IntegriCloud