summaryrefslogtreecommitdiffstats
path: root/lld/lib/ReaderWriter/ELF/Hexagon
Commit message (Collapse)AuthorAgeFilesLines
...
* [ELF] Delete empty TargetLayout class and rename DefaultLayout to TargetLayoutSimon Atanasyan2015-04-031-5/+5
| | | | | | No functional changes. llvm-svn: 234052
* ELF: Fix header file dependencies.Rui Ueyama2015-04-032-5/+6
| | | | | | | <Arch>TargetHandler.h and <ArcH>RelocationHandler.h include each other. This patch breaks the circular dependencies. llvm-svn: 234050
* ELF: Pass file types instead of type traits to ELFObjectReader.Rui Ueyama2015-04-031-10/+2
| | | | | | | | All <Arch>ELFFileCreateFileTraits structs are the same except its file type. That means that we don't need to pass the type traits. Instead, we can only pass file types. By doing this, we can remove copy-pasted boilerplates. llvm-svn: 234047
* ELF: Remove partial class definitions of <Arch>LinkingContexts.Rui Ueyama2015-04-031-1/+2
| | | | | | | | | | | | | What we are doing in ELFTarget.h was dubious. In the file, we define partial classes of <Arch>LinkingContexts to declare only static member functions. We have different (complete) class definitions in other files. They would conflict if they exist in the same compilation unit (because the ones defined in ELFTarget.h has only static member functions). I don't think this was valid C++. http://reviews.llvm.org/D8797 llvm-svn: 234039
* ELF: Remove <Arch>ELFFileCreateELFTraits::result_type.Rui Ueyama2015-04-021-4/+2
| | | | | | | | result_type is always ErrorOr<unique_ptr<File>>, and since the type traits is for instantiating ELF files, it's unlikely that we want to return something else. This patch removes that type. llvm-svn: 233948
* ELF: Replace empty classes with typedefs.Rui Ueyama2015-04-021-15/+3
| | | | llvm-svn: 233896
* ELF: Remove a template parameter from ELF{Object,DOS}Reader constructors.Rui Ueyama2015-04-022-3/+3
| | | | | | | | | There is one-to-one correspondence between ELF machine type and a LinkingContext. We passed them as separate arguments to the constructor. This patch is to teach the LinkingContexts about their machine types, so that we don't need to pass that data as separate arguments. llvm-svn: 233894
* ELF: Move registerRelocationNames() from TargetHandler to ↵Rui Ueyama2015-04-024-14/+14
| | | | | | | | | | | | | | | | | | | | | <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-012-9/+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 unused variable.Rui Ueyama2015-04-011-1/+0
| | | | llvm-svn: 233864
* Use llvm::make_unique.Rui Ueyama2015-04-011-2/+1
| | | | llvm-svn: 233863
* [ELF][Hexagon] Add comments related to hexagon relocations.Shankar Easwaran2015-04-012-6/+10
| | | | | | No functional changes. llvm-svn: 233783
* ELF: Remove TargetHandlerBase by merging it with TargetHandler.Rui Ueyama2015-04-012-2/+2
| | | | | | | | | | | | | | | | | | | In r233772, I removed an empty class, DefaultTargetHandler, from the class hierarchy by merging the class with TargetHandler. I then found that TargetHandler and its base class, TargetHandlerBase, are also almost the same. We need to go deeper. In this patch, I merged TargetHandlerBase with TargetHandler. The only difference between them is the existence (or absense) of a pure virtual function registerRelocationName(). I added that function to the (new) TargetHandler. One more thing is that TargetHandler was templated for no reason. I made it non-templated class. llvm-svn: 233773
* ELF: Remove dead class that does nothing in class hierarchy.Rui Ueyama2015-03-311-3/+1
| | | | | | | | | | | | | | DefaultTargetHandler is the base class of all <Arch>TargetHandler classes, and it's the only derived class of TargetHandler class. TargetHandler and DefaultTargetHandler are actually the same. They define the same set of pure virtual functions. DefaultTargetHandler is a useless class in the class hierarchy -- it shouldn't have been added in the first place. This patch makes all <Arch>TargetHandler classes directly derive from TargetHandler and removes DefaultTargetHandler. llvm-svn: 233772
* ELF: Make findAbsoluteAtom return AtomLayout* instead of an iterator.Rui Ueyama2015-03-312-15/+12
| | | | | | | | | | | All calls of findAbsoluteAtoms seem a bit awkward because of the type of the function. It semantically returns a pointer to an AtomLayout or nothing, so I made the function return AtomLayout*. In this patch, I also expanded some "auto"s because their actual type were not obvious in their contexts. llvm-svn: 233769
* ELF: Fix dereferencing end() iterator.Rui Ueyama2015-03-311-11/+8
| | | | | | | findAbsoluteAtom() returns absoluteAtom().end() if no atom is found. Dereferencing end() value results an undefined behavior. llvm-svn: 233765
* ELF: Remove TargetHandler::getTargetLayout.Rui Ueyama2015-03-311-4/+0
| | | | | | | Only MIPS used that member function, and by removing the use of the function, I removed a static_cast. Seems like it's a win. llvm-svn: 233748
* Remove "_hexagon" prefix from some member variables.Rui Ueyama2015-03-316-58/+47
| | | | | | | 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
* Remove virtual and add override.Rui Ueyama2015-03-314-22/+22
| | | | llvm-svn: 233735
* If x is a unique_ptr, *x.get() is equivalent to *x.Rui Ueyama2015-03-312-3/+3
| | | | llvm-svn: 233723
* Use llvm::make_unique.Rui Ueyama2015-03-311-2/+2
| | | | llvm-svn: 233721
* ELF: Replace a macro with an inlined function.Rui Ueyama2015-03-312-25/+22
| | | | | | | FINDV4BITMASK macro is defined as a macro so that the macro body is inlined. We should use inlined functions instead of macros. llvm-svn: 233719
* ELF: Do not use multiple inheritance.Rui Ueyama2015-03-315-74/+36
| | | | | | | | Multiple inheritance is casually used here. Rewriting to not using multiple inheritance reduces the complexity of the code and also makes it shorter. llvm-svn: 233718
* Use override keyword instead of virtual.Rui Ueyama2015-03-271-3/+3
| | | | llvm-svn: 233424
* Rename ELFLinkingContext instances "ctx" intead of "context".Rui Ueyama2015-03-277-36/+33
| | | | llvm-svn: 233344
* Use llvm::make_unique.Rui Ueyama2015-03-261-6/+4
| | | | llvm-svn: 233319
* Remove duplicate code and empty classes.Rui Ueyama2015-03-262-19/+2
| | | | llvm-svn: 233316
* Remove Makefiles.Rui Ueyama2015-03-261-16/+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
* Use alignment values everywhere instead of log2.Rui Ueyama2015-03-263-8/+8
| | | | | | | | 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 implicit constructor and operator int from PowerOf2.Rui Ueyama2015-03-261-3/+3
| | | | | | | | | | 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
* Inherit constructors. No functionality change.Rui Ueyama2015-03-251-8/+3
| | | | | | | We cannot use "using" to inherit constructors because the feature is not supported by MSVC 2013. llvm-svn: 233218
* Fix the CMake shared build.Benjamin Kramer2015-03-231-1/+2
| | | | | | | The ELF backends now depend on lld::script::Sema, which is in libReaderWriter. Link it explicitly. llvm-svn: 232953
* [LinkerScript] Handle symbols defined in linker scriptsRafael Auler2015-03-161-2/+2
| | | | | | | | | | Puts symbols defined in linker script expressions in a runtime file that is added as input to the resolver, making the input object files see symbols defined in linker scripts. http://reviews.llvm.org/D8263 llvm-svn: 232409
* [LinkerScript] Implement semantics for simple sections mappingsRafael Auler2015-03-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit implements the behaviour of the SECTIONS linker script directive, used to not only define a custom mapping between input and output sections, but also order input sections in the output file. To do this, we modify DefaultLayout with hooks at important places that allow us to re-order input sections according to a custom order. We also add a hook in SegmentChunk to allow us to calculate linker script expressions while assigning virtual addresses to the input sections that live in a segment. Not all SECTIONS constructs are currently supported, but only the ones that do not use special sort orders. It adds two LIT test as practical examples of which sections directives are currently supported. In terms of high-level changes, it creates a new class "script::Sema" that owns all linker script ASTs and the logic for linker script semantics as well. ELFLinkingContext owns a single copy of Sema, which will be used throughout the object file writing process (to layout sections as proposed by the linker script). Other high-level change is that the writer no longer uses a "const" copy of the linking context. This happens because linker script expressions must be calculated *while* calculating final virtual addresses, which is a very late step in object file writing. While calculating these expressions, we need to update the linker script symbol table (inside the semantics object), and, thus, we are "modifying our context" as we prepare to write the file. http://reviews.llvm.org/D8157 llvm-svn: 232402
* Remove duplicate code. NFC.Rui Ueyama2015-03-071-5/+1
| | | | llvm-svn: 231570
* Remove include/lld/Core/Endian.h and use llvm/Support/Endian.h instead.Rui Ueyama2015-03-021-3/+3
| | | | llvm-svn: 231005
* Add {read,write}{16,32,64}{le,be} functions.Rui Ueyama2015-02-271-6/+3
| | | | | | | | | | | | | | Nothing wrong with reinterpret_cast<llvm::support::ulittle32_t *>(loc), but that's redundant and not great from readability point of view. The new functions are wrappers for that kind of reinterpet_casts. Surprisingly or unsurprisingly, there was no use of big endian read and write. {read,write}{16,32,64}be have no user. But I think they still worth to be there in the header for completeness. http://reviews.llvm.org/D7927 llvm-svn: 230725
* [ELF] Add section group/COMDAT support.Shankar Easwaran2015-02-231-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | SHF_GROUP: Group Member Sections ---------------------------------- A section which is part of a group, and is to be retained or discarded with the group as a whole, is identified by a new section header attribute: SHF_GROUP This section is a member (perhaps the only one) of a group of sections, and the linker should retain or discard all or none of the members. This section must be referenced in a SHT_GROUP section. This attribute flag may be set in any section header, and no other modification or indication is made in the grouped sections. All additional information is contained in the associated SHT_GROUP section. SHT_GROUP: Section Group Definition ------------------------------------- Represents a group section. The section group's sh_link field identifies a symbol table section, and its sh_info field the index of a symbol in that section. The name of that symbol is treated as the identifier of the section group. More information: https://mentorembedded.github.io/cxx-abi/abi/prop-72-comdat.html Added a lot of extensive tests, that tests functionality. llvm-svn: 230195
* Remove unused parameters.Rui Ueyama2015-02-131-3/+2
| | | | llvm-svn: 229055
* [ELF] Add LinkingContext to the ELFReader.Shankar Easwaran2015-02-124-23/+25
| | | | | | | | | | | | | | | This adds the LinkingContext parameter to the ELFReader. Previously the flags in that were needed in the Context was passed to the ELFReader, this made it very hard to access data structures in the LinkingContext when reading an ELF file. This change makes the ELFReader more flexible so that required parameters can be grabbed directly from the LinkingContext. Future patches make use of the changes. There is no change in functionality though. llvm-svn: 228905
* Use make_unique.Rui Ueyama2015-02-061-1/+1
| | | | llvm-svn: 228453
* Fix the ELF shared library build targets - take 2Greg Fitzgerald2015-01-244-10/+11
| | | | | | | | | | 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
* ELF: Remove virtual from non-overriden functions.Rui Ueyama2015-01-231-5/+5
| | | | | | If it's overridden by a derived class, add override to the derived class. llvm-svn: 226971
* Revert " Fix the ELF shared library build targets"Greg Fitzgerald2015-01-232-2/+10
| | | | | | This reverts commit 6a3f545b44cea46321e025d9ab773786af86cb51. llvm-svn: 226928
* Fix the ELF shared library build targetsGreg Fitzgerald2015-01-232-10/+2
| | | | | | | | | | 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-203-5/+4
| | | | | | | | | | | 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
OpenPOWER on IntegriCloud