summaryrefslogtreecommitdiffstats
path: root/lld/lib/ReaderWriter/Native
Commit message (Collapse)AuthorAgeFilesLines
...
* Update for LLVM api change.Rafael Espindola2014-02-241-1/+1
| | | | llvm-svn: 202054
* Restore vertical alignment lost by clang-formatNick Kledzik2013-12-202-11/+11
| | | | llvm-svn: 197834
* Run clang-format on r197727.Rui Ueyama2013-12-202-33/+27
| | | | llvm-svn: 197788
* [lld] Introduce registry and Reference kind tupleNick Kledzik2013-12-193-32/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 a variety of typos in function names and commentsAlp Toker2013-12-011-3/+3
| | | | | | No change in functionality. llvm-svn: 196053
* Use NativeReferenceIvarsV2 if necessary.Rui Ueyama2013-11-203-69/+193
| | | | | | | | | | | | | | | | | | | | NativeReferenceIvarsV1 cannot handle more than 65535 relocation targets because its field to point to the target table is of type uint16_t. Because of that limitation, the LLD couldn't link a file containing more than 65535 relocations. 65535 is not a big number - the LLD couldn't even link itself with V1. This patch solves the issue by adding NativeReferenceIvarsV2 support. The new structure has more bits for the target table, so it can handle a large number of relocatinos. V2 structure is larger than V1. In order to prevent file bloating, V2 format is used only when the resulting file cannot be represented in V1 format. The writer and the reader support both V1 and V2 formats. Differential Revision: http://llvm-reviews.chandlerc.com/D2217 llvm-svn: 195270
* Use UINT16_MAX instead of 0xFFFF.Rui Ueyama2013-11-191-1/+3
| | | | llvm-svn: 195096
* Replace unnecessary vector copy with reference.Rui Ueyama2013-11-181-1/+1
| | | | llvm-svn: 194988
* Add an assert for NativeReferenceIvarsV1.Rui Ueyama2013-11-181-0/+2
| | | | | | | | | | | | | | The maximum number of references the file with NativeReferenceIvarsV1 can contain is 65534. If a file larger than that is converted to Native format, the conversion will fail without any error message. This caused a subtle bug that the LLD would produce a broken executable only when input files contain too many references. This issue exists since the RoundTripNativeTest is introduced in r193585. Since then, it seems that nobody have linked any program having more than 65534 relocations with the LLD. Otherwise we would have found it earlier. llvm-svn: 194987
* Move the entire debug print loop into DEBUG_WITH_TYPE.Rui Ueyama2013-11-161-18/+13
| | | | | | No functionality change. llvm-svn: 194914
* Replace one more magic number with sizeof().Rui Ueyama2013-11-161-1/+2
| | | | llvm-svn: 194913
* Use early continue.Rui Ueyama2013-11-161-27/+23
| | | | llvm-svn: 194911
* Simplify. No functionality change.Rui Ueyama2013-11-161-7/+3
| | | | llvm-svn: 194909
* Replace duplicate code with calls to getOrPushAttribute().Rui Ueyama2013-11-161-24/+20
| | | | llvm-svn: 194908
* Use range-based for loop.Rui Ueyama2013-11-151-21/+15
| | | | | | end() was evaluated every time through a loop. This patch eliminates it. llvm-svn: 194894
* Use llvm_unreachable() instead of assert() at where control should never get.Rui Ueyama2013-11-151-2/+1
| | | | llvm-svn: 194890
* Duplicate code removal.Rui Ueyama2013-11-151-70/+37
| | | | llvm-svn: 194887
* Replace magic number with sizeof(). No functionality change.Rui Ueyama2013-11-151-1/+2
| | | | llvm-svn: 194877
* Remove duplicate code.Rui Ueyama2013-11-151-57/+23
| | | | llvm-svn: 194866
* Fix include guards.Rui Ueyama2013-11-151-3/+3
| | | | llvm-svn: 194776
* Add explictly exported atoms and export R_*_COPY'ed atoms.Michael J. Spencer2013-11-083-0/+6
| | | | llvm-svn: 194278
* Remove unnecessary namespace qualifier.Rui Ueyama2013-11-051-2/+2
| | | | llvm-svn: 194037
* [ELF] Fix typo in the expression calculates an absolute atom offset.Simon Atanasyan2013-11-041-1/+1
| | | | | | Patch reviewed by Shankar Easwaran. llvm-svn: 194010
* [Native] Fix fallback atoms when writing to Native file.Shankar Easwaran2013-10-181-0/+3
| | | | | | | | There is no test as currently there is no call to the NativeWriter. Future commits will add calls to the NativeWriter. llvm-svn: 192944
* Update error classes from all lowercase to camel case.Rui Ueyama2013-10-091-29/+29
| | | | llvm-svn: 192261
* [lld][InputGraph] Change the Resolver to use inputGraphShankar Easwaran2013-10-071-14/+13
| | | | | | | | | | | | 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
* [Core] Add type and size to SharedLibraryAtom.Michael J. Spencer2013-09-263-0/+12
| | | | llvm-svn: 191466
* Add a fallback mechanism for undefined atom.Rui Ueyama2013-09-122-3/+12
| | | | | | | | | | | | | | | | | In COFF, an undefined symbol can have up to one alternative name. If a symbol is resolved by its regular name, then it's linked normally. If a symbol is not found in any input files, all references to the regular name are resolved using the alternative name. If the alternative name is not found, it's a link error. This mechanism is called "weak externals". To support this mechanism, I added a new member function fallback() to undefined atom. If an undefined atom has the second name, fallback() returns a new undefined atom that should be used instead of the original one to resolve undefines. If it does not have the second name, the function returns nullptr. Differential Revision: http://llvm-reviews.chandlerc.com/D1550 llvm-svn: 190625
* Change the parseFile argument from MemoryBuffer pointer to LinkerInputJoerg Sonnenberger2013-09-071-7/+8
| | | | | | reference. Move readFile logic into FileNode::createLinkerInput. llvm-svn: 190253
* [lld] handle typeZeroFill atoms in ELF/Native/YAMLShankar Easwaran2013-08-232-5/+3
| | | | | | | | | | | | | 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
* Rename TargetInfo -> LinkingContext.Rui Ueyama2013-08-062-20/+20
| | | | | | | | | Also change some local variable names: "ti" -> "context" and "_targetInfo" -> "_context". Differential Revision: http://llvm-reviews.chandlerc.com/D1301 llvm-svn: 187823
* Update for llvm API change.Rafael Espindola2013-07-161-1/+1
| | | | llvm-svn: 186450
* Removed unnecessary "class" keyword.Rui Ueyama2013-06-212-18/+18
| | | | llvm-svn: 184589
* [ARM] Remove isThumb() as it's not used and it's not in the right place.Rui Ueyama2013-06-132-5/+0
| | | | | | | | | | | | | | Architecture specific code should reside in architecture specific directory not in Atom. Looks like there are no efforts being made at this moment to support ARM, so let's remove it for now. Reviewers: Bigcheese CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D959 llvm-svn: 183877
* [lld][ELF] (no testable functionality change) resize the number of entries ↵Shankar Easwaran2013-04-291-2/+3
| | | | | | in the string table for static linking llvm-svn: 180692
* Revert "Correctly pass ownership of MemoryBuffers."Michael J. Spencer2013-04-051-3/+3
| | | | llvm-svn: 178918
* Correctly pass ownership of MemoryBuffers.Michael J. Spencer2013-04-051-3/+3
| | | | llvm-svn: 178914
* This is my Driver refactoring patch. Nick Kledzik2013-04-041-2/+2
| | | | | | | | | | | | | | | | | | | | | | | 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
* Devirtualize Reference::kind.Michael J. Spencer2013-03-201-13/+4
| | | | | | Improves performance. llvm-svn: 177556
* Devirtualize File::kind.Michael J. Spencer2013-03-201-1/+1
| | | | | | This is the standard way of implementing LLVM RTTI. llvm-svn: 177555
* [lld] remove trailing whitespaceShankar Easwaran2013-03-142-22/+22
| | | | llvm-svn: 177079
* [ELF][Hexagon]add typeZeroFillFastShankar Easwaran2013-02-242-2/+4
| | | | llvm-svn: 175983
* Use proper delete.Michael J. Spencer2013-01-261-1/+1
| | | | llvm-svn: 173570
* add elf targethandlerShankar Easwaran2013-01-251-40/+34
| | | | llvm-svn: 173430
* Add SectionPosition and OrderPassNick Kledzik2013-01-233-3/+10
| | | | llvm-svn: 173300
* Move everything over to TargetInfo.Michael J. Spencer2013-01-232-42/+15
| | | | | | | | I really would have liked to split this patch up, but it would greatly complicate the lld-core and lld drivers having to deal with both {Reader,Writer}Option and TargetInfo. llvm-svn: 173217
* Factor File::addAtom out to MutableFile::addAtom.Michael J. Spencer2013-01-121-4/+0
| | | | | | This removes a bunch of llvm_unreachables and makes a File's mutability part of the type system. llvm-svn: 172297
* Add library dependencies to the lld cmake build.Benjamin Kramer2012-12-041-0/+4
| | | | llvm-svn: 169306
* This update does the following:Sid Manning2012-10-183-8/+75
| | | | | | | | | | | * Moves enum Scope from DefinedAtom.h to Atom.h * Adds scope method to AbsoluteAtom class * Updates YAML to print scope of AbsoluteAtoms * Update Native Reader/Writer to handle this new, "attribute" * Adds testcase Reviewed and approved by Nick Kledzik llvm-svn: 166189
* Fix warnings.Michael J. Spencer2012-09-102-8/+2
| | | | llvm-svn: 163573
OpenPOWER on IntegriCloud