summaryrefslogtreecommitdiffstats
path: root/lld/lib/ReaderWriter/ELF/Reader.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Remove the old ELF linker.Rafael Espindola2016-02-281-43/+0
| | | | | | I think it is clear by now that the new linker is viable. llvm-svn: 262158
* [ELF] Remove redundant unique_ptr moves found by -Wpessimizing-move.Benjamin Kramer2015-05-221-1/+1
| | | | llvm-svn: 238030
* ELF: Move registerRelocationNames() from TargetHandler to ↵Rui Ueyama2015-04-021-1/+1
| | | | | | | | | | | | | | | | | | | | | <Arch>ELFLinkingContext. registerRelocationNames() function is called to register all known ELF relocation types to the central registry. Since we have separate LinkingContext class for each ELF machine type, we need to call the function for each LinkingContext. However, the function belonged to TargetHandler instead of LinkingContext. So we needed to do ctx.getTargetHandler().registerRelocationNames(). This patch removes that redundant getTargetHandler call by moving the function from TargetHandler to LinkingContext. Conceptually this patch is small, but in reality it's not that small. It's because the same code is copied to each architecture. Most of this patch is just repetition. We need to merge them, but that cannot be done in this patch. llvm-svn: 233883
* ELF: Remove TargetHandlerBase by merging it with TargetHandler.Rui Ueyama2015-04-011-3/+3
| | | | | | | | | | | | | | | | | | | In r233772, I removed an empty class, DefaultTargetHandler, from the class hierarchy by merging the class with TargetHandler. I then found that TargetHandler and its base class, TargetHandlerBase, are also almost the same. We need to go deeper. In this patch, I merged TargetHandlerBase with TargetHandler. The only difference between them is the existence (or absense) of a pure virtual function registerRelocationName(). I added that function to the (new) TargetHandler. One more thing is that TargetHandler was templated for no reason. I made it non-templated class. llvm-svn: 233773
* [ELF] Add LinkingContext to the ELFReader.Shankar Easwaran2015-02-121-7/+5
| | | | | | | | | | | | | | | 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] Add Readers for all the ELF subtargets.Shankar Easwaran2014-10-181-1/+0
| | | | | | | | | This would permit the ELF reader to check the architecture that is being selected by the linking process. This patch also sorts the include files according to LLVM conventions. llvm-svn: 220129
* [ELF] Remove class declarations that do nothing.Rui Ueyama2014-03-281-76/+0
| | | | | | | These classes are declared in a .cpp file but not used in the same compliation unit. They seems to have been copy-and-pasted from ELFReader.h. llvm-svn: 204988
* Add "override" and remove "virtual" where appropriate.Rui Ueyama2014-03-061-4/+4
| | | | | | | For the record, I used clang-modernize to add "override" and perl to remove "virtual". llvm-svn: 203164
* [ELF] Add Target specific Readers.Shankar Easwaran2014-01-271-13/+10
| | | | | | No change in functionality. llvm-svn: 200175
* [ELF] Separate ELFReader classes for subclassingShankar Easwaran2014-01-271-28/+4
| | | | llvm-svn: 200173
* [ELF] Unify interfaces between DynamicFile/ELFFile.Shankar Easwaran2014-01-271-10/+9
| | | | llvm-svn: 200172
* [ELF] Rename File.h to ELFFile.h to avoid confusion.Shankar Easwaran2014-01-261-1/+1
| | | | | | No change in functionality. llvm-svn: 200166
* [ELF] Dont include all targetsShankar Easwaran2014-01-261-3/+0
| | | | llvm-svn: 200165
* Use getError instead of the error_code operator.Rafael Espindola2014-01-081-2/+2
| | | | llvm-svn: 198797
* Run clang-format on r197727.Rui Ueyama2013-12-201-30/+29
| | | | llvm-svn: 197788
* [lld] Introduce registry and Reference kind tupleNick Kledzik2013-12-191-59/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The main changes are in: include/lld/Core/Reference.h include/lld/ReaderWriter/Reader.h Everything else is details to support the main change. 1) Registration based Readers Previously, lld had a tangled interdependency with all the Readers. It would have been impossible to make a streamlined linker (say for a JIT) which just supported one file format and one architecture (no yaml, no archives, etc). The old model also required a LinkingContext to read an object file, which would have made .o inspection tools awkward. The new model is that there is a global Registry object. You programmatically register the Readers you want with the registry object. Whenever you need to read/parse a file, you ask the registry to do it, and the registry tries each registered reader. For ease of use with the existing lld code base, there is one Registry object inside the LinkingContext object. 2) Changing kind value to be a tuple Beside Readers, the registry also keeps track of the mapping for Reference Kind values to and from strings. Along with that, this patch also fixes an ambiguity with the previous Reference::Kind values. The problem was that we wanted to reuse existing relocation type values as Reference::Kind values. But then how can the YAML write know how to convert a value to a string? The fix is to change the 32-bit Reference::Kind into a tuple with an 8-bit namespace (e.g. ELF, COFFF, etc), an 8-bit architecture (e.g. x86_64, PowerPC, etc), and a 16-bit value. This tuple system allows conversion to and from strings with no ambiguities. llvm-svn: 197727
* Fix "doesnot", "endsup" typos and "lets" grammar issuesAlp Toker2013-12-021-2/+2
| | | | llvm-svn: 196056
* Remove unnecessary namespace qualifier.Rui Ueyama2013-11-051-1/+1
| | | | llvm-svn: 194037
* [lld][InputGraph] Change the Resolver to use inputGraphShankar Easwaran2013-10-071-15/+10
| | | | | | | | | | | | Changes :- a) Functionality in InputGraph to insert Input elements at any position b) Functionality in the Resolver to use nextFile c) Move the functionality of assigning file ordinals to InputGraph d) Changes all inputs to MemoryBuffers e) Remove LinkerInput, InputFiles, ReaderArchive llvm-svn: 192081
* Change the parseFile argument from MemoryBuffer pointer to LinkerInputJoerg Sonnenberger2013-09-071-8/+9
| | | | | | reference. Move readFile logic into FileNode::createLinkerInput. llvm-svn: 190253
* Rename ti -> ctx.Rui Ueyama2013-08-271-6/+6
| | | | | | | This should have been done in r187823 when I renamed LinkingContext from TargetInfo. I missed a few files. llvm-svn: 189298
* Rename TargetInfo -> LinkingContext.Rui Ueyama2013-08-061-13/+13
| | | | | | | | | Also change some local variable names: "ti" -> "context" and "_targetInfo" -> "_context". Differential Revision: http://llvm-reviews.chandlerc.com/D1301 llvm-svn: 187823
* [ELF] add NMAGIC/OMAGIC supportShankar Easwaran2013-06-161-0/+4
| | | | llvm-svn: 184055
* Convert another use of sys::identifyFileType.Rafael Espindola2013-06-111-6/+6
| | | | | | No functionality change. llvm-svn: 183762
* Use the StringRef version of identifyFileType.Rafael Espindola2013-06-101-2/+1
| | | | llvm-svn: 183670
* Use new version of countLeadingZeros.Michael J. Spencer2013-05-251-1/+1
| | | | llvm-svn: 182697
* Revert "Correctly pass ownership of MemoryBuffers."Michael J. Spencer2013-04-051-6/+5
| | | | llvm-svn: 178918
* Correctly pass ownership of MemoryBuffers.Michael J. Spencer2013-04-051-5/+6
| | | | llvm-svn: 178914
* This is my Driver refactoring patch. Nick Kledzik2013-04-041-9/+8
| | | | | | | | | | | | | | | | | | | | | | | The major changes are: 1) LinkerOptions has been merged into TargetInfo 2) LinkerInvocation has been merged into Driver 3) Drivers no longer convert arguments into an intermediate (core) argument list, but instead create a TargetInfo object and call setter methods on it. This is only how in-process linking would work. That is, you can programmatically set up a TargetInfo object which controls the linking. 4) Lots of tweaks to test suite to work with driver changes 5) Add the DarwinDriver 6) I heavily doxygen commented TargetInfo.h Things to do after this patch is committed: a) Consider renaming TargetInfo, given its new roll. b) Consider pulling the list of input files out of TargetInfo. This will enable in-process clients to create one TargetInfo the re-use it with different input file lists. c) Work out a way for Drivers to format the warnings and error done in core linking. llvm-svn: 178776
* [ELF] Add support for reading dynamic libraries.Michael J. Spencer2013-02-111-60/+40
| | | | llvm-svn: 174916
* [ELF] Use LLVM_IS_UNALIGNED_ACCESS_FAST.Michael J. Spencer2013-02-031-4/+16
| | | | llvm-svn: 174276
* [ELF] Chop the ELF prefix off of most things.Michael J. Spencer2013-01-291-0/+146
llvm-svn: 173838
OpenPOWER on IntegriCloud