summaryrefslogtreecommitdiffstats
path: root/lld/lib/ReaderWriter
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove empty constructors.Rui Ueyama2015-03-275-19/+8
| | | | llvm-svn: 233423
* Fix formatting.Rui Ueyama2015-03-273-11/+4
| | | | llvm-svn: 233418
* Remove dead code.Rui Ueyama2015-03-271-28/+0
| | | | | | | I actually spend my time to understand this piece of code and then realized that this is all dead. llvm-svn: 233417
* ELF: Add override.Rui Ueyama2015-03-273-28/+23
| | | | | | | Some virtual member functions in ELF directory don't have virtual type specifier. Add override to them. llvm-svn: 233406
* ELF: Remove blank doPreFlight and finalize member functions.Rui Ueyama2015-03-274-12/+2
| | | | | | Make these functions non-pure and define the default implementations. llvm-svn: 233405
* Fix formatting.Rui Ueyama2015-03-271-18/+28
| | | | llvm-svn: 233402
* Rename all caps class names.Rui Ueyama2015-03-276-14/+14
| | | | | | | We have GOTAtom and PLTAtom classes because GOT or PLT are acronyms. "Dynamic offset table" or "dynamic" are not acronyms. llvm-svn: 233401
* Remove this->.Rui Ueyama2015-03-271-9/+7
| | | | llvm-svn: 233400
* [ARM] Handle GOT relocationsDenis Protivensky2015-03-273-9/+108
| | | | | | | | | | This includes relocs needed to link against glibc: R_ARM_BASE_PREL R_ARM_GOT_BREL Every reloc is accompanied with a test case. llvm-svn: 233383
* [ARM] Simplify IFUNC code by removing useless handlerDenis Protivensky2015-03-271-12/+1
| | | | llvm-svn: 233374
* [ARM] Add more IFUNC handlersDenis Protivensky2015-03-271-0/+3
| | | | llvm-svn: 233372
* Rename ELFLinkingContext instances "ctx" intead of "context".Rui Ueyama2015-03-2737-297/+272
| | | | llvm-svn: 233344
* Use llvm::make_unique.Rui Ueyama2015-03-268-31/+28
| | | | llvm-svn: 233319
* Remove duplicate code and empty classes.Rui Ueyama2015-03-2613-121/+26
| | | | llvm-svn: 233316
* Remove Makefiles.Rui Ueyama2015-03-2613-200/+0
| | | | | | | | Most developers prefer to not have them, and we agreed to remove them from LLD. http://lists.cs.uiuc.edu/pipermail/llvmdev/2015-March/083368.html llvm-svn: 233313
* [ARM] Implementation of PLT: handling of IFUNC calls (gnu_indirect_function)Leny Kholodov2015-03-265-4/+221
| | | | | | | | | | This diff includes implementation of linking calls to ifunc functions. It provides ifunc entries in PLT and corresponding relocations (R_ARM_ALU_PC_G0_NC, R_ARM_ALU_PC_G1_NC, R_ARM_LDR_PC_G2 for link-time and R_ARM_IRELATIVE for run-time). Differential Revision: http://reviews.llvm.org/D7833 llvm-svn: 233277
* Revert blank line after test commitLeny Kholodov2015-03-261-1/+0
| | | | llvm-svn: 233268
* Commit access verification: blank line has been addedLeny Kholodov2015-03-261-0/+1
| | | | llvm-svn: 233267
* [ARM] Handle mapping symbolsDenis Protivensky2015-03-268-16/+82
| | | | | | | | | | | Mapping symbols should have their own code models, and in some places must be treated in a specific way. Make $t denote Thumb code, and $a and $d denote ARM code. Set size, binding and type of mapping symbols to what the specification says. Differential Revision: http://reviews.llvm.org/D8601 llvm-svn: 233259
* Rename align2 -> align.Rui Ueyama2015-03-262-8/+8
| | | | | | I believe "2" stands for log2. Just "align" would be appropriate now. llvm-svn: 233248
* Store non-log2 values to Native files.Rui Ueyama2015-03-263-3/+3
| | | | llvm-svn: 233247
* Use arithmetic type to represent alignments (not in log2) everywhere.Rui Ueyama2015-03-264-28/+9
| | | | | | | This is the final step of conversion. Now log2 numbers are removed from everywhere! llvm-svn: 233246
* Use alignment values everywhere instead of log2.Rui Ueyama2015-03-2626-89/+72
| | | | | | | | This patch defines implicit conversion between integers and PowerOf2 instances, so uses of the classes is now implicit and look like regular integers. Now we are ready to remove the scaffolding. llvm-svn: 233245
* Define an implicit constructor which takes actual alignment value to PowerOf2.Rui Ueyama2015-03-265-8/+8
| | | | | | | The new constructor's type is the same, but this one takes not a log2 value but an alignment value itself, so the meaning is totally differnet. llvm-svn: 233244
* Make PowerOf2's constructor private.Rui Ueyama2015-03-265-8/+8
| | | | | | | Ban conversion from integers to PowerOf2 even if explicit to make all places we create PowerOf2 instances visible. llvm-svn: 233243
* Remove implicit constructor and operator int from PowerOf2.Rui Ueyama2015-03-2612-32/+41
| | | | | | | | | | This patch is to make instantiation and conversion to an integer explicit, so that we can mechanically replace all occurrences of the class with integer in the next step. Now get() returns an alignment value rather than its log2 value. llvm-svn: 233242
* Add a scaffolding to merge alignment representations.Rui Ueyama2015-03-262-7/+6
| | | | | | | | | | | | | | | | | We are using log2 values and values themselves to represent alignments. For example, alignment 8 is sometimes represented as 3 (8 == 2^3). We want to stop using log2 values. Because both types are regular arithmetic types, we cannot get help from a compiler to find places we mix two representations. That makes this merging work surprisingly hard because if I make a mistake, I'll just get wrong results at runtime (Yay types!). In this patch, I introduced a class to represents power-of-two values, which is basically an alias for an integer type. Once the migration is done, the class will be removed. llvm-svn: 233232
* YAML: Do not use 2^x notation to represent alignments.Rui Ueyama2015-03-251-11/+7
| | | | llvm-svn: 233222
* Inherit constructors. No functionality change.Rui Ueyama2015-03-252-16/+6
| | | | | | | We cannot use "using" to inherit constructors because the feature is not supported by MSVC 2013. llvm-svn: 233218
* [Mips] Factor out the code that extracts a relocation 'tag' intoSimon Atanasyan2015-03-251-2/+6
| | | | | | | | | the separate function That keeps "extracting" logic into the single place and removes a VC++ compilation warning. llvm-svn: 233186
* PECOFF: Reduce import table size.Rui Ueyama2015-03-241-6/+19
| | | | | | | | | | | | | Import Lookup Table in Import Directory Table has the same contents as Hint/Name Table. Symbol names imported from DLLs are pointed by both Import Directory Table and Hint/Name Table. We had duplicate strings there. This patch eliminates that duplication to make the table smaller. This should reduce binary size by the sum of lengths of imported symbols. llvm-svn: 233128
* [Mips] Suppress "right shift by too large amount" warningSimon Atanasyan2015-03-241-2/+2
| | | | | | | | | | | | | Visual C++ shows the "right shift by too large amount" warning if `MipsELFReference` is instantiated for 32-bit target and `Elf_Rel_Impl::getType` method has `unsigned char` return type. We can freely suppress the warning in that case because MIPS 32-bit ABI does not pack multiple relocation types into the single field `r_type` and the `MipsELFReference::_tag` should be always zero in that case. No functional changes. llvm-svn: 233088
* [Mips] Do not use inheriting constructor due build problem on WindowsSimon Atanasyan2015-03-241-1/+3
| | | | | | No functional changes. llvm-svn: 233058
* [Mips] Support MIPS N64 relocation record formatSimon Atanasyan2015-03-2411-62/+171
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | N64 ABI relocation record r_info field in fact consists of five subfields: * r_sym - symbol index * r_ssym - special symbol * r_type3 - third relocation type * r_type2 - second relocation type * r_type - first relocation type Up to three these relocations applied one by one. The first relocation uses an addendum from the relocation record. Each subsequent relocation takes as its addend the result of the previous operation. Only the final operation actually modifies the location relocated. The first relocation uses as a reference symbol specified by the `r_sym` field. The third relocation assumes NULL symbol. The patch represents these data using LLD model and takes in account additional relocation types during a relocation calculation. Additional relocations do not introduce any new relations between two atoms and just specify operations need to be done during a relocation calculation. The first relocation type (`r_type`) stored in the `Reference::_kindValue`. The rest of relocations and `r_ssym` value are stored in the new `Reference::_tag` field "as-is". I decided to do not "decode" these data on the core LLD level to prevent pollution of the core LLD model by very target specific data. Also I have to override writing of relocation records in the `RelocationTable` class to convert MIPS N64 ABI relocation information from the `Reference` class back to the ELF relocation record. http://reviews.llvm.org/D8533 llvm-svn: 233057
* [Mips] Fix typo in the error messageSimon Atanasyan2015-03-241-1/+1
| | | | llvm-svn: 233054
* [ELF/X86_64] Fix handling of R_X86_64_GOTTPOFF relocation.Davide Italiano2015-03-241-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | The aforementioned relocation generate a GOT entry with a R_X86_64_TPOFF64. The new relocation is processed at startup time by the loader. lld didn't generate the outstanding relocation, now it does. This bug was found while trying to link ls(1) on FreeBSD. Simplified repro: #include <stdio.h> #include <wchar.h> #include <wctype.h> int main(void) { wchar_t wc = 98; if (!iswprint(wc)) printf("blah\n"); else printf("foo\n"); return (0); } which incorrectly outputs "blah" when linked with lld before this patch. llvm-svn: 233051
* [ELF] Remove extraneous semicolon in DefaultLayoutRafael Auler2015-03-231-1/+1
| | | | llvm-svn: 232985
* Fix the CMake shared build.Benjamin Kramer2015-03-238-6/+18
| | | | | | | The ELF backends now depend on lld::script::Sema, which is in libReaderWriter. Link it explicitly. llvm-svn: 232953
* [ARM] Fix entry point for Thumb codeDenis Protivensky2015-03-231-0/+20
| | | | | | | Test cases for both entry functions in ARM and Thumb code are added. llvm-svn: 232942
* [ELF] Add missing override keywordSimon Atanasyan2015-03-231-16/+16
| | | | | | No functional changes. llvm-svn: 232938
* [Mips] Pass type of relocation and addendum to the `calculateRelocation`Simon Atanasyan2015-03-221-34/+40
| | | | | | | | | | | separately This change reduce difference between the trunk and upcoming patch and simplify the future code review. No functional changes. llvm-svn: 232919
* [Mips] Rename template argument ELFType => ELFTSimon Atanasyan2015-03-221-21/+17
| | | | | | No functional changes. llvm-svn: 232915
* [Mips] Use allocator from the base classSimon Atanasyan2015-03-221-3/+2
| | | | | | No functional changes. llvm-svn: 232914
* [ELF] GLOBAL_OFFSET_TABLE is a hidden symbolShankar Easwaran2015-03-202-2/+2
| | | | llvm-svn: 232868
* [ELF] Dont add local symbols for dynamic lookup.Shankar Easwaran2015-03-201-0/+5
| | | | | | | Unable to add a unit test for this, as there is only one local undefined symbol in regular shared libraries without a name. llvm-svn: 232867
* [ELF] OrderPass : Order atoms only by ordinals.Shankar Easwaran2015-03-203-38/+62
| | | | | | | | | | | | | | | | | | | | | | Move the init array/fini array sorting to the Output ELF writer. AFAIK, this is only needed by the X86_64/ARM ABI. This shaves time taken to self host lld by 0.2 seconds. Before patch ---------------- 4791.062059 task-clock # 1.634 CPUs utilized ( +- 0.28% ) 61,107 context-switches # 0.013 M/sec ( +- 0.56% ) 2.932902671 seconds time elapsed ( +- 0.84% ) After patch ------------- 4608.417248 task-clock # 1.669 CPUs utilized ( +- 0.30% ) 61,616 context-switches # 0.013 M/sec ( +- 0.63% ) 2.761012703 seconds time elapsed ( +- 0.63% ) llvm-svn: 232866
* [ELF][X86_64] Use anonymous namespace only for class declarationsShankar Easwaran2015-03-201-10/+10
| | | | llvm-svn: 232865
* [ELF] Use unordered_map for AdditionalSegmentsShankar Easwaran2015-03-201-3/+4
| | | | | | Fix a leftover class during implementation. llvm-svn: 232864
* [ELF] Use MapVector.Shankar Easwaran2015-03-201-1/+2
| | | | | | Order is still deterministic and we dont need a sorted order. llvm-svn: 232863
* [ELF][X86_64] Remove relative references to include filesShankar Easwaran2015-03-205-4/+8
| | | | llvm-svn: 232862
OpenPOWER on IntegriCloud