summaryrefslogtreecommitdiffstats
path: root/lld/lib/ReaderWriter/ELF/PPC
Commit message (Collapse)AuthorAgeFilesLines
* Remove PPC ELF targetGreg Fitzgerald2015-01-288-346/+0
| | | | | | Differential Revision: http://reviews.llvm.org/D7225 llvm-svn: 227320
* Fix the ELF shared library build targets - take 2Greg Fitzgerald2015-01-244-14/+17
| | | | | | | | | | lldELF is used by each ELF backend. lldELF's ELFLinkingContext also held a reference to each backend, creating a link-time cycle. This patch moves the backend references to lldDriver. Differential Revision: http://reviews.llvm.org/D7119 llvm-svn: 226976
* Revert " Fix the ELF shared library build targets"Greg Fitzgerald2015-01-234-8/+14
| | | | | | This reverts commit 6a3f545b44cea46321e025d9ab773786af86cb51. llvm-svn: 226928
* Fix the ELF shared library build targetsGreg Fitzgerald2015-01-234-14/+8
| | | | | | | | | | lldELF is used by each ELF backend. lldELF's ELFLinkingContext also held a reference to each backend, creating a link-time cycle. This patch moves the backend references to lldDriver. Differential Revision: http://reviews.llvm.org/D7119 llvm-svn: 226922
* add_lld_library -> add_llvm_libraryGreg Fitzgerald2015-01-211-7/+4
| | | | | | | | | | | * Works better for shared libraries (sets PRIVATE instead of INTERFACE) * Fixes http://llvm.org/bugs/show_bug.cgi?id=22269 * Also, use build-target names instead of component names Differential Revision: http://reviews.llvm.org/D7074 From: Greg Fitzgerald <garious@gmail.com> llvm-svn: 226702
* ELF: Support detection of relocation errors during processingWill Newton2015-01-202-5/+2
| | | | | | | | | | | At the moment errors in relocation processing such as out of range values are not detected or at best trapped by asserts which will not be present in release builds. This patch adds support for checking error return values from applyRelocation() calls and printing an appropriate error message. It also adds support for printing multiple errors rather than just the first one. llvm-svn: 226557
* Add LLVM_LINK_COMPONENTS for the shared object buildGreg Fitzgerald2015-01-161-0/+2
| | | | | | | Differential Revision: http://reviews.llvm.org/D7023 From: Greg Fitzgerald <garious@gmail.com> llvm-svn: 226346
* [ELF] Remove TargetHandler and DefaultTargetHandler constructorsSimon Atanasyan2015-01-161-1/+1
| | | | | | | These classes contain only abstract virtual functions. Explicit constructors are redundant. llvm-svn: 226265
* [ELF] Make `TargetRelocationHandler` a regular non-template classSimon Atanasyan2015-01-161-3/+2
| | | | | | | This class defines a relocation handler interface. The interface does not depend on the template argument so the argument is redundant. llvm-svn: 226259
* [PPC] Remove redundant `virtual` keywordSimon Atanasyan2015-01-161-3/+3
| | | | | | No functional changes. llvm-svn: 226258
* [PPC] Remove unused class field PPCTargetRelocationHandler::_ppcTargetLayoutSimon Atanasyan2015-01-162-9/+3
| | | | | | No functional changes. llvm-svn: 226257
* [cleanup] Re-sort #include lines using llvm/utils/sort_includes.pyChandler Carruth2015-01-141-1/+1
| | | | | | | | This is just a mechanical cleanup, no functionality changed. This just fixes very minor inconsistencies with how #include lines were spaced and sorted in LLD. llvm-svn: 225978
* Separate file parsing from File's constructors.Rui Ueyama2014-12-121-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a second patch for InputGraph cleanup. Sorry about the size of the patch, but what I did in this patch is basically moving code from constructor to a new method, parse(), so the amount of new code is small. This has no change in functionality. We've discussed the issue that we have too many classes to represent a concept of "file". We have File subclasses that represent files read from disk. In addition to that, we have bunch of InputElement subclasses (that are part of InputGraph) that represent command line arguments for input file names. InputElement is a wrapper for File. InputElement has parseFile method. The method instantiates a File. The File's constructor reads a file from disk and parses that. Because parseFile method is called from multiple worker threads, file parsing is processed in parallel. In other words, one reason why we needed the wrapper classes is because a File would start reading a file as soon as it is instantiated. So, the reason why we have too many classes here is at least partly because of the design flaw of File class. Just like threads in a good threading library, we need to separate instantiation from "start" method, so that we can instantiate File objects when we need them (which should be very fast because it involves only one mmap() and no real file IO) and use them directly instead of the wrapper classes. Later, we call parse() on each file in parallel to let them do actual file IO. In this design, we can eliminate a reason to have the wrapper classes. In order to minimize the size of the patch, I didn't go so far as to replace the wrapper classes with File classes. The wrapper classes are still there. In this patch, we call parse() immediately after instantiating a File, so this really has no change in functionality. Eventually the call of parse() should be moved to Driver::link(). That'll be done in another patch. llvm-svn: 224102
* ELF: Add a standard method for unknown relocation errorsWill Newton2014-12-092-10/+5
| | | | | | | | | | | | | | | | | | | At present each TargetRelocationHandler generates a pretty similar error string and calls llvm_unreachable() when encountering an unknown relocation. This is not ideal for two reasons: 1. llvm_unreachable disappears in release builds but we still want to know if we encountered a relocation we couldn't handle in release builds. 2. Duplication is bad - there is no need to have a per-architecture error message. This change adds a test for AArch64 to test whether or not the error message actually works. The other architectures have not been tested but they compile and check-lld passes. llvm-svn: 223782
* ELF: Use ELF reloc .def files to reduce duplicationWill Newton2014-12-051-53/+5
| | | | | | Tested with check-lld with no regressions. llvm-svn: 223462
* [ELF] Remove is64bits() and isLittlEndian().Shankar Easwaran2014-11-071-2/+0
| | | | | | | | | | ELFLinkingContext had these two functions, which is really not needed since the Writer uses a llvm::object template composed of Endianness, Alignment, Is32bit/64bit. We could just use that and not duplicate functionality. No Change In Functionality. llvm-svn: 221523
* [ELF] Remove duplicate code.Shankar Easwaran2014-10-211-52/+10
| | | | | | | The base class ELFObjectReader/ELFDSOReader implement the canParse functionaity with this change. llvm-svn: 220261
* [ELF] Check for target architecture.Shankar Easwaran2014-10-203-21/+50
| | | | | | | | | | The canParse function for all the ELF subtargets check if the input files match the subtarget. There were few mismatches in the input files that didnt match the subtarget for which the link was being invoked, which also acts as a test for this change. llvm-svn: 220182
* [ELF] Add Readers for all the ELF subtargets.Shankar Easwaran2014-10-182-4/+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
* [CMake] lld: Introduce ${cmake_2_8_12_INTERFACE} onto each ↵NAKAMURA Takumi2014-10-171-1/+1
| | | | | | | target_link_libraries. [PR20254] FIXME: Dependencies should be reorganized. llvm-svn: 220000
* Revert "[ELF][AllArchs] Fix includes"Shankar Easwaran2014-10-082-5/+5
| | | | | | This reverts commit e137dd93e1291a2d2fa7f41c8f8bcdb59c8b3225. llvm-svn: 219313
* [ELF][AllArchs] Fix includesShankar Easwaran2014-10-082-5/+5
| | | | llvm-svn: 219278
* More prefixing of error_code.Rafael Espindola2014-06-122-6/+6
| | | | llvm-svn: 210831
* Initial set of MakefilesIain Sandoe2014-06-041-0/+15
| | | | | | | | This provides support for the autoconfing & make build style. The format, style and implementation follows that used within the llvm and clang projects. TODO: implement out-of-source documentation builds. llvm-svn: 210177
* Use error_code() instead of error_code::succes()Rafael Espindola2014-05-312-4/+4
| | | | | | | There is no std::error_code::success, so this removes much of the noise in transitioning to std::error_code. llvm-svn: 209948
* [ELF] Add "override" and remove "virtual".Rui Ueyama2014-03-282-7/+7
| | | | llvm-svn: 205056
* [C++11] Switch from LLVM_FINAL to just "final" now that all of LLVM isChandler Carruth2014-03-022-3/+3
| | | | | | requiring MSVC 2012 or newer. llvm-svn: 202626
* [ELF] Make changes to all the targets supported currentlyShankar Easwaran2014-01-274-11/+161
| | | | | | | | X86_64,X86,PPC,Hexagon,Mips No change in functionality. llvm-svn: 200177
* [ELF] Add Target specific Readers.Shankar Easwaran2014-01-272-1/+2
| | | | | | No change in functionality. llvm-svn: 200175
* Run clang-format on r197727.Rui Ueyama2013-12-202-11/+4
| | | | llvm-svn: 197788
* [lld] fix unused variable warningsNick Kledzik2013-12-191-4/+1
| | | | llvm-svn: 197737
* [lld] Introduce registry and Reference kind tupleNick Kledzik2013-12-194-40/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Make anonymous namespace as small as possible.Rui Ueyama2013-12-101-3/+3
| | | | | | Use of static is recommended by the style guide. llvm-svn: 196877
* Fix include guards.Rui Ueyama2013-11-152-5/+5
| | | | llvm-svn: 194776
* Replace ErrorOr<void> with error_code.Rafael Espindola2013-11-052-4/+4
| | | | | | It was never transporting any value in addition to the error_code. llvm-svn: 194028
* [PassManager] add ReaderWriter{Native,YAML} to the Driver.Shankar Easwaran2013-10-291-1/+2
| | | | | | | | | | | | | 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
* Put missing license header.Rui Ueyama2013-10-251-0/+9
| | | | llvm-svn: 193435
* [ELF] Change MaxAlignment to 2.Shankar Easwaran2013-10-091-1/+1
| | | | llvm-svn: 192310
* Update error classes from all lowercase to camel case.Rui Ueyama2013-10-091-2/+2
| | | | llvm-svn: 192261
* Rename TargetInfo -> LinkingContext.Rui Ueyama2013-08-067-54/+55
| | | | | | | | | Also change some local variable names: "ti" -> "context" and "_targetInfo" -> "_context". Differential Revision: http://llvm-reviews.chandlerc.com/D1301 llvm-svn: 187823
* [lld] Move AtomLayout from ELF to ReaderWriter so that it can be used by ↵Rui Ueyama2013-06-162-2/+2
| | | | | | | | | | | | non-ELF writers. Reviewers: Bigcheese CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D977 llvm-svn: 184061
* [lld][ELF][All Archs] Addend is used by dynamic relocationsShankar Easwaran2013-05-171-0/+4
| | | | | | | | | | | | | | only if they are relative. This removes the FIXME when the relocations are being emitted and checks if the relocation is relative and only then populates the addend information. I couldnt add a testcase for this as llvm-readobj lacks functionality of printing dynamic relocations. When the functionality is added, remove the commented lines from elf/ifunc.test to test functionality. llvm-svn: 182077
* [ELF] Initialize readers and writers on creation.Michael J. Spencer2013-05-071-4/+1
| | | | | | | This makes the target handler a constructor argument because the constructor of OutputELFWriter relies on it being initialized. llvm-svn: 181280
* This is my Driver refactoring patch. Nick Kledzik2013-04-042-4/+40
| | | | | | | | | | | | | | | | | | | | | | | 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
* add changes for layoutafter/layoutbefore/ingroup/layoutpass and test casesShankar Easwaran2013-02-071-1/+7
| | | | llvm-svn: 174658
* [ELF] Use the target's LayoutHandler.Michael J. Spencer2013-01-302-1/+8
| | | | llvm-svn: 173966
* [ELF] Remove ReferenceKinds.Michael J. Spencer2013-01-301-2/+2
| | | | llvm-svn: 173912
* [ELF] Add {Hexagon,PPC,X86}TargetHandler.Michael J. Spencer2013-01-304-6/+123
| | | | llvm-svn: 173909
* [ELF] Chop the ELF prefix off of most things.Michael J. Spencer2013-01-292-7/+8
| | | | llvm-svn: 173838
* add elf targethandlerShankar Easwaran2013-01-254-0/+52
llvm-svn: 173430
OpenPOWER on IntegriCloud