summaryrefslogtreecommitdiffstats
path: root/lld/lib/ReaderWriter/ELF
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove include/lld/Core/Endian.h and use llvm/Support/Endian.h instead.Rui Ueyama2015-03-025-11/+15
| | | | llvm-svn: 231005
* Update the list of relocations that need to be implemented.Davide Italiano2015-03-021-2/+1
| | | | | | | While at it, point the correct document where the missing TLS relocation(s) are described. llvm-svn: 230937
* Add missing includes for make_unique, lld edition.Benjamin Kramer2015-03-024-5/+6
| | | | llvm-svn: 230925
* [ELF] Set up initial live symbol(s) to avoid incorrect reclaim of atoms.Davide Italiano2015-02-271-0/+4
| | | | | | | | | | | | | If no initial live symbols are set up, and deadStrip() == true, the Resolver ends up reclaiming all the symbols that aren't absolute. This is wrong. This patch fixes the issue by setting entrySymbolName() as live, and this allows us to self-host lld when --gc-sections is enabled. There are still quite a few problems with --gc-sections (test failures), so the option can't be enabled by default. Differential Revision: D7926 Reviewed by: ruiu, shankarke llvm-svn: 230737
* [ELF] Remove includes that are not usedShankar Easwaran2015-02-271-21/+0
| | | | | | This remove(s) include of the filename twice. llvm-svn: 230733
* Update comments, fix typos.Rui Ueyama2015-02-271-3/+3
| | | | llvm-svn: 230729
* Remove unused #includes.Rui Ueyama2015-02-272-2/+0
| | | | llvm-svn: 230726
* Add {read,write}{16,32,64}{le,be} functions.Rui Ueyama2015-02-275-117/+47
| | | | | | | | | | | | | | Nothing wrong with reinterpret_cast<llvm::support::ulittle32_t *>(loc), but that's redundant and not great from readability point of view. The new functions are wrappers for that kind of reinterpet_casts. Surprisingly or unsurprisingly, there was no use of big endian read and write. {read,write}{16,32,64}be have no user. But I think they still worth to be there in the header for completeness. http://reviews.llvm.org/D7927 llvm-svn: 230725
* [ELF] Reduce the code indentationSimon Atanasyan2015-02-261-11/+10
| | | | | | No functional changes. llvm-svn: 230678
* [Mips] Mark some MipsELFFile member functions as constantSimon Atanasyan2015-02-261-3/+3
| | | | | | No functional changes. llvm-svn: 230677
* Add Example Sub Target.Michael J. Spencer2015-02-266-0/+130
| | | | llvm-svn: 230594
* [ELF][x86-64] Make the X86_64LinkingContext and X86_64TargetHandler derivable.Michael J. Spencer2015-02-263-14/+21
| | | | llvm-svn: 230593
* Remove unused variables.Michael J. Spencer2015-02-251-4/+1
| | | | llvm-svn: 230578
* [ELF][x86] Detemplatify ELFT. There's only a single valid instantiation.Michael J. Spencer2015-02-256-56/+64
| | | | llvm-svn: 230574
* [ELF][X86_64] Handle R_X86_64_PC64 relocationDavide Italiano2015-02-251-0/+11
| | | | | | | Differential Revision: D7820 Reviewed by: shankarke, ruiu llvm-svn: 230465
* [ELF] Create a map from Reference to Symbol.Shankar Easwaran2015-02-233-24/+36
| | | | | | | | | | | In LLD's model, symbol is a property of the node (atom) and not a property of edge (reference). Prior to this patch, we stored the symbol in the reference. From post-commit comments, it seemed better to create a map from the reference to the symbol instead and use this mapping wherever desired. Address comments from Ruiu/Simon Atanasyan. llvm-svn: 230273
* [ELF][Writer] Use llvm::StringMap insteadShankar Easwaran2015-02-231-1/+1
| | | | | | Cleanup. llvm-svn: 230219
* [ELF] Add comments in the ELF readerShankar Easwaran2015-02-233-7/+18
| | | | | | Address review comments from Ruiu, and add some more TODO's. llvm-svn: 230218
* [ELF] Add section group/COMDAT support.Shankar Easwaran2015-02-238-29/+143
| | | | | | | | | | | | | | | | | | | | | | | | | | SHF_GROUP: Group Member Sections ---------------------------------- A section which is part of a group, and is to be retained or discarded with the group as a whole, is identified by a new section header attribute: SHF_GROUP This section is a member (perhaps the only one) of a group of sections, and the linker should retain or discard all or none of the members. This section must be referenced in a SHT_GROUP section. This attribute flag may be set in any section header, and no other modification or indication is made in the grouped sections. All additional information is contained in the associated SHT_GROUP section. SHT_GROUP: Section Group Definition ------------------------------------- Represents a group section. The section group's sh_link field identifies a symbol table section, and its sh_info field the index of a symbol in that section. The name of that symbol is treated as the identifier of the section group. More information: https://mentorembedded.github.io/cxx-abi/abi/prop-72-comdat.html Added a lot of extensive tests, that tests functionality. llvm-svn: 230195
* [ELF] Add .gnu.linkonce support.Shankar Easwaran2015-02-234-12/+136
| | | | | | | | | | | | | When the GNU linker sees two input sections with the same name, and the name starts with ".gnu.linkonce.", the linker will only keep one copy and discard the other. Any section whose name starts with “.gnu.linkonce.” is a COMDAT section. Some architectures like Hexagon use this section to store floating point constants, that need be deduped. This patch adds gnu.linkonce functionality to the ELFReader. llvm-svn: 230194
* [ELF] Add symbol to ELFReference.Shankar Easwaran2015-02-223-21/+28
| | | | | | | | | Relocation handling need more information about the Symbol that we are creating references for. No change in functionality. llvm-svn: 230191
* [ELF][X86_64] R_X86_64_16 relocation supportShankar Easwaran2015-02-222-0/+13
| | | | llvm-svn: 230189
* Switch to use override, fixes -Winconsistent-missing-override on LLD.Chandler Carruth2015-02-221-3/+2
| | | | llvm-svn: 230166
* [ELF] Teach GNU Driver about --stats.Davide Italiano2015-02-221-1/+1
| | | | | | | | | | | | | This is mainly for back-compatibility with GNU ld. Ideally --stats should be a general option in LinkingContext, providing individual stats for every pass in the linking process. In the GNU driver, a better wording could be used, but there's no need to change it for now. Differential Revision: D7657 Reviewed by: ruiu llvm-svn: 230157
* [ELF] Remove FIXME(s) that are already fixed.Shankar Easwaran2015-02-211-4/+2
| | | | | | | | FIXME code was left around in few places where its already been taken care of. This removes the FIXME's that are not needed. llvm-svn: 230139
* [ELF][Writer] Use Path to create AtomSection.Shankar Easwaran2015-02-212-21/+32
| | | | | | | | | Now since the correct file path for atoms is available and not clobbered, commit r222309 which was reverted previously can be added back. No change in functionality. llvm-svn: 230138
* [ELF] Fix References being ignored.Shankar Easwaran2015-02-211-2/+2
| | | | | | | | The ELFReader was skipping references for sections that contained relocations. This fixes the bug. llvm-svn: 230127
* Remove YAML/Native round-trip passes.Rui Ueyama2015-02-203-3/+0
| | | | | | | | | | | | | | | | | | | | The round-trip passes were introduced in r193300. The intention of the change was to make sure that LLD is capable of reading end writing such file formats. But that turned out to be yet another over-designed stuff that had been slowing down everyday development. The passes ran after the core linker and before the writer. If you had an additional piece of information that needs to be passed from front-end to the writer, you had to invent a way to save the data to YAML/Native. These passes forced us to do that even if that data was not needed to be represented neither in an object file nor in an executable/DSO. It doesn't make sense. We don't need these passes. http://reviews.llvm.org/D7480 llvm-svn: 230069
* [ELF] Demangle: don't expose raw info when getter is available.Davide Italiano2015-02-181-1/+1
| | | | | | | Differential Revision: D7693 Reviewed by: shankarke llvm-svn: 229635
* [Mips] Replace a magic number by enumerationSimon Atanasyan2015-02-161-1/+1
| | | | | | No functional changes. llvm-svn: 229453
* [Mips] Read GP0 value from .MIPS.options sectionSimon Atanasyan2015-02-161-5/+37
| | | | llvm-svn: 229442
* [Mips] Show error if MIPS_REGINFO section has invalid sizeSimon Atanasyan2015-02-161-3/+3
| | | | llvm-svn: 229441
* [Mips] Factor out the code to search section by type and flags into theSimon Atanasyan2015-02-161-18/+31
| | | | | | | | separate functions No functional changes. llvm-svn: 229440
* [ELF] Replace std::set with StringSet.Shankar Easwaran2015-02-132-15/+7
| | | | | | | | | Wrap functionality was using a std::set to record symbols that need to be wrapped. This changes the implementation to use a StringSet instead. No change in functionality. llvm-svn: 229165
* ELF/AArch64: Add support for checking for ABS32 overflowWill Newton2015-02-131-5/+14
| | | | | | | Add support for checking overflow when applying a R_AARCH64_ABS32 relocation and add a test to ensure it behaves correctly. llvm-svn: 229072
* Remove unused parameters.Rui Ueyama2015-02-136-20/+12
| | | | llvm-svn: 229055
* Remove class that really does nothing.Rui Ueyama2015-02-134-15/+2
| | | | llvm-svn: 229030
* [ELF] Insert wrap symbols into a set.Shankar Easwaran2015-02-121-2/+3
| | | | | | | Symbols specified by --wrap was being inserted into a vector, change this to insert into a set, so that we have unique entries. llvm-svn: 228968
* [ELF][Cleanup] Remove unused functionShankar Easwaran2015-02-121-4/+0
| | | | | | We can add this function when we really have a need. llvm-svn: 228907
* [ELF] Support --wrap optionShankar Easwaran2015-02-122-2/+64
| | | | | | | | | | | | | | | | | | | | | | | | Use a wrapper function for symbol. Any undefined reference to symbol will be resolved to "__wrap_symbol". Any undefined reference to "__real_symbol" will be resolved to symbol. This can be used to provide a wrapper for a system function. The wrapper function should be called "__wrap_symbol". If it wishes to call the system function, it should call "__real_symbol". Here is a trivial example: void * __wrap_malloc (size_t c) { printf ("malloc called with %zu\n", c); return __real_malloc (c); } If you link other code with this file using --wrap malloc, then all calls to "malloc" will call the function "__wrap_malloc" instead. The call to "__real_malloc" in "__wrap_malloc" will call the real "malloc" function. llvm-svn: 228906
* [ELF] Add LinkingContext to the ELFReader.Shankar Easwaran2015-02-1227-170/+180
| | | | | | | | | | | | | | | This adds the LinkingContext parameter to the ELFReader. Previously the flags in that were needed in the Context was passed to the ELFReader, this made it very hard to access data structures in the LinkingContext when reading an ELF file. This change makes the ELFReader more flexible so that required parameters can be grabbed directly from the LinkingContext. Future patches make use of the changes. There is no change in functionality though. llvm-svn: 228905
* [ELF][ARM] Fix veneer symbol names in Release buildDenis Protivensky2015-02-111-8/+4
| | | | | | | The fix is for r228680. This makes tests also work. llvm-svn: 228837
* [ELF][ARM] Add veneer generation to branch instructionsDenis Protivensky2015-02-101-2/+187
| | | | | | | | | | When calling ARM code from Thumb and vice versa, a veneer that switches instruction set should be generated. Added veneer generation for ARM_JUMP24 ARM_THM_JUMP24 instructions. Differential Revision: http://reviews.llvm.org/D7502 llvm-svn: 228680
* [ELF] Implement --strip-all/-sDavide Italiano2015-02-082-2/+5
| | | | | | | Differential Revision: D7489 Reviewed by: shankarke llvm-svn: 228533
* Remove unused parameter.Rui Ueyama2015-02-073-3/+3
| | | | llvm-svn: 228476
* Use make_unique.Rui Ueyama2015-02-067-18/+15
| | | | llvm-svn: 228453
* Remove unused #include.Rui Ueyama2015-02-061-1/+0
| | | | llvm-svn: 228450
* ELF: Split OrderPass::compareInitFini for readability. NFC.Rui Ueyama2015-02-061-18/+15
| | | | llvm-svn: 228449
* [Revert] [ELF] Determine default search directories from ContextShankar Easwaran2015-02-061-9/+0
| | | | | | | It looks like the Driver manages search path for each Target lld would support on the Gnu flavor. llvm-svn: 228440
* [ELF][TODO] Update TODO.Shankar Easwaran2015-02-061-1/+3
| | | | llvm-svn: 228380
OpenPOWER on IntegriCloud