summaryrefslogtreecommitdiffstats
path: root/lld/lib/ReaderWriter/ELF/Mips/MipsExecutableWriter.h
Commit message (Collapse)AuthorAgeFilesLines
* [Mips] Move member function definitions to cpp filesSimon Atanasyan2015-05-271-168/+0
| | | | | | No functional changes. llvm-svn: 238310
* [ELF] Remove redundant unique_ptr moves found by -Wpessimizing-move.Benjamin Kramer2015-05-221-1/+1
| | | | llvm-svn: 238030
* Replace the `createImplicitFiles` method return type with `void`Simon Atanasyan2015-04-061-3/+2
| | | | | | | All instances of the `createImplicitFiles` always return `true` and this return value is used nowhere. llvm-svn: 234205
* [Mips] Rename MipsLinkingContext class methodSimon Atanasyan2015-04-051-1/+1
| | | | | | getMergeReginfoMask => getMergedReginfoMask llvm-svn: 234116
* [Mips] Support writing .MIPS.options section into the linked fileSimon Atanasyan2015-04-051-7/+10
| | | | | | | | In case of MIPS N64 ABI linker should merge registers usage masks stored in the input .MIPS.options sections and save result into the output .MIPS.options section. llvm-svn: 234115
* [Mips] Support writing .reginfo section into the linked fileSimon Atanasyan2015-04-041-0/+14
| | | | | | | | | | | In case of MIPS O32 ABI linker should merge registers usage masks stored in the input .reginfo sections and save result into the output .reginfo section. The ABI states that the .reginfo section should be put into the separate segment. This requirement is not implemented in this patch. llvm-svn: 234103
* [Mips] Inline the MipsELFWriter::hasGlobalGOTEntry functionSimon Atanasyan2015-04-021-2/+2
| | | | | | No functional changes. llvm-svn: 233924
* [Mips] Remove 'mips' prefix from class member fields namesSimon Atanasyan2015-04-011-4/+4
| | | | | | No functional changes. llvm-svn: 233812
* [Mips] clang-format the codeSimon Atanasyan2015-03-301-3/+1
| | | | | | No functional changes. llvm-svn: 233616
* Rename ELFLinkingContext instances "ctx" intead of "context".Rui Ueyama2015-03-271-9/+9
| | | | llvm-svn: 233344
* Use template aliases.Rui Ueyama2015-03-101-11/+11
| | | | | | We dropped Visual Studio 2012 support, so we can use template aliases. llvm-svn: 231756
* [Mips] Use template class argument instead of hard-coded type name inSimon Atanasyan2015-01-251-1/+1
| | | | | | | | the class field declarations. No functional changes. llvm-svn: 227047
* [Mips] Use ELFLinkingContext class instead of MipsLinkingContext where possibleSimon Atanasyan2015-01-161-6/+5
| | | | | | No functional changes. llvm-svn: 226256
* [Mips] Make MipsLinkingContext owner of MipsELFFlagsMergerSimon Atanasyan2015-01-161-8/+5
| | | | | | | That reduce class dependencies and simplify the code a bit. No functional changes. llvm-svn: 226255
* [Mips] Use OR operation to set the microMIPS bitSimon Atanasyan2014-12-241-1/+1
| | | | llvm-svn: 224813
* [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] Add CodeModel attribute to the DefinedAtom classSimon Atanasyan2014-11-131-0/+8
| | | | | | | | | | | | | | | | | | | | | | MIPS ELF symbols might contain some additional MIPS-specific flags in the st_other field besides visibility ones. These flags indicate code properties like microMIPS / MIPS16 encoding, position independent code etc. We need to transfer the flags from input objects to the output linked file to write them into the symbol table, adjust symbols addresses etc. I add new attribute CodeModel to the DefinedAtom class to hold target specific flag and to get over YAML/Native format conversion barrier. Other architectures/targets can extend CodeModel enumeration by their own flags. MIPS specific part of this patch adds support for STO_MIPS_MICROMIPS flag. This flag marks microMIPS symbols. Such symbol should: a) Has STO_MIPS_MICROMIPS in the corresponding .symtab record. b) Has adjusted (odd) address in the corresponding .symtab and .dynsym records. llvm-svn: 221864
* [Mips] Check ELF flags to prevent linking of incompatible filesSimon Atanasyan2014-11-061-5/+8
| | | | | | | | | | | | | | | | | 1. The path checks ELF header flags to prevent linking of incompatible files. For example we do not allow to link files with different ABI, -mnan flags, some combination of target CPU etc. 2. The patch merge ELF header flags from input object files to put their combination to the generated file. For example, if some input files have EF_MIPS_NOREORDER flag we need to put this flag to the output file header. I use the `parseFile()` (not `canParse()`) method because in case of recognition of incorrect input flags combination we should show detailed error message and stop the linking process and should not try to use another `Reader`. llvm-svn: 221439
* Fix warnings about missing override.Rafael Espindola2014-11-031-2/+3
| | | | llvm-svn: 221165
* Reapply [ELF] Only mark as DT_NEEDED libs that are strictly necessary (r219353)Rafael Auler2014-10-091-4/+0
| | | | | | | | | | | | | | | | | | | | When committed in r219353, this patch originally caused problems because it was not tested in debug build. In such scenarios, Driver.cpp adds two additional passes. These passes serialize all atoms via YAML and reads it back. Since the patch changed ObjectAtom to hold a new reference, the serialization was removing the extra data. This commit implements r219853 in another way, similar to the original MIPS way, by using a StringSet that holds the names of all copied atoms instead of directly holding a reference to the copied atom. In this way, this commit is simpler and eliminate the necessity of changing the DefinedAtom hierarchy to hold a new data. Reviewers: shankarke http://reviews.llvm.org/D5713 llvm-svn: 219449
* Revert "[ELF] Only mark as DT_NEEDED libs that are strictly necessary"Rui Ueyama2014-10-091-0/+4
| | | | | | This reverts commit r219353 because that seems to break buildbots. llvm-svn: 219369
* [ELF] Only mark as DT_NEEDED libs that are strictly necessaryRafael Auler2014-10-081-4/+0
| | | | | | | | | | | | | | | | | | | | | Enhances the creation of an ELF dynamic executable by avoiding recording unnecessary shared libraries as NEEDED to load a program. To do this, we must keep track of not only symbols that were referenced but also of COPY relocations, which steal the symbol from a shared library but does not store from which lib this symbol came from. To fix this, this commit changes ObjectSymbol to store the original library from which this symbol came. With this information, we are able to build a list of the exact shared libraries that must be marked as DT_NEEDED, instead of blindly marking all shared libraries as needed. This logic originally came from the MIPS backend with some adaptation. Reviewers: atanasyan, shankar.easwaran http://reviews.llvm.org/D5574 llvm-svn: 219353
* [ELF] Fix inclusion of weak symbols in the dynamic symbol tableRafael Auler2014-10-081-2/+20
| | | | | | | | | | | | | | | | | This commit implements in the X86_64 ELF lld backend yet another feature that was only available in the MIPS backend. However, this patch changes generic ELF classes to make it trivial for other ELF backends to use this logic too. When creating a dynamic executable that has dynamic relocations against weak undefined symbols, these symbols must be exported to the dynamic symbol table to seek a possible resolution at run time. A common use case is the __gmon_start__ weak glibc undefined symbol. Reviewer: shankarke http://reviews.llvm.org/D5571 llvm-svn: 219349
* Revert "[ELF][AllArchs] Fix includes"Shankar Easwaran2014-10-081-2/+2
| | | | | | This reverts commit e137dd93e1291a2d2fa7f41c8f8bcdb59c8b3225. llvm-svn: 219313
* [ELF][AllArchs] Fix includesShankar Easwaran2014-10-081-2/+2
| | | | llvm-svn: 219278
* [lld] [ELF] [MIPS] Remove duplicate logicRafael Auler2014-10-021-4/+0
| | | | | | | | | | | | | | Summary: With r218633, the logic that monitors which shared library symbols were used was copied from the MIPS lld backend to ELF classes, making it available to all ELF backends. However, this made the isDynSymEntryRequired() functions in MipsDynamicLibraryWriter.h/MipsELFWriters.h/MipsExecutableWriter.h to be duplicated logic, since this is already implemented in OutputELFWriter<>/DefaultLayout. This patch removes this duplicated code from MIPS. Reviewers: Bigcheese, shankarke Reviewed By: shankarke Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D5564 llvm-svn: 218846
* [Mips] s/context/ctx/ for consistency and reduce lines lengths.Simon Atanasyan2014-07-171-5/+4
| | | | | | No functional changes. llvm-svn: 213310
* [ELF] Add two new virtual functions to the `OutputELFWriter` class to controlSimon Atanasyan2014-06-251-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dynamic symbol table populating and DT_NEEDED tag creation. The `isDynSymEntryRequired` function returns true if the specified shared library atom requires a dynamic symbol table entry. The `isNeededTagRequired` function returns true if we need to create DT_NEEDED tag for the shared library defined specified shared atom. By default the both functions return true. So there is no functional changes for all targets except MIPS. Probably we need to spread the same modifications on other ELF targets but I want to implement and fully tested complete set of changes for MIPS target first. For MIPS we create a dynamic symbol table entry for a shared library atom iif this atom is referenced by a regular defined atom. For example, if library L1 defines symbol T1, library L2 defines symbol T2 and uses symbol T1 and executable file E1 uses symbol T2 but does not use symbol T1 we create an entry in the E1 dynamic symbol table for symbol T2 and do not create an entry for T1. The patch creates DT_NEEDED tags for shared libraries contain shared library atoms which a) referenced by regular defined atoms; b) have corresponding copy dynamic relocations (R_MIPS_COPY). Now the patch does not take in account --as-needed / --no-as-needed command line options. So it is too restrictive and create DT_NEEDED tags for really needed shared libraries only. I plan to fix that by subsequent patches. llvm-svn: 211674
* More prefixing of error_code.Rafael Espindola2014-06-121-2/+2
| | | | llvm-svn: 210831
* [Mips] Handle Mips TLS relocations R_MIPS_TLS_GOTTPREL / R_MIPS_TLS_GD / ↵Simon Atanasyan2014-06-071-0/+8
| | | | | | R_MIPS_TLS_LDM etc. llvm-svn: 210394
* Use error_code() instead of error_code::succes()Rafael Espindola2014-05-311-1/+1
| | | | | | | There is no std::error_code::success, so this removes much of the noise in transitioning to std::error_code. llvm-svn: 209948
* [Mips] Factor out the code create Mips specific runtime file intoSimon Atanasyan2014-05-251-15/+2
| | | | | | the MipsELFWriters member function. llvm-svn: 209592
* [Mips] Convert MipsDynamicSymbolTable to the class template.Simon Atanasyan2014-04-281-2/+3
| | | | llvm-svn: 207435
* [Mips] Do not inherit MipsDynamicLibraryWriter and MipsExecutableWriterSimon Atanasyan2014-03-091-6/+6
| | | | | | from MipsELFWriter class. MipsELFWriter is just a helper. llvm-svn: 203402
* [Mips] Replace "virtual" by "override" in member function declarationsSimon Atanasyan2014-03-061-4/+4
| | | | | | where it is appropriate. llvm-svn: 203102
* [Mips] In case of executable file linking MIPS ABI requires to add evenSimon Atanasyan2014-02-031-0/+16
| | | | | | | undefined symbols to '.dynsym' if these symbols have corresponding entries in a global part of GOT. llvm-svn: 200716
* [Mips] Unify #include guard names.Simon Atanasyan2014-02-031-3/+3
| | | | llvm-svn: 200715
* [Mips] Declare MipsDynamicTable class in a separate header file.Simon Atanasyan2014-01-281-1/+2
| | | | llvm-svn: 200328
* [ELF] Make changes to all the targets supported currentlyShankar Easwaran2014-01-271-0/+102
X86_64,X86,PPC,Hexagon,Mips No change in functionality. llvm-svn: 200177
OpenPOWER on IntegriCloud