summaryrefslogtreecommitdiffstats
path: root/lld/lib/ReaderWriter/ELF/File.h
Commit message (Collapse)AuthorAgeFilesLines
* [ELF] Rename File.h to ELFFile.h to avoid confusion.Shankar Easwaran2014-01-261-831/+0
| | | | | | No change in functionality. llvm-svn: 200166
* Use getError instead of the error_code operator.Rafael Espindola2014-01-081-16/+16
| | | | llvm-svn: 198797
* Run clang-format on r197727.Rui Ueyama2013-12-201-29/+27
| | | | llvm-svn: 197788
* [lld] Introduce registry and Reference kind tupleNick Kledzik2013-12-191-38/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Fix a variety of typos in function names and commentsAlp Toker2013-12-011-2/+2
| | | | | | No change in functionality. llvm-svn: 196053
* Remove unnecessary namespace qualifier.Rui Ueyama2013-11-051-1/+1
| | | | llvm-svn: 194037
* Replace ErrorOr<void> with error_code.Rafael Espindola2013-11-051-8/+8
| | | | | | It was never transporting any value in addition to the error_code. llvm-svn: 194028
* [ELF] Set ordinals properly to all atoms.Shankar Easwaran2013-10-181-1/+3
| | | | llvm-svn: 192939
* [ELF] Fix Atoms in the same file had overlapping ordinals.Shankar Easwaran2013-10-111-2/+1
| | | | | | | This also reverts the LayoutPass to use std::sort as all files have an ordinal now. llvm-svn: 192409
* [lld][InputGraph] Change the Resolver to use inputGraphShankar Easwaran2013-10-071-1/+1
| | | | | | | | | | | | 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
* [ELF] Fix uninitalized value.Michael J. Spencer2013-10-031-0/+2
| | | | llvm-svn: 191924
* [lld][ELF] Handle multiple weak symbolsShankar Easwaran2013-09-131-7/+6
| | | | | | | | | | | | This handles multiple weak symbols which appear back to back. This fix is needed which otherwise will lead to symbols getting initialized to arbitrary values. There was a constructor/destructor test that really triggered this to be fixed on X86_64. Adds a test. llvm-svn: 190658
* [lld] Remove bitfield for boolean membersShankar Easwaran2013-09-031-1/+1
| | | | llvm-svn: 189876
* [lld][LinkingContext] Atoms created from command line options should be ↵Shankar Easwaran2013-08-311-0/+73
| | | | | | | | | | | | available in YAML This adds an API to the LinkingContext for flavors to add Internal files containing atoms that need to appear in the YAML output as well, when -emit-yaml switch is used. Flavors can add more internal files for other options that are needed. llvm-svn: 189718
* [lld][ELF] process fini_array sectionsShankar Easwaran2013-08-251-1/+3
| | | | | | | | This change processes fini_array section in addition to processing init_array sections. This also makes functions registered at compile time for initialization and finalization to be run during execution llvm-svn: 189196
* [lld][ELF] Dont ignore zero sized sections.Shankar Easwaran2013-08-231-3/+1
| | | | | | | | There may be relocations that may be pointing to the section even if the section sizes are 0. We shouldnot ignore them for that regard. llvm-svn: 189139
* [lld][ELF][Cleanup] Section associated with the relocation traversedShankar Easwaran2013-08-231-10/+6
| | | | | | | There is no change in functionality, this uses the defined way to access the relocation section that belongs to a particular section. llvm-svn: 189138
* [lld] handle typeZeroFill atoms in ELF/Native/YAMLShankar Easwaran2013-08-231-2/+5
| | | | | | | | | | | | | BSS atoms dont take any file space in the Input file. They are associated with a contentType(typeZeroFill). Similiar zero fill types also exist which have the same meaning in terms of occupying file space in the Input. These atoms have to be handled seperately when writing to the lld's intermediate file or the lld test infrastructure. Also adds a test. llvm-svn: 189136
* Update to llvm changes.Michael J. Spencer2013-08-081-129/+130
| | | | llvm-svn: 188021
* Rename TargetInfo -> LinkingContext.Rui Ueyama2013-08-061-12/+15
| | | | | | | | | Also change some local variable names: "ti" -> "context" and "_targetInfo" -> "_context". Differential Revision: http://llvm-reviews.chandlerc.com/D1301 llvm-svn: 187823
* Fix typo in comment. Found by -Wdocumentation.Benjamin Kramer2013-06-161-2/+2
| | | | llvm-svn: 184058
* [ELF] Remove unused parameter from ELFReference c'tor.Rui Ueyama2013-06-121-2/+2
| | | | | | | | | | Reviewers: shankarke CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D961 llvm-svn: 183850
* [ELF] Refactor File.h.Rui Ueyama2013-06-101-211/+217
| | | | | | | | | | | | | | | - Split createAtom() in lib/ReaderWriter/ELF/File.h into small methods. - Added comments to code in other methods. No functionality changes. Reviewers: shankarke CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D921 llvm-svn: 183696
* Fix handling of files without a symbol table.Rafael Espindola2013-06-071-1/+5
| | | | | | | | This fixes a recent regression (r183338). Stripped elf files (like installed crtn.o for example), are not required to have a symbol table. Handle that correctly. llvm-svn: 183573
* Update for llvm's r183337.Rafael Espindola2013-06-051-1/+1
| | | | llvm-svn: 183338
* [ELF][Reader] Kind in this context refers to File::Kind. Qualify with ↵Michael J. Spencer2013-05-281-2/+2
| | | | | | Reference::Kind. llvm-svn: 182787
* [lld][ELF] set ordinals for mergeAtoms and fix testcaseShankar Easwaran2013-05-101-6/+7
| | | | llvm-svn: 181622
* [lld][ELF] fix build failureShankar Easwaran2013-05-071-1/+0
| | | | llvm-svn: 181325
* [lld][ELF] split ELF reader into multiple functions for readability (no ↵Shankar Easwaran2013-05-071-114/+190
| | | | | | change in functionality) llvm-svn: 181288
* [lld][ELF] reduce the number of symbols emitted in the symbol tableShankar Easwaran2013-05-011-6/+6
| | | | llvm-svn: 180872
* [lld][ELF] continue on finding a section with no symbols, tests already presentShankar Easwaran2013-04-301-0/+1
| | | | llvm-svn: 180769
* [ELF] fix atom orderShankar Easwaran2013-04-041-5/+12
| | | | llvm-svn: 178815
* This is my Driver refactoring patch. Nick Kledzik2013-04-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | 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
* Update for API change for handling mips64el.Rafael Espindola2013-04-031-2/+10
| | | | llvm-svn: 178695
* [ELF] Cache contentType and permissions.Michael J. Spencer2013-03-281-1/+4
| | | | llvm-svn: 178269
* [ELF][Reader][Perf] Only do loookup once.Michael J. Spencer2013-03-201-2/+3
| | | | llvm-svn: 177563
* [ELF][Reader] Refactor how relocations are read. Improves performance.Michael J. Spencer2013-03-201-20/+23
| | | | | | | | This changes from reading each relocation individually for each section to just storing the range of relocations. It also counts the relocations to preallocate the _references array. llvm-svn: 177562
* Devirtualize File::kind.Michael J. Spencer2013-03-201-3/+2
| | | | | | This is the standard way of implementing LLVM RTTI. llvm-svn: 177555
* Set ordinals correctly.Michael J. Spencer2013-03-201-3/+0
| | | | | | | This actually doesn't change behavior with the current LinkerInvocation, but it's needed when you make reading parallel. llvm-svn: 177554
* [lld] remove trailing whitespaceShankar Easwaran2013-03-141-12/+12
| | | | llvm-svn: 177079
* [ELF][Writer] Let std::vector handle allocating space instead of reserving ↵Michael J. Spencer2013-03-131-6/+0
| | | | | | tiny portions. llvm-svn: 176916
* [ELF] Order weak symbols properlyShankar Easwaran2013-03-061-19/+59
| | | | llvm-svn: 176583
* add changes for typeDataFastShankar Easwaran2013-02-221-8/+6
| | | | llvm-svn: 175901
* functionality to handle global atoms in Merge sectionsShankar Easwaran2013-02-201-14/+27
| | | | llvm-svn: 175636
* fix the mergeable string atom, when the target points to a symbol which is ↵Shankar Easwaran2013-02-131-6/+13
| | | | | | at a relative offset from the start of the .rodata section llvm-svn: 175039
* add merge strings option, this temporarily fixes the problem bringing up ↵Shankar Easwaran2013-02-131-15/+21
| | | | | | helloworld with glibc on x86_64 llvm-svn: 175038
* add support for merging common stringsShankar Easwaran2013-02-121-10/+171
| | | | llvm-svn: 174990
* [ELF] Add support for reading dynamic libraries.Michael J. Spencer2013-02-111-10/+0
| | | | llvm-svn: 174916
* add changes for layoutafter/layoutbefore/ingroup/layoutpass and test casesShankar Easwaran2013-02-071-2/+35
| | | | llvm-svn: 174658
OpenPOWER on IntegriCloud