summaryrefslogtreecommitdiffstats
path: root/lld/lib/ReaderWriter/ELF
Commit message (Collapse)AuthorAgeFilesLines
...
* [lld] fix unused variable warningsNick Kledzik2013-12-195-12/+4
| | | | llvm-svn: 197737
* [lld] fix build when LLVM_HAS_VARIADIC_TEMPLATES is falseNick Kledzik2013-12-191-0/+9
| | | | llvm-svn: 197734
* [lld] Introduce registry and Reference kind tupleNick Kledzik2013-12-1934-621/+668
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* [Mips] Explicitly cast ulittle32_t to the uint32_t to fix Visual StudioSimon Atanasyan2013-12-151-1/+1
| | | | | | compile error. llvm-svn: 197344
* Linking of shared libraries for MIPS little-endian 32-bit target.Simon Atanasyan2013-12-1516-20/+917
| | | | | | | | | | | | | | | | | | | | | The following are the most significant peculiarities of MIPS target: - MIPS ABI requires some special tags in the dynamic table. - GOT consists of two parts local and global. The local part contains entries refer locally visible symbols. The global part contains entries refer global symbols. - Entries in the .dynsym section which have corresponded entries in the GOT should be: * Emitted at the end of .dynsym section * Sorted accordingly to theirs GOT counterparts - There are "paired" relocations. One or more R_MIPS_HI16 and R_MIPS_GOT16 relocations should be followed by R_MIPS_LO16 relocation. To calculate result of R_MIPS_HI16 and R_MIPS_GOT16 relocations we need to combine addends from these relocations and paired R_MIPS_LO16 relocation. The patch reviewed by Michael Spencer, Shankar Easwaran, Rui Ueyama. http://llvm-reviews.chandlerc.com/D2156 llvm-svn: 197342
* Make anonymous namespace as small as possible.Rui Ueyama2013-12-105-48/+41
| | | | | | Use of static is recommended by the style guide. llvm-svn: 196877
* Revert "Remove makeArrayRef() calls."Rui Ueyama2013-12-102-8/+11
| | | | | | | This reverts commit r196475 because it made the build to fail with GCC 4.7/4.8/4.9. Reported by Mikael Lyngvig. llvm-svn: 196853
* Remove makeArrayRef() calls.Rui Ueyama2013-12-052-11/+8
| | | | | | | Because ArrayRef has implicit conversion from C arrays, we don't need makeArrayRef. llvm-svn: 196475
* Use makeArrayRef to construct ArrayRefs from C arrays.Rui Ueyama2013-12-052-8/+11
| | | | llvm-svn: 196465
* Fix "doesnot", "endsup" typos and "lets" grammar issuesAlp Toker2013-12-025-13/+13
| | | | llvm-svn: 196056
* Fix "don't" typos missed in previous commitAlp Toker2013-12-015-11/+11
| | | | llvm-svn: 196054
* Fix a variety of typos in function names and commentsAlp Toker2013-12-014-11/+11
| | | | | | No change in functionality. llvm-svn: 196053
* [Gnu] Set the defaults in the ELFLinkingContext.Shankar Easwaran2013-11-251-1/+1
| | | | | | Comment from Rui Ueyema. llvm-svn: 195598
* [Gnu] -L paths is not positional.Shankar Easwaran2013-11-251-3/+2
| | | | | | | Looks like -L paths are not positional. They need to be added to a list of search paths and those needs to be searched when lld looks for a library. llvm-svn: 195594
* [InputGraph][Gnu] Add LinkerScript support.Shankar Easwaran2013-11-241-2/+0
| | | | | | | | | | | | | | | | This adds LinkerScript support by creating a type Script which is of type FileNode in the InputGraph. Once the LinkerScript Parser converts the LinkerScript into a sequence of command, the commands are handled by the equivalent LinkerScript node for the current Flavor/Target. For ELF, a ELFGNULdScript gets created which converts the commands to ELF nodes and ELF control nodes(ELFGroup for handling Group nodes). Since the Inputfile type has to be determined in the Driver, the Driver needs to determine the complete path of the file that needs to be processed by the Linker. Due to this, few tests have been removed since the Driver uses paths that doesnot exist. llvm-svn: 195583
* Fix include guards.Rui Ueyama2013-11-1514-34/+34
| | | | llvm-svn: 194776
* Re-submit r194551: Use empty() instead of size() == 0.Rui Ueyama2013-11-131-2/+1
| | | | llvm-svn: 194556
* Revert "Use empty() instead of size() == 0."Rui Ueyama2013-11-131-1/+1
| | | | | | This reverts commit r194551 because it broke the buildbot. llvm-svn: 194552
* Use empty() instead of size() == 0.Rui Ueyama2013-11-131-1/+1
| | | | llvm-svn: 194551
* Delete unused constructor.Rui Ueyama2013-11-111-1/+0
| | | | llvm-svn: 194364
* [ELF] Un-break undef-from-main-dso.test on MSVC 2012.Rui Ueyama2013-11-101-2/+2
| | | | | | | | | | | | | | | | The result of sizeof(SymbolTable<ELFT>::SymbolEntry) in DynamicSymbolTable <ELFT>::write() was different from the same expression in RelocationTable <ELFT>::write(), although the same template parameters were passed. They were 40 and 32, respectively. As a result, the same vector was treated as a vector of 40 byte values in some places and a vector of 32 values in other places. That caused an weird issue, resulting in collapse of the rela.dyn section. I suspect that this is a padding size calculation bug in MSVC 2012, but I may be wrong. Reordering the fields to eliminate padding seems to fix the issue. llvm-svn: 194349
* Add explictly exported atoms and export R_*_COPY'ed atoms.Michael J. Spencer2013-11-082-0/+10
| | | | llvm-svn: 194278
* Remove unnecessary namespace qualifier.Rui Ueyama2013-11-056-13/+13
| | | | llvm-svn: 194037
* Replace ErrorOr<void> with error_code.Rafael Espindola2013-11-0512-32/+32
| | | | | | It was never transporting any value in addition to the error_code. llvm-svn: 194028
* [ELF] Simplify SectionTable::getSymbolTableIndex. No functionality change.Rui Ueyama2013-11-041-7/+4
| | | | | | | MSVC 2012 raises an error in the lambda passed to vector::find_if, while it seems valid code. Rewrote without high-order functions. llvm-svn: 193975
* Remove duplicate calls of pm.add() for RoundTrip tests.Rui Ueyama2013-11-011-4/+0
| | | | llvm-svn: 193885
* [ELF] Implement minimal support for .eh_frame_hdr.Michael J. Spencer2013-10-303-1/+60
| | | | llvm-svn: 193662
* [PassManager] add ReaderWriter{Native,YAML} to the Driver.Shankar Easwaran2013-10-299-26/+32
| | | | | | | | | | | | | Enable this for the following flavors a) core b) gnu c) darwin Its disabled for the flavor PECOFF. Convenient markers are added with FIXME comments in the Driver that would be removed and code removed from each flavor. llvm-svn: 193585
* [X86_64] Fix the atom that need to be exported.Shankar Easwaran2013-10-261-1/+2
| | | | llvm-svn: 193481
* [X86] Add more relocation types.Shankar Easwaran2013-10-261-3/+6
| | | | llvm-svn: 193480
* [ELF] Implement .{init,fini}_array ordering.Michael J. Spencer2013-10-256-0/+86
| | | | llvm-svn: 193451
* Put missing license header.Rui Ueyama2013-10-252-0/+18
| | | | llvm-svn: 193435
* [ELF] Refactor x86-64 relocation pass.Michael J. Spencer2013-10-245-441/+501
| | | | | | | This renames the GOTPLTPass to RelocationPass and refactors it to better represent the different types of relocations. llvm-svn: 193379
* [ELF][x86-64] Generate PLT for R_*_32S relocs.Michael J. Spencer2013-10-241-1/+4
| | | | llvm-svn: 193369
* Revert "r193300 - [PassManager] add ReaderWriter{Native, YAML} to the Driver"Rui Ueyama2013-10-242-16/+16
| | | | | | | The patch have completely broken COFF port and disabled many tests. This also reverts r193302 (comment fix). llvm-svn: 193362
* [PassManager] add ReaderWriter{Native,YAML} to the Driver.Shankar Easwaran2013-10-242-16/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Disable tests to be run with REQUIRES: disable. Note disable is not added to the config by the test runner Mkaefiles, so essentially disables the test. Code changes would be required to fix these tests :- test/darwin/hello-world.objtxt test/elf/check.test test/elf/phdr.test test/elf/ppc.test test/elf/undef-from-main-dso.test test/elf/X86_64/note-sections-ro_plus_rw.test test/pecoff/alignment.test test/pecoff/base-reloc.test test/pecoff/bss-section.test test/pecoff/drectve.test test/pecoff/dynamic.test test/pecoff/dynamicbase.test test/pecoff/entry.test test/pecoff/hello.test test/pecoff/imagebase.test test/pecoff/importlib.test test/pecoff/lib.test test/pecoff/multi.test test/pecoff/reloc.test test/pecoff/weak-external.test llvm-svn: 193300
* [ELF] Set ordinals properly to all atoms.Shankar Easwaran2013-10-182-6/+6
| | | | 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
* [ELF] Initial design to handle Linker scripts for ELF.Shankar Easwaran2013-10-103-3/+14
| | | | llvm-svn: 192369
* [ELF] Change MaxAlignment to 2.Shankar Easwaran2013-10-098-8/+7
| | | | llvm-svn: 192310
* [Layout] Dont set ordinals to Files by default.Shankar Easwaran2013-10-093-8/+12
| | | | | | | | | | | | | This change removes code in various places which was setting the File Ordinals. This is because the file ordinals are assigned by the way files are resolved. There was no other way than making the getNextFileAndOrdinal be set const and change the _nextOrdinal to mutable. There are so many places in code, that you would need to cleanup to make LinkingContext non-const! llvm-svn: 192280
* Update error classes from all lowercase to camel case.Rui Ueyama2013-10-094-8/+8
| | | | llvm-svn: 192261
* [LinkingContext] make LinkingContext non-constShankar Easwaran2013-10-081-1/+1
| | | | llvm-svn: 192183
* [lld][InputGraph] Change the Resolver to use inputGraphShankar Easwaran2013-10-0717-110/+90
| | | | | | | | | | | | 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
* [ELF] Handle copy relocations for PC32.Michael J. Spencer2013-09-271-1/+4
| | | | | | | | This will eventually need to be refactored to better handle COPY relocations, as other relocations can also generate them. I'm not yet sure the exact circumstances in which they are needed yet. llvm-svn: 191567
* [ELF] Mark STT_GNU_IFUNC symbols as code.Michael J. Spencer2013-09-271-0/+1
| | | | llvm-svn: 191566
* [ELF] Add COPY relocations.Michael J. Spencer2013-09-264-4/+86
| | | | llvm-svn: 191467
* [Core] Add type and size to SharedLibraryAtom.Michael J. Spencer2013-09-261-0/+15
| | | | llvm-svn: 191466
* [ELF] Fix use after free.Michael J. Spencer2013-09-251-15/+16
| | | | llvm-svn: 191403
OpenPOWER on IntegriCloud