summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/ELFObjectWriter.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Convert a member variable to a local one.Rafael Espindola2015-07-021-3/+3
| | | | llvm-svn: 241284
* Diagnose undefined temporary symbols.Rafael Espindola2015-06-251-0/+5
| | | | | | | | | | | | We already disallowed .global .Lfoo so this is reasonable. This is a small cherry pick from r240130. llvm-svn: 240681
* Revert r240302 ("Bring r240130 back.").Daniel Jasper2015-06-231-10/+3
| | | | | | | | | | | | | This causes errors like: ld: error: blah.o: requires dynamic R_X86_64_PC32 reloc against '' which may overflow at runtime; recompile with -fPIC blah.cc:function f(): error: undefined reference to '' blah.o:g(): error: undefined reference to '' I have not yet come up with an appropriate reproduction. llvm-svn: 240394
* Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC)Alexander Kornienko2015-06-231-1/+1
| | | | | | Apparently, the style needs to be agreed upon first. llvm-svn: 240390
* Fix PR23914.Evgeniy Stepanov2015-06-221-1/+1
| | | | | | | r226830 moved the declaration of Buf to a nested scope, resulting in a dangling reference (in StringRef Name), and a use-after-free. llvm-svn: 240357
* Bring r240130 back.Rafael Espindola2015-06-221-3/+10
| | | | | | | | | | | | | | | | | | | | | | Now that pr23900 is fixed, we can bring it back with no changes. Original message: Make all temporary symbols unnamed. 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: 240302
* Update ELFObjectWriter::reset() following r238073.Yaron Keren2015-06-201-0/+1
| | | | llvm-svn: 240218
* Revert 240130, it caused crashes (repro in PR23900).Nico Weber2015-06-191-10/+3
| | | | llvm-svn: 240193
* 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
OpenPOWER on IntegriCloud