summaryrefslogtreecommitdiffstats
path: root/lld/lib/ReaderWriter/ELF/Mips
Commit message (Collapse)AuthorAgeFilesLines
...
* [Mips] Teach LLD to recognize one more MIPS target triple - mips64elSimon Atanasyan2015-01-259-76/+133
| | | | | | | | | | | | This is initial patch to support MIPS64 object files linking. The patch just makes some classes more generalized, and rejects attempts to interlinking O32 and N64 ABI object files. I try to reuse the current MIPS target related classes as much as possible because O32 and N64 MIPS ABI are tightly related and share almost the same set of relocations, GOT, flags etc. llvm-svn: 227058
* [Mips] Make MipsELFObjectReader and MipsELFDSOReader class templatesSimon Atanasyan2015-01-252-10/+10
| | | | | | No functional changes. llvm-svn: 227051
* [Mips] Reformat the code with clang-formatSimon Atanasyan2015-01-251-2/+1
| | | | | | No functional changes. llvm-svn: 227049
* [Mips] Remove duplicated typedef'sSimon Atanasyan2015-01-252-4/+0
| | | | | | No functional changes. llvm-svn: 227048
* [Mips] Use template class argument instead of hard-coded type name inSimon Atanasyan2015-01-252-2/+2
| | | | | | | | the class field declarations. No functional changes. llvm-svn: 227047
* 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
* 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-6/+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
* 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-3/+3
| | | | | | | 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-4/+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
* [Mips] Use ELFLinkingContext class instead of MipsLinkingContext where possibleSimon Atanasyan2015-01-164-15/+12
| | | | | | No functional changes. llvm-svn: 226256
* [Mips] Make MipsLinkingContext owner of MipsELFFlagsMergerSimon Atanasyan2015-01-168-41/+32
| | | | | | | That reduce class dependencies and simplify the code a bit. No functional changes. llvm-svn: 226255
* [Mips] Remove redundant namespace namesSimon Atanasyan2015-01-161-29/+27
| | | | | | No functional changes. llvm-svn: 226254
* [Mips] Allow linking object files with MIPS32 and MIPS64 instructionsSimon Atanasyan2015-01-161-4/+56
| | | | | | | If object files satisfy O32 ABI they can be linked together even if some of them contains MIPS64 or MIPS64R2 instructions. llvm-svn: 226253
* Re-commit r225674: Convert other drivers to use WrapperNode.Rui Ueyama2015-01-151-6/+6
| | | | | | | | The original commit had an issue with Mac OS dylib files. It didn't handle fat binary dylib files correctly. This patch includes a fix. A test for that case has already been committed in r225764. llvm-svn: 226123
* Revert "Convert other drivers to use WrapperNode" and subsequent commits.Rui Ueyama2015-01-141-6/+6
| | | | | | | r225764 broke a basic functionality on Mac OS. This change reverts r225764, r225766, r225767, r225769, r225814, r225816, r225829, and r225832. llvm-svn: 225859
* Convert other drivers to use WrapperNode.Rui Ueyama2015-01-131-6/+6
| | | | llvm-svn: 225764
* [Mips] Replace stderr output by the `llvm_unreachable` callSimon Atanasyan2014-12-251-4/+4
| | | | | | | | | If a regular symbol has microMIPS-bit we need to stop linking. Now the LLD does not check the `applyRelocation` return value and continues linking anyway. As a temporary workaround use the `llvm_unreachable` call to stop the linker. llvm-svn: 224831
* [Mips] Support linking of microMIPS 32-bit codeSimon Atanasyan2014-12-247-84/+530
| | | | | | | The change is rather large but mainly it just adds handling of new relocations, PLT entries etc. llvm-svn: 224826
* [Mips] Join two if statementsSimon Atanasyan2014-12-241-3/+1
| | | | | | No functional changes. llvm-svn: 224817
* [Mips] Make the comment more descriptiveSimon Atanasyan2014-12-241-1/+1
| | | | | | No functional changes. llvm-svn: 224816
* [Mips] Factor out the code checks a symbol's bindingSimon Atanasyan2014-12-241-5/+6
| | | | | | No functional changes. llvm-svn: 224815
* [Mips] Rename the function s/readAddend/getAddend/Simon Atanasyan2014-12-241-4/+4
| | | | | | No functional changes. llvm-svn: 224814
* [Mips] Use OR operation to set the microMIPS bitSimon Atanasyan2014-12-242-2/+2
| | | | llvm-svn: 224813
* Protect doParse() because that's not a public interface.Rui Ueyama2014-12-151-0/+1
| | | | llvm-svn: 224235
* Make File always take the ownership of a MemoryBuffer.Rui Ueyama2014-12-121-4/+4
| | | | | | | | | | | | | | The documentation of parseFile() said that "the resulting File object may take ownership of the MemoryBuffer." So, whether or not the ownership of a MemoryBuffer would be taken was not clear. A FileNode (a subclass of InputElement, which is being deprecated) keeps the ownership if a File doesn't take it. This patch makes File always take the ownership of a buffer. Buffers lifespan is not always the same as File instances. Files are able to deallocate buffers after parsing the contents. llvm-svn: 224113
* Separate file parsing from File's constructors.Rui Ueyama2014-12-121-6/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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] Remove duplicate constructor code.Rui Ueyama2014-12-111-38/+12
| | | | | | This piece of code was copied multiple times to each archs. llvm-svn: 224001
* [ELF] Allow target to adjust a symbol's value for using in a dynamic tagSimon Atanasyan2014-12-101-0/+10
| | | | | | | | | Some targets like microMIPS and ARM Thumb use the last bit of a symbol's value to mark 'compressed' code. This patch adds new virtual function `DynamicTable::getAtomVirtualAddress` which allows to adjust a symbol's value before using it in a dynamic table tags like DT_INIT / DT_FINI. llvm-svn: 223963
* ELF: Add a standard method for unknown relocation errorsWill Newton2014-12-093-9/+7
| | | | | | | | | | | | | | | | | | | 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-23/+5
| | | | | | Tested with check-lld with no regressions. llvm-svn: 223462
* [ELF] Adjust ELF header entry symbol value if this symbol is microMIPS encodedSimon Atanasyan2014-12-041-6/+20
| | | | | | | To find an AtomLayout object for the given symbol I replace the `Layout::findAtomAddrByName` method by `Layout::findAtomLayoutByName` method. llvm-svn: 223359
* [ELF] Rename align2 to alignment.Shankar Easwaran2014-11-301-1/+1
| | | | | | No change in functionality. llvm-svn: 222975
* [Mips] Use endian::read() for relocation addendum readingSimon Atanasyan2014-11-211-3/+5
| | | | llvm-svn: 222574
* [Mips] Simplify the code calculates HI16/LO16 relocationsSimon Atanasyan2014-11-201-15/+3
| | | | | | No functional changes. llvm-svn: 222470
* [Mips] Remove duplicated relocation calculation routinesSimon Atanasyan2014-11-201-20/+8
| | | | | | No functional changes. llvm-svn: 222469
* [Mips] Remove unused function argumentSimon Atanasyan2014-11-201-2/+2
| | | | | | No functional changes. llvm-svn: 222468
* [Mips] Use endian::read/write function to load/save MIPS32 instructionsSimon Atanasyan2014-11-201-39/+41
| | | | | | No functional changes. llvm-svn: 222467
* [Mips] Configure GOTPLT entries in the corresponding constructorSimon Atanasyan2014-11-201-6/+8
| | | | | | No functional changes. llvm-svn: 222415
* [Mips] Remove unnecessary debug logging codeSimon Atanasyan2014-11-191-43/+0
| | | | | | No functional changes llvm-svn: 222325
* [Mips] Configure PLT and LA25 entries in the corresponding constructorsSimon Atanasyan2014-11-191-24/+24
| | | | | | No functional changes. llvm-svn: 222324
* [Mips] Inline the configurePLTReference methodSimon Atanasyan2014-11-191-9/+2
| | | | | | No functional changes. llvm-svn: 222323
* [Mips] Remove redundant const_castSimon Atanasyan2014-11-191-1/+1
| | | | | | No functional changes. llvm-svn: 222322
* [Mips] Make the function return type constant pointerSimon Atanasyan2014-11-191-2/+2
| | | | | | No functional changes. llvm-svn: 222321
* [Mips] Move setup of LLD_R_MIPS_STO_PLT relocation to the getPLTEntry() routineSimon Atanasyan2014-11-191-20/+5
| | | | | | No functional changes. llvm-svn: 222320
* [ELF] Handle ctors/dtors sectionsShankar Easwaran2014-11-191-17/+0
| | | | | | | | Move functionality from MIPS target to DefaultLayout. No change in functionality. llvm-svn: 222313
* [ELF] Create input and output section namesShankar Easwaran2014-11-191-2/+2
| | | | | | No change in functionality. llvm-svn: 222311
OpenPOWER on IntegriCloud