summaryrefslogtreecommitdiffstats
path: root/lld/lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Remove the old ELF linker.Rafael Espindola2016-02-281-383/+0
| | | | | | I think it is clear by now that the new linker is viable. llvm-svn: 262158
* Add File::kind's for all subclasses of File.Pete Cooper2016-01-141-1/+2
| | | | | | | | | | | | This is to enable isa<> support for any files which need it. It will be used in an upcoming patch to differentiate MachOFile from other implicitly generated files. Reviewed by Lang Hames. Differential Revision: http://reviews.llvm.org/D16103 llvm-svn: 257830
* Simplify Pass::perform to take a SimpleFile& instead of unique_ptr<SimpleFile>&David Blaikie2015-06-191-7/+7
| | | | | | | | None of the implementations replace the SimpleFile with some other file, they just modify the SimpleFile in-place, so a direct reference to the file is sufficient. llvm-svn: 240167
* [lld] Allow LLD passes to return error codes.Lang Hames2015-06-191-1/+3
| | | | llvm-svn: 240147
* ELF: Remove redundant namespace qualifiers.Rui Ueyama2015-04-141-3/+3
| | | | llvm-svn: 234938
* ELF: Remove ELFT template argument when referring the base class.Rui Ueyama2015-04-141-2/+2
| | | | | | | | We don't need to repeat the template argument. They are not ambiguous. MIPS is parameterized for ELFT, so we can't do this for MIPS, though. llvm-svn: 234913
* ELF: Move function definitions from .h to .cpp.Rui Ueyama2015-04-141-4/+72
| | | | llvm-svn: 234863
* Remove unused variable.Rui Ueyama2015-04-141-2/+1
| | | | llvm-svn: 234831
* ELF: Remove useless templates that takes always the same ELF type.Rui Ueyama2015-04-141-6/+4
| | | | llvm-svn: 234820
* Merge MutableFile with SimpleFile.Rui Ueyama2015-04-071-1/+1
| | | | | | | | SimpleFile is the only derived class of MutableFile. This patch reduces the height of class hierarchy by removing MutableFile class. llvm-svn: 234354
* ELF: Move registerRelocationNames() from TargetHandler to ↵Rui Ueyama2015-04-021-12/+0
| | | | | | | | | | | | | | | | | | | | | <Arch>ELFLinkingContext. registerRelocationNames() function is called to register all known ELF relocation types to the central registry. Since we have separate LinkingContext class for each ELF machine type, we need to call the function for each LinkingContext. However, the function belonged to TargetHandler instead of LinkingContext. So we needed to do ctx.getTargetHandler().registerRelocationNames(). This patch removes that redundant getTargetHandler call by moving the function from TargetHandler to LinkingContext. Conceptually this patch is small, but in reality it's not that small. It's because the same code is copied to each architecture. Most of this patch is just repetition. We need to merge them, but that cannot be done in this patch. llvm-svn: 233883
* ELF: x86, x86-64, ARM, AArch64: Remove architecture name prefixes from class ↵Rui Ueyama2015-04-021-2/+2
| | | | | | members. llvm-svn: 233873
* ELF: Remove <Arch>TargetHandler::kindString.Rui Ueyama2015-04-011-8/+6
| | | | | | | | | | | | | <Arch>TargetHandler::kindString is a static member variable containg a list of names of relocation types. The member is used only by one function, registerRelocationNames, so they don't have to be a static member. This patch makes the visibility of the data narrower by making them file-scoped variables in small files. llvm-svn: 233867
* Remove "_hexagon" prefix from some member variables.Rui Ueyama2015-03-311-7/+5
| | | | | | | At least in Mips we don't have a prefix for member variables. Repeating the architecture is verbose. llvm-svn: 233746
* Use C++ non-static member initialization.Rui Ueyama2015-03-311-5/+4
| | | | llvm-svn: 233739
* Rename identifiers starting with an underscore and a uppercase letter.Rui Ueyama2015-03-311-11/+11
| | | | | | | Identifiers starting with _[A-Z] is reserved for the language. User programs shouldn't use such identifiers. llvm-svn: 233737
* If x is a unique_ptr, *x.get() is equivalent to *x.Rui Ueyama2015-03-311-1/+1
| | | | llvm-svn: 233723
* Rename ELFLinkingContext instances "ctx" intead of "context".Rui Ueyama2015-03-271-9/+9
| | | | llvm-svn: 233344
* Use llvm::make_unique.Rui Ueyama2015-03-261-6/+4
| | | | llvm-svn: 233319
* Use alignment values everywhere instead of log2.Rui Ueyama2015-03-261-3/+3
| | | | | | | | 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
* Remove duplicate code. NFC.Rui Ueyama2015-03-071-5/+1
| | | | llvm-svn: 231570
* Use make_unique.Rui Ueyama2015-02-061-1/+1
| | | | llvm-svn: 228453
* ELF: Support detection of relocation errors during processingWill Newton2015-01-201-1/+1
| | | | | | | | | | | 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
* [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: Add a standard method for unknown relocation errorsWill Newton2014-12-091-2/+2
| | | | | | | | | | | | | | | | | | | 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-92/+5
| | | | | | Tested with check-lld with no regressions. llvm-svn: 223462
* [ELF] Add Readers for all the ELF subtargets.Shankar Easwaran2014-10-181-1/+1
| | | | | | | | | 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
* More prefixing of error_code.Rafael Espindola2014-06-121-4/+4
| | | | llvm-svn: 210831
* Use error_code() instead of error_code::succes()Rafael Espindola2014-05-311-2/+2
| | | | | | | There is no std::error_code::success, so this removes much of the noise in transitioning to std::error_code. llvm-svn: 209948
* [ELF] Remove unused fields (linking context references).Simon Atanasyan2014-03-191-2/+2
| | | | llvm-svn: 204222
* Add "override" and remove "virtual" where appropriate.Rui Ueyama2014-03-061-9/+9
| | | | | | | For the record, I used clang-modernize to add "override" and perl to remove "virtual". llvm-svn: 203164
* [C++11] Switch from LLVM_FINAL to just "final" now that all of LLVM isChandler Carruth2014-03-021-1/+1
| | | | | | requiring MSVC 2012 or newer. llvm-svn: 202626
* [ELF] Make changes to all the targets supported currentlyShankar Easwaran2014-01-271-6/+24
| | | | | | | | X86_64,X86,PPC,Hexagon,Mips No change in functionality. llvm-svn: 200177
* Run clang-format on r197727.Rui Ueyama2013-12-201-8/+5
| | | | llvm-svn: 197788
* [lld] Introduce registry and Reference kind tupleNick Kledzik2013-12-191-10/+119
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Revert "Remove makeArrayRef() calls."Rui Ueyama2013-12-101-5/+7
| | | | | | | 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-051-7/+5
| | | | | | | 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-051-6/+7
| | | | llvm-svn: 196465
* Replace ErrorOr<void> with error_code.Rafael Espindola2013-11-051-2/+2
| | | | | | 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-8/+8
| | | | | | | | | | | | | 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
* Revert "r193300 - [PassManager] add ReaderWriter{Native, YAML} to the Driver"Rui Ueyama2013-10-241-7/+7
| | | | | | | 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-241-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* [Layout] Dont set ordinals to Files by default.Shankar Easwaran2013-10-091-1/+3
| | | | | | | | | | | | | 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
* [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
* Rename ti -> ctx.Rui Ueyama2013-08-271-3/+3
| | | | | | | This should have been done in r187823 when I renamed LinkingContext from TargetInfo. I missed a few files. llvm-svn: 189298
* Rename TargetInfo -> LinkingContext.Rui Ueyama2013-08-061-10/+10
| | | | | | | | | Also change some local variable names: "ti" -> "context" and "_targetInfo" -> "_context". Differential Revision: http://llvm-reviews.chandlerc.com/D1301 llvm-svn: 187823
* [lld][ELF] Inline header files into the one file using itShankar Easwaran2013-05-211-1/+81
| | | | llvm-svn: 182427
* This is my Driver refactoring patch. Nick Kledzik2013-04-041-2/+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
* [ELF][Hexagon] Create .got.plt entries with the appropriate alignmentShankar Easwaran2013-04-011-0/+1
| | | | llvm-svn: 178467
* [ELF] Add dynamic hash table and get simple dynamic libraries working with ↵Shankar Easwaran2013-03-291-8/+6
| | | | | | Hexagon llvm-svn: 178323
OpenPOWER on IntegriCloud