summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/ELFObjectWriter.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove structure field that can be computed just before use.Rafael Espindola2015-05-281-14/+15
| | | | llvm-svn: 238480
* Avoid warnings when building without asserts.Rafael Espindola2015-05-281-7/+2
| | | | llvm-svn: 238479
* Move these vectors to the only function where they are used.Rafael Espindola2015-05-281-6/+4
| | | | llvm-svn: 238477
* Merge redundant loops. NFC.Rafael Espindola2015-05-281-18/+11
| | | | llvm-svn: 238471
* Simplify LastLocalSymbolIndex computation. NFC.Rafael Espindola2015-05-281-4/+2
| | | | llvm-svn: 238465
* Use range loops. NFC.Rafael Espindola2015-05-281-7/+3
| | | | llvm-svn: 238463
* Remove temporary FileSymbolData. NFC.Rafael Espindola2015-05-281-12/+8
| | | | llvm-svn: 238461
* Use range loops for accessing file names. NFC.Rafael Espindola2015-05-281-4/+4
| | | | llvm-svn: 238446
* Merge computeSymbolTable and writeSymbolTable.Rafael Espindola2015-05-281-94/+80
| | | | | | | For now this just saves a few loops, but it will allow more simplifications in the future. llvm-svn: 238444
* Don't create an unused _GLOBAL_OFFSET_TABLE_.Rafael Espindola2015-05-281-43/+1
| | | | | | | | This was a bug for bug compatibility with gas that is completely unnecessary. If a _GLOBAL_OFFSET_TABLE_ symbol is used, it will already be created by the time we get to the ELF writer. llvm-svn: 238432
* There is only one current section.Rafael Espindola2015-05-271-3/+4
| | | | | | | | | | | | | | | | | Both MCStreamer and MCObjectStreamer were maintaining a current section variable and they were slightly out of sync. I don't think this was observable, but was inefficient and error prone. Changing this requires a few cascading changes: * SwitchSection has to call ChangeSection earlier for ChangeSection to see the old section. * With that change, ChangeSection cannot call EmitLabel, since during ChangeSection we are still in the old section. * When the object streamer requires a begin label, just reused the existing generic support for begin labels instead of calling EmitLabel directly. llvm-svn: 238357
* Delete MCSectionData.Rafael Espindola2015-05-271-2/+2
| | | | llvm-svn: 238331
* Remove uses of MCSectionData from ELFObjectWriter. NFC.Rafael Espindola2015-05-271-9/+7
| | | | llvm-svn: 238317
* Remove most uses of MCSectionData from MCAssembler.Rafael Espindola2015-05-261-3/+3
| | | | llvm-svn: 238172
* Stop using MCSectionData in MCAsmLayout.h.Rafael Espindola2015-05-261-5/+3
| | | | llvm-svn: 238170
* Return a MCSection from MCFragment::getParent().Rafael Espindola2015-05-261-5/+2
| | | | | | Another step in merging MCSectionData and MCSection. llvm-svn: 238162
* Turn MCSectionData into a field of MCSection.Rafael Espindola2015-05-251-2/+3
| | | | | | | This also changes MCAssembler to store a vector of MCSections instead of an iplist of MCSectionData. llvm-svn: 238159
* Make a few MCSectionELF& variables const. NFC.Rafael Espindola2015-05-251-8/+9
| | | | | | This just reduces the noise from another patch. llvm-svn: 238156
* Produce a single string table in a ELF .oRafael Espindola2015-05-221-43/+39
| | | | | | | | | | | | | | | | | | | | Normally an ELF .o has two string tables, one for symbols, one for section names. With the scheme of naming sections like ".text.foo" where foo is a symbol, there is a big potential saving in using a single one. Building llvm+clang+lld with master and with this patch the results were: master: 193,267,008 bytes patch: 186,107,952 bytes master non unique section names: 183,260,192 bytes patch non unique section names: 183,118,632 bytes So using non usique saves 10,006,816 bytes, and the patch saves 7,159,056 while still using distinct names for the sections. llvm-svn: 238073
* MC: Lift MCSymbolData::Index up to MCSymbol::Index, NFCDuncan P. N. Exon Smith2015-05-221-5/+5
| | | | | | | Lift `MCSymbolData::Index` up a level to `MCSymbol`, as preparation for packing it into the bitfield in `MCSymbol`. llvm-svn: 238001
* Stop forwarding (get|set)Aligment from MCSectionData to MCSection.Rafael Espindola2015-05-211-1/+1
| | | | llvm-svn: 237956
* Stop creating MCSectionData is the ELF writer.Rafael Espindola2015-05-211-35/+45
| | | | | | | Now is is just its use of MCSymbolData that requires it to take a non const MCAssembler. llvm-svn: 237951
* writeSymbolTable now only needs a MCContext.Rafael Espindola2015-05-211-12/+7
| | | | | | It used to use an MCAssembler just to record the alignment of the sections. llvm-svn: 237944
* Pass a const MCAssembler to writeSectionHeader.Rafael Espindola2015-05-211-5/+9
| | | | | | | It never creates sections, so it can use Asm.getSectionData instead of Asm.getOrCreateSectionData. llvm-svn: 237943
* Remove unused argument. NFC.Rafael Espindola2015-05-211-8/+5
| | | | llvm-svn: 237940
* Fetch alignment directly out of MCSection. NFC.Rafael Espindola2015-05-211-7/+5
| | | | llvm-svn: 237938
* Move alignment from MCSectionData to MCSection.Rafael Espindola2015-05-211-18/+16
| | | | | | | | | | | | | | | | | | | | | | | | This starts merging MCSection and MCSectionData. There are a few issues with the current split between MCSection and MCSectionData. * It optimizes the the not as important case. We want the production of .o files to be really fast, but the split puts the information used for .o emission in a separate data structure. * The ELF/COFF/MachO hierarchy is not represented in MCSectionData, leading to some ad-hoc ways to represent the various flags. * It makes it harder to remember where each item is. The attached patch starts merging the two by moving the alignment from MCSectionData to MCSection. Most of the patch is actually just dropping 'const', since MCSectionData is mutable, but MCSection was not. llvm-svn: 237936
* MC: Use MCSymbol in MCObjectWriter::isWeak(), NFCDuncan P. N. Exon Smith2015-05-201-3/+3
| | | | | | Continue to prefer `MCSymbol` when we need both. llvm-svn: 237798
* MC: Use MCSymbol in most of ELFObjectWriter, NFCDuncan P. N. Exon Smith2015-05-201-36/+36
| | | | | | Stop using MCSymbolData where we also need MCSymbol. llvm-svn: 237770
* MC: Use MCSymbol in MCAsmLayout::getSymbolOffset(), NFCDuncan P. N. Exon Smith2015-05-191-5/+4
| | | | | | | Continue to canonicalize on MCSymbol instead of MCSymbolData when both are needed. llvm-svn: 237749
* MC: Clean up method names in MCContext.Jim Grosbach2015-05-181-5/+5
| | | | | | | The naming was a mish-mash of old and new style. Update to be consistent with the new. NFC. llvm-svn: 237594
* MC: Use MCSymbol in MCObject::IsSymbolRefDifferenceFullyResolvedImpl()Duncan P. N. Exon Smith2015-05-161-9/+8
| | | | | | | | Transition one API from `MCSymbolData` to `MCSymbol`. The function needs both, and the backpointer from `MCSymbolData` to `MCSymbol` is going away. llvm-svn: 237498
* MC: Change MCAssembler::Symbols to store MCSymbol, NFCDuncan P. N. Exon Smith2015-05-161-4/+4
| | | | | | | | Instead of storing a list of the `MCSymbolData` in use, store the `MCSymbol`s. Churning in the direction of removing the back pointer from `MCSymbolData`. llvm-svn: 237496
* Update ELFObjectWriter::reset() following r236255.Yaron Keren2015-05-131-0/+2
| | | | llvm-svn: 237261
* Remove unnecessary break.Rafael Espindola2015-04-301-1/+0
| | | | llvm-svn: 236275
* Simplify the creation of compressed debug sections.Rafael Espindola2015-04-301-106/+33
| | | | | | | | | | This is actually fairly simple in the current code layout: Check if we should compress just before writing out and everything else just works. This removes the last case in which the object writer was creating a fragment. llvm-svn: 236267
* Replace unreachable code with llvm_unreachable.Rafael Espindola2015-04-301-1/+1
| | | | llvm-svn: 236261
* Don't create a MCSectionData when we don't have to.Rafael Espindola2015-04-301-11/+7
| | | | llvm-svn: 236260
* Avoid an extra loop over the sections.Rafael Espindola2015-04-301-7/+1
| | | | | | Add string to the section header string table as we add sections. llvm-svn: 236257
* Make the section table a member of ELFObjectWriter.Rafael Espindola2015-04-301-52/+43
| | | | | | | This avoids passing it around and lets us build a small helper to add a section to the table. llvm-svn: 236255
* Nothing inherits from this, drop the protected:Rafael Espindola2015-04-301-2/+0
| | | | llvm-svn: 236253
* Write sections mostly in one pass.Rafael Espindola2015-04-301-143/+93
| | | | | | | | | | | During ELF writing, there is no need to further relax the sections, so we should not be creating fragments. This patch avoids doing so in all cases but debug section compression (that is next). Also, the ELF format is fairly simple to write. We can do a single pass over the sections to write them out and compute the section header table. llvm-svn: 236235
* Silencing an "enumeral and non-enumeral type in conditional expression" ↵Aaron Ballman2015-04-301-1/+1
| | | | | | warning; NFC. llvm-svn: 236234
* Store relocations in a map from MCSectionELF.Rafael Espindola2015-04-301-25/+21
| | | | | | Saves finding the MCSectionData just to do a map lookup. llvm-svn: 236189
* Write relocations directly to the output stream. NFC.Rafael Espindola2015-04-301-46/+29
| | | | llvm-svn: 236187
* Inline FragmentWriter into the only user.Rafael Espindola2015-04-291-18/+4
| | | | llvm-svn: 236158
* Write the symbol table directly to the output file.Rafael Espindola2015-04-291-79/+85
| | | | | | There is no need to first accumulate it in fragments. llvm-svn: 236157
* Use pwrite to write the number of sections.Rafael Espindola2015-04-291-10/+15
| | | | | | | This avoids having to compute the number upfront, which will be used in the next patch. llvm-svn: 236153
* Write the string table directly to the output file.Rafael Espindola2015-04-291-14/+22
| | | | | | There is no need to accumulate it in fragments first. llvm-svn: 236148
* Write the section header string table directly to the output stream.Rafael Espindola2015-04-291-30/+38
| | | | | | | | | | Instead of accumulating the content in a fragment first, just write it to the output stream. Also put it first in the section table, so that we never have to worry about its index being >= SHN_LORESERVE. llvm-svn: 236145
OpenPOWER on IntegriCloud