summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/ELFObjectWriter.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Fixed/added namespace ending comments using clang-tidy. NFCAlexander Kornienko2015-06-191-1/+1
| | | | | | | | | | | | | The patch is generated using this command: tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py -fix \ -checks=-*,llvm-namespace-comment -header-filter='llvm/.*|clang/.*' \ llvm/lib/ Thanks to Eugene Kosov for the original patch! llvm-svn: 240137
* Make all temporary symbols unnamed.Rafael Espindola2015-06-191-3/+10
| | | | | | | | | | | | | | | | What this does is make all symbols that would otherwise start with a .L (or L on MachO) unnamed. Some of these symbols still show up in the symbol table, but we can just make them unnamed. In order to make sure we produce identical results when going thought assembly, all .L (not just the compiler produced ones), are now unnamed. Running llc on llvm-as.opt.bc, the peak memory usage goes from 208.24MB to 205.57MB. llvm-svn: 240130
* Refactor padding writing into a helper function.Rafael Espindola2015-06-051-12/+12
| | | | llvm-svn: 239174
* Save a map lookup. NFC.Rafael Espindola2015-06-051-2/+4
| | | | llvm-svn: 239168
* MC: Clean up the naming for MCMachObjectWriter. NFC.Jim Grosbach2015-06-041-2/+2
| | | | | | | | | | | | | | | | | | s/ExecutePostLayoutBinding/executePostLayoutBinding/ s/ComputeSymbolTable/computeSymbolTable/ s/BindIndirectSymbols/bindIndirectSymbols/ s/RecordTLVPRelocation/recordTLVPRelocation/ s/RecordScatteredRelocation/recordScatteredRelocation/ s/WriteLinkerOptionsLoadCommand/writeLinkerOptionsLoadCommand/ s/WriteLinkeditLoadCommand/writeLinkeditLoadCommand/ s/WriteNlist/writeNlist/ s/WriteDysymtabLoadCommand/writeDysymtabLoadCommand/ s/WriteSymtabLoadCommand/writeSymtabLoadCommand/ s/WriteSection/writeSection/ s/WriteSegmentLoadCommand/writeSegmentLoadCommand/ s/WriteHeader/writeHeader/ llvm-svn: 239119
* MC: Clean up naming in MCObjectWriter. NFC.Jim Grosbach2015-06-041-29/+29
| | | | | | | | | | | | | | | | | | | | s/WriteObject/writeObject/ s/RecordRelocation/recordRelocation/ s/IsSymbolRefDifferenceFullyResolved/isSymbolRefDifferenceFullyResolved/ s/Write8/write8/ s/WriteLE16/writeLE16/ s/WriteLE32/writeLE32/ s/WriteLE64/writeLE64/ s/WriteBE16/writeBE16/ s/WriteBE32/writeBE32/ s/WriteBE64/writeBE64/ s/Write16/write16/ s/Write32/write32/ s/Write64/write64/ s/WriteZeroes/writeZeroes/ s/WriteBytes/writeBytes/ llvm-svn: 239108
* Remove unused argument. NFC.Rafael Espindola2015-06-041-4/+3
| | | | llvm-svn: 239092
* Omit unused section symbols from the symbol table.Rafael Espindola2015-06-041-3/+5
| | | | | | | | | | | | | | Section symbols exist as an optimization: instead of having multiple relocations point to different symbols, many of them can point to a single section symbol. When that optimization is unused, a section symbol is also unused and adds no extra information to the object file. This saves a bit of space on the object files and makes the output of llvm-objdump -t easier to read and consequently some tests get quite a bit simpler. llvm-svn: 239045
* Bring back r239006 with a fix.Rafael Espindola2015-06-041-2/+1
| | | | | | | | | | | | | | | | | | | The fix is just that getOther had not been updated for packing the st_other values in fewer bits and could return spurious values: - unsigned Other = (getFlags() & (0x3f << ELF_STO_Shift)) >> ELF_STO_Shift; + unsigned Other = (getFlags() & (0x7 << ELF_STO_Shift)) >> ELF_STO_Shift; Original message: Pack the MCSymbolELF bit fields into MCSymbol's Flags. This reduces MCSymolfELF from 64 bytes to 56 bytes on x86_64. While at it, also make getOther/setOther easier to use by accepting unshifted STO_* values. llvm-svn: 239012
* Revert "Pack the MCSymbolELF bit fields into MCSymbol's Flags."Rafael Espindola2015-06-041-1/+2
| | | | | | | | This reverts commit r239006. I am debugging the powerpc failures. llvm-svn: 239010
* Pack the MCSymbolELF bit fields into MCSymbol's Flags.Rafael Espindola2015-06-041-2/+1
| | | | | | | | | This reduces MCSymolfELF from 64 bytes to 56 bytes on x86_64. While at it, also make getOther/setOther easier to use by accepting unshifted STO_* values. llvm-svn: 239006
* Remove MCELFSymbolFlags.h. It is now internal to MCSymbolELF.Rafael Espindola2015-06-041-3/+2
| | | | llvm-svn: 238996
* Remember if a weakref of a symbol has been used.Rafael Espindola2015-06-031-26/+14
| | | | | | | | | This avoids yet another last minute patching of the binding. While at it, also simplify the weakref implementation a bit by not walking past it in the expression evaluation. llvm-svn: 238982
* Store whether a symbol is a comdat signature in MCSymbolELF.Rafael Espindola2015-06-031-21/+2
| | | | | | | With this getBinging can now return the correct answer for all cases not involving a .symver and the elf writer doesn't need to patch it last minute. llvm-svn: 238980
* Record in a MCSymbolELF if it has been used in a relocation.Rafael Espindola2015-06-031-10/+6
| | | | | | No functionality change, just saves an on the side map. llvm-svn: 238979
* Simplify the logic in ELFObjectWriter::isInSymtab. NFC.Rafael Espindola2015-06-031-9/+5
| | | | | | | _GLOBAL_OFFSET_TABLE_ is not magical and we can now directly check for a symbol never getting an explicit binding. llvm-svn: 238978
* Pass a MCSymbolELF to a few ELF only functions. NFC.Rafael Espindola2015-06-021-1/+1
| | | | llvm-svn: 238868
* Merge MCELF.h into MCSymbolELF.h.Rafael Espindola2015-06-021-36/+41
| | | | | | | Now that we have a dedicated type for ELF symbol, these helper functions can become member function of MCSymbolELF. llvm-svn: 238864
* Create a MCSymbolELF.Rafael Espindola2015-06-021-3/+5
| | | | | | | | | This create a MCSymbolELF class and moves SymbolSize since only ELF needs a size expression. This reduces the size of MCSymbol from 56 to 48 bytes. llvm-svn: 238801
* Remove getData.Rafael Espindola2015-05-291-22/+12
| | | | | | This completes the mechanical part of merging MCSymbol and MCSymbolData. llvm-svn: 238617
* Remove the MCSymbolData typedef.Rafael Espindola2015-05-291-6/+6
| | | | | | The getData member function is next. llvm-svn: 238611
* Rename getOrCreateSymbolData to registerSymbol and return void.Rafael Espindola2015-05-291-1/+1
| | | | | | Another step in merging MCSymbol and MCSymbolData. llvm-svn: 238607
* Fix build without asserts.Rafael Espindola2015-05-291-0/+2
| | | | llvm-svn: 238597
* Pass MCSymbols to the helper functions in MCELF.h.Rafael Espindola2015-05-291-33/+27
| | | | llvm-svn: 238596
* Pass a MCSymbol to needsRelocateWithSymbol.Rafael Espindola2015-05-291-1/+1
| | | | llvm-svn: 238589
* Move common symbol related information from MCSectionData to MCSymbol.Rafael Espindola2015-05-291-4/+4
| | | | llvm-svn: 238583
* Move SymbolSize from MCSymbolData to MCSymbol.Rafael Espindola2015-05-291-2/+2
| | | | llvm-svn: 238580
* Simplify now that symbols contain the correct section.Rafael Espindola2015-05-291-9/+4
| | | | | | | The complexity in here was because before r233995 variable symbols would report the incorrect section. llvm-svn: 238559
* Fix ELFObjectWriter::isLocal for signature symbols.Rafael Espindola2015-05-291-8/+8
| | | | | | | | | And with that simplify the logic for inserting them in ExternalSymbolData or LocalSymbolData. No functionality change overall since the old code avoided the isLocal bug. llvm-svn: 238555
* Don't special case undefined symbol when deciding the symbol order.Rafael Espindola2015-05-281-9/+1
| | | | | | | | | ELF has no restrictions on where undefined symbols go relative to other defined symbols. In fact, gas just sorts them together. Do the same. This was there since r111174 probably just because the MachO writer has it. llvm-svn: 238513
* Remove a trivial forwarding function. NFC.Rafael Espindola2015-05-281-3/+3
| | | | llvm-svn: 238506
* Inline trivial method. NFC.Rafael Espindola2015-05-281-14/+2
| | | | llvm-svn: 238492
* 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
OpenPOWER on IntegriCloud