summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/WinCOFFObjectWriter.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Replace OwningPtr<T> with std::unique_ptr<T>.Ahmed Charles2014-03-061-2/+1
| | | | | | | | | | This compiles with no changes to clang/lld/lldb with MSVC and includes overloads to various functions which are used by those projects and llvm which have OwningPtr's as parameters. This should allow out of tree projects some time to move. There are also no changes to libs/Target, which should help out of tree targets have time to move, if necessary. llvm-svn: 203083
* Reuse constants for COFF string table entry offsetsNico Rieck2014-02-251-7/+9
| | | | llvm-svn: 202130
* MC: Support COFF string tables larger than 10MBNico Rieck2014-02-221-1/+27
| | | | | | | | Offsets past the range of single-slash encoding are encoded as base64, padded to 6 characters, and prefixed with two slashes. This encoding is undocumented but used by MSVC. llvm-svn: 201940
* Fix PR18381 - print a minimal diagnostic rather than assert on unresolved ↵Timur Iskhodzhanov2014-01-301-0/+5
| | | | | | .secidx target llvm-svn: 200490
* MC: Fatally error if subtraction operand is badDavid Majnemer2014-01-061-5/+16
| | | | | | | | | Instead of crashing, raise an error when a subtraction expression involves an undefined symbol. This fixes PR18375. llvm-svn: 198590
* Correct word hyphenationsAlp Toker2013-12-051-1/+1
| | | | | | | This patch tries to avoid unrelated changes other than fixing a few hyphen-related ambiguities and contractions in nearby lines. llvm-svn: 196471
* Fix a funny typo.Rafael Espindola2013-12-041-1/+1
| | | | | | Thanks for j`ey and Sean Silva for noticing it. llvm-svn: 196344
* Produce deterministic coff files.Rafael Espindola2013-12-041-1/+2
| | | | llvm-svn: 196341
* [weak vtables] Remove a bunch of weak vtablesJuergen Ributzka2013-11-191-1/+4
| | | | | | | | | | | | This patch removes most of the trivial cases of weak vtables by pinning them to a single object file. The memory leaks in this version have been fixed. Thanks Alexey for pointing them out. Differential Revision: http://llvm-reviews.chandlerc.com/D2068 Reviewed by Andy llvm-svn: 195064
* Revert "COFF: Emit all MCSymbols rather than filtering out some of them"Reid Kleckner2013-11-181-2/+19
| | | | | | | | This reverts commit r190888, to fix PR17967. The original change wasn't the right way to get @feat.00 into the object file. The right fix is to make @feat.00 be a global symbol. llvm-svn: 195053
* Revert r194865 and r194874.Alexey Samsonov2013-11-181-4/+1
| | | | | | | | | | | | This change is incorrect. If you delete virtual destructor of both a base class and a subclass, then the following code: Base *foo = new Child(); delete foo; will not cause the destructor for members of Child class. As a result, I observe plently of memory leaks. Notable examples I investigated are: ObjectBuffer and ObjectBufferStream, AttributeImpl and StringSAttributeImpl. llvm-svn: 194997
* [weak vtables] Remove a bunch of weak vtablesJuergen Ributzka2013-11-151-1/+4
| | | | | | | | | | | This patch removes most of the trivial cases of weak vtables by pinning them to a single object file. Differential Revision: http://llvm-reviews.chandlerc.com/D2068 Reviewed by Andy llvm-svn: 194865
* COFF: Ensure that objects produced by LLVM link with /safesehReid Kleckner2013-09-171-5/+14
| | | | | | | | | | | | | | | | | | | | Summary: We indicate that the object files are safe by emitting a @feat.00 absolute address symbol. The address is presumably interpreted as a bitfield of features that the compiler would like to enable. Bit 0 is documented in the PE COFF spec to opt in to "registered SEH", which is what /safeseh enables. LLVM's object files are safe by default because LLVM doesn't know how to produce SEH handlers. Reviewers: Bigcheese CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1691 llvm-svn: 190898
* COFF: Emit all MCSymbols rather than filtering out some of themReid Kleckner2013-09-171-19/+3
| | | | | | | | | | In particular, this means we emit non-external symbols defined to variables, such as aliases or absolute addresses. This is needed to implement /safeseh, and it appears there was some confusion about what symbols to emit previously. llvm-svn: 190888
* COFF: Remove ExportSection, which has been dead since r114823Reid Kleckner2013-09-171-5/+0
| | | | llvm-svn: 190887
* Remove unused functions.Eli Friedman2013-09-101-11/+0
| | | | llvm-svn: 190442
* MC: Support larger COFF string tablesNico Rieck2013-07-291-12/+15
| | | | | | | Single-slash encoded entries do not require a terminating null. This bumps the maximum table size from ~1MB to ~9.5MB. llvm-svn: 187352
* [mc-coff] Resolve aliases when emitting COFF relocationsReid Kleckner2013-07-151-2/+3
| | | | | | | | | | | | This is consistent with the ELF object writer. Add some COFF tests that relocate against an alias. Reviewers: espindola Differential Revision: http://llvm-reviews.chandlerc.com/D1079 llvm-svn: 186341
* MC: Implement COFF .linkonce directiveNico Rieck2013-07-061-1/+30
| | | | llvm-svn: 185753
* COFF: Fix weak external aliases.Peter Collingbourne2013-04-221-28/+29
| | | | | | Differential Revision: http://llvm-reviews.chandlerc.com/D700 llvm-svn: 180034
* MC: Support COFF image-relative MCSymbolRefsNico Rieck2013-04-101-7/+2
| | | | | | | | | | | | | | | | Add support for the COFF relocation types IMAGE_REL_I386_DIR32NB and IMAGE_REL_AMD64_ADDR32NB for 32- and 64-bit respectively. These are similar to normal 4-byte relocations except that they do not include the base address of the image. Image-relative relocations are used for debug information (32-bit) and SEH unwind tables (64-bit). A new MCSymbolRef variant called 'VK_COFF_IMGREL32' is introduced to specify such relocations. For AT&T assembly, this variant can be accessed using the symbol suffix '@imgrel'. llvm-svn: 179240
* Remove unused variable (unused since r173839)Dmitri Gribenko2013-01-291-4/+1
| | | | llvm-svn: 173847
* [MC][COFF] Delay handling symbol aliases when writingMichael J. Spencer2013-01-291-10/+16
| | | | | | Fixes PR14447 and PR9034. Patch by Nico Rieck! llvm-svn: 173839
* Remove redundant 'llvm::' qualificationsDmitri Gribenko2013-01-131-12/+12
| | | | llvm-svn: 172358
* Use the new script to sort the includes of every file under lib.Chandler Carruth2012-12-031-13/+9
| | | | | | | | | | | | | | | | | Sooooo many of these had incorrect or strange main module includes. I have manually inspected all of these, and fixed the main module include to be the nearest plausible thing I could find. If you own or care about any of these source files, I encourage you to take some time and check that these edits were sensible. I can't have broken anything (I strictly added headers, and reordered them, never removed), but they may not be the headers you'd really like to identify as containing the API being implemented. Many forward declarations and missing includes were added to a header files to allow them to parse cleanly when included first. The main module rule does in fact have its merits. =] llvm-svn: 169131
* Revert 'Fix a typo 'iff' => 'if''. iff is an abreviation of if and only if. ↵Sylvestre Ledru2012-09-271-1/+1
| | | | | | See: http://en.wikipedia.org/wiki/If_and_only_if Commit 164767 llvm-svn: 164768
* Fix a typo 'iff' => 'if'Sylvestre Ledru2012-09-271-1/+1
| | | | llvm-svn: 164767
* Implement relocation-overflow behavior for PE/COFF.Michael J. Spencer2012-03-151-2/+29
| | | | | | | | | This needs a test, but it will take some time to figure out the best way to get an input that will produce > 2^16 relocs. Patch by Graydon Hoare! llvm-svn: 152787
* Move x86 specific bits of the COFF writer to lib/Target/X86.Rafael Espindola2011-12-241-39/+17
| | | | llvm-svn: 147231
* Move all the dependencies on X86FixupKinds.h to a single method in preparationRafael Espindola2011-12-221-27/+34
| | | | | | to moving it to lib/Target/X86. llvm-svn: 147190
* Add back the MC bits of 126425. Original patch by Nathan Jeffords. I added theRafael Espindola2011-12-171-0/+4
| | | | | | asm parsing and testcase. llvm-svn: 146801
* Switch MCAssembler to method names starting w/ lower-case.Jim Grosbach2011-12-061-1/+1
| | | | | | per http://llvm.org/docs/CodingStandards.html#ll_naming llvm-svn: 145873
* MC/COFF: Correctly emit the size of an empty string table.Michael J. Spencer2011-11-081-0/+1
| | | | llvm-svn: 144111
* Refactor X86 target to separate MC code from Target code.Evan Cheng2011-07-251-1/+1
| | | | llvm-svn: 135930
* Fix relative relocations. This is sufficient for running the rust testsuite withRafael Espindola2011-04-211-1/+6
| | | | | | MC :-) llvm-svn: 129923
* Behave like gnu as when a relocation crosses sections.Rafael Espindola2011-04-201-8/+13
| | | | llvm-svn: 129850
* Roll out r126425 and r126450 to see if it fixes the failures on the buildbots.Cameron Zwarich2011-02-251-4/+0
| | | | llvm-svn: 126488
* Enable DebugInfo support for COFF object files.Devang Patel2011-02-241-0/+4
| | | | | | Patch by Nathan Jeffords! llvm-svn: 126425
* Gas is very inconsistent about when a relaxation/relocation is needed. DoRafael Espindola2011-02-161-20/+0
| | | | | | the right thing and stop trying to copy it. Fixes PR8944. llvm-svn: 125648
* Merge IsFixupFullyResolved and IsSymbolRefDifferenceFullyResolved. We nowRafael Espindola2010-12-241-32/+17
| | | | | | have a single point where targets test if a relocation is needed. llvm-svn: 122549
* Merge isAbsolute into IsSymbolRefDifferenceFullyResolved.Rafael Espindola2010-12-181-14/+0
| | | | llvm-svn: 122148
* Remove the MCObjectFormat class.Rafael Espindola2010-12-181-0/+6
| | | | llvm-svn: 122147
* MC/ObjectWriter: Add a new IsSymbolRefDifferenceFullyResolved target format ↵Daniel Dunbar2010-12-171-0/+8
| | | | | | | | specific hook. - Currently just has stub implementations for Mach-O, ELF, and COFF. llvm-svn: 122037
* MC/Assembler: Strip out object writer arguments, now that it is always availableDaniel Dunbar2010-12-171-1/+1
| | | | | | -- and remove FIXME asking for the same! llvm-svn: 122032
* Sorry for such a large commit. The summary is that only MachO cares about theRafael Espindola2010-12-071-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | actuall addresses in a .o file, so it is better to let the MachO writer compute it. This is good for two reasons. First, areas that shouldn't care about addresses now don't have access to it. Second, the layout of each section is independent. I should use this in a subsequent commit to speed it up. Most of the patch is just removing the section address computation. The two interesting parts are the change on how we handle padding in the end of sections and how MachO can get the address of a-b when a and b are in different sections. Since now the expression evaluation normally doesn't know the section address, it will think that a-b needs relocation and let the MachO writer know. Once it has computed the section addresses, it calls back the expression evaluation with the section addresses to resolve these expressions. The remaining problem is the handling of padding. Currently it will create a special alignment fragment at the end. Since that fragment doesn't update the alignment of the section, it needs the real address to be computed. Since now the layout will not compute a-b with a and b in different sections, the only effect that the special alignment fragment has is update the address size of the section. This can also be done by the MachO writer. llvm-svn: 121076
* Use getSymbolOffset on the COFF writer.Rafael Espindola2010-12-061-1/+1
| | | | llvm-svn: 120979
* Merge System into Support.Michael J. Spencer2010-11-291-1/+1
| | | | llvm-svn: 120298
* Define generic 1, 2 and 4 byte pc relative relocations. They are commonRafael Espindola2010-11-281-1/+1
| | | | | | and at least the 4 byte one will be needed to implement the .cfi_* directives. llvm-svn: 120240
* Fix Warnings.Michael J. Spencer2010-10-211-1/+1
| | | | llvm-svn: 117062
* MC-COFF: Add support for default-null weak externals.Michael J. Spencer2010-10-161-45/+57
| | | | llvm-svn: 116666
OpenPOWER on IntegriCloud