summaryrefslogtreecommitdiffstats
path: root/lld/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* ELF: Minimum alignment value is 1, not 0. NFC.Rui Ueyama2015-04-073-3/+3
| | | | | | | | Maybe we can interpret alignment 0 as "don't care", but for consistency, it's good to set 1 instead of 0 where we allow any alignments. llvm-svn: 234284
* ELF: Add a comment to ELFFile::findAtom.Rui Ueyama2015-04-071-18/+27
| | | | | | Also changed the local variable names to avoid line wrapping. llvm-svn: 234281
* Fix weird comment line-wrapping.Rui Ueyama2015-04-071-4/+3
| | | | llvm-svn: 234279
* Use early continue.Rui Ueyama2015-04-071-10/+10
| | | | llvm-svn: 234278
* ELF: Move more code from createAtoms to handleGnuLinkOnceSection.Rui Ueyama2015-04-071-32/+22
| | | | | | So that createAtoms become more readable. llvm-svn: 234277
* ELF: Simplfiy ELFFile::createAtom.Rui Ueyama2015-04-071-56/+56
| | | | | | | | createAtom function did too much in a single for-loop. This patch splits the for-loop and extract COMDAT handling into a separate function. llvm-svn: 234276
* ELF: Do not return error from handle{CommonSymbol,MergeString}.Rui Ueyama2015-04-072-17/+17
| | | | llvm-svn: 234273
* ELF: Do not return error from handleAbsoluteSymbol.Rui Ueyama2015-04-071-16/+16
| | | | | | This function never fails. llvm-svn: 234272
* ELF: Do not return error from handleUndefinedSymbol.Rui Ueyama2015-04-071-16/+16
| | | | | | This function is not supposed to return an error value. llvm-svn: 234271
* ELF: Do not return error from handleDefinedSymbol.Rui Ueyama2015-04-074-40/+40
| | | | | | | | | | | handleDefinedSymbol has return type of ErrorOr<ELFDefinedAtom *>. However, it never returns an error. We are not checking errors. It's marked as ErrorOr "just in case". That's a bad engineering practice. This patch simplifies the return type of the function. llvm-svn: 234269
* ELF: Simplify CreateELF.Rui Ueyama2015-04-061-37/+17
| | | | | | | | | CreateELF was a combination of templates and C preprocessor macros. This patch removes uses of macros. http://reviews.llvm.org/D8810 llvm-svn: 234253
* [GNU] Implement --enable-new-dtags/--disable-new-dtagsDavide Italiano2015-04-063-1/+11
| | | | | | | PR: 23036 Differential Revision: http://reviews.llvm.org/D8836 llvm-svn: 234240
* ELF: Do not mix link-once and group sections.Rui Ueyama2015-04-061-9/+10
| | | | | | | | | | | Previously, we put both link-once and group sections into the same map and seaparated them out when we use them. Apparently we should put them into seaprate maps in the first place. This piece of code is added recently, and I still don't understand all of them. Looks like we need to clean this up even more. llvm-svn: 234223
* Replace the `createImplicitFiles` method return type with `void`Simon Atanasyan2015-04-0619-56/+34
| | | | | | | All instances of the `createImplicitFiles` always return `true` and this return value is used nowhere. llvm-svn: 234205
* Remove return after report_fatal_error which has noreturn attribute.Rui Ueyama2015-04-061-1/+0
| | | | llvm-svn: 234204
* Fix weird line-wrapping.Rui Ueyama2015-04-061-13/+9
| | | | llvm-svn: 234203
* Use llvm::cast at where we don't expect a null value.Rui Ueyama2015-04-061-1/+1
| | | | llvm-svn: 234199
* [Mips] Guard modification of register usage masks by mutexSimon Atanasyan2015-04-062-0/+3
| | | | llvm-svn: 234167
* [LinkerScript] Handle symbols defined in linker scripts in case of shared libSimon Atanasyan2015-04-061-0/+2
| | | | | | | This patch is a follow-up to the rL232409 and allows define symbols in a linker script in case of linking shared library. llvm-svn: 234163
* [ELF] Use override keyword instead of virtualSimon Atanasyan2015-04-065-16/+16
| | | | | | No functional changes. llvm-svn: 234162
* [ELF] Use override keyword instead of virtualSimon Atanasyan2015-04-061-4/+4
| | | | | | No functional changes. llvm-svn: 234157
* [ELF] Remove redundant forward class declarationsSimon Atanasyan2015-04-062-6/+0
| | | | | | No functional changes. llvm-svn: 234156
* [Mips] Remove redundant non-template MipsRelocationHandler classSimon Atanasyan2015-04-062-7/+3
| | | | llvm-svn: 234155
* [Mips] Replace MipsRelocationHandler::readAddend() by a regular functionSimon Atanasyan2015-04-063-21/+14
| | | | | | | The readAddend() does not depend on MipsRelocationHandler and should not be its member function. llvm-svn: 234154
* [Mips] Reformat the code with clang-formatSimon Atanasyan2015-04-061-1/+2
| | | | llvm-svn: 234153
* [AArch64] Fix error in AARCH64_ADR_GOT_PAGE handlerDenis Protivensky2015-04-061-1/+1
| | | | | | | | | | The error was introduced during mechanical replacement of raw memory reads/writes to use readxxle/writexxle functions in r230725. Noted and fixed by Suprateeka R Hegde <hegdesmailbox@gmail.com> llvm-svn: 234144
* Strip .strtab and .symtab when --strip-all is used.Davide Italiano2015-04-051-9/+16
| | | | | | | | | | This matches other linkers behaviour. Moreover, there's really no need to keep them around. Reported by: Rafael Avila de Espindola PR: 22890 llvm-svn: 234130
* [elf] Fix a silly memory leak. std::string has a non-trivial dtor.Benjamin Kramer2015-04-051-4/+4
| | | | llvm-svn: 234120
* [Mips] Rename MipsLinkingContext class methodSimon Atanasyan2015-04-054-4/+4
| | | | | | getMergeReginfoMask => getMergedReginfoMask llvm-svn: 234116
* [Mips] Support writing .MIPS.options section into the linked fileSimon Atanasyan2015-04-053-15/+78
| | | | | | | | 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] Do not use array initializer to fix Windows build botsSimon Atanasyan2015-04-041-2/+2
| | | | llvm-svn: 234105
* [Mips] Support writing .reginfo section into the linked fileSimon Atanasyan2015-04-047-3/+134
| | | | | | | | | | | 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
* [Hexagon] Remove duplicated typedefSimon Atanasyan2015-04-041-1/+0
| | | | | | The `HexagonELFType` is declared in the HexagonLinkingContext.h. llvm-svn: 234089
* [Hexagon][Mips] Rename template arguments <arch>ELFType to ELFTSimon Atanasyan2015-04-045-55/+46
| | | | | | In all other ELF related classes we use `ELFT` abbreviation. llvm-svn: 234088
* ELF: Use short variable names in <Arch>RelocationHandlers.cpp.Rui Ueyama2015-04-045-142/+108
| | | | | | | | Functions in the files are hard to read because of line wrapping. Use shorter names for local variables so that the lines fit within 80 columns. llvm-svn: 234087
* Remove redundant anonymous namespace.Rui Ueyama2015-04-041-2/+0
| | | | llvm-svn: 234085
* ELF: Merge ELFTargets.h with ELFLinkingContext.h.Rui Ueyama2015-04-047-7/+0
| | | | | | | | These functions are "constructors" of the LinkingContexts. We already have auxiliary classes and functions for ELFLinkingContext in the header. They fall in the same category. llvm-svn: 234082
* ELF: Return TargetRelocationHandler instead of <ArcH>TargetRelocationHandler.Rui Ueyama2015-04-045-5/+5
| | | | | | | | | | getRelocationHandler is a public interface to get an instance of TargetRelocationHandler. We don't use any member function other than applyRelocations to a returned instance. Returning a base class instance suffices here. (If a return type is a derived class, it looks like we were using derived classes features.) llvm-svn: 234081
* Remove a parameter for file extension from canParse.Rui Ueyama2015-04-048-31/+19
| | | | | | | | canParse took three parameters -- file magic, filename extension and memory buffer. All but YAMLReader ignored the second parameter. This patch removes the parameter. llvm-svn: 234080
* ELF: Make private members private.Rui Ueyama2015-04-041-2/+2
| | | | llvm-svn: 234077
* ELF: Remove ELF{Object,DSO}Reader alias templates.Rui Ueyama2015-04-047-24/+12
| | | | | | | | | | Because of the previous change (r234074), ELFObjectReader became just an alias for ELFReader. We can replace all occurrences of ELFObjectReader with ELFReader. In this patch, I also replaced ELFDSOReader to remove the alias template. llvm-svn: 234076
* ELF: Teach File classes about their file magics.Rui Ueyama2015-04-043-8/+13
| | | | | | | | So that we can remove one template parameter from ELFReader. ELF port is heavily templatized, and I want to reduce the usage where possible. llvm-svn: 234074
* s/context/ctx/g on lib/Driver/Driver.cpp.Rui Ueyama2015-04-041-17/+17
| | | | llvm-svn: 234073
* Remove unused member function declarations.Rui Ueyama2015-04-044-4/+0
| | | | llvm-svn: 234072
* Remove unused includes and forward declarations.Rui Ueyama2015-04-043-24/+4
| | | | llvm-svn: 234070
* Remove unused functions.Rui Ueyama2015-04-044-27/+0
| | | | llvm-svn: 234069
* ELF: Define mergeHeaderFlags to ELFLinkingContext.Rui Ueyama2015-04-046-76/+21
| | | | | | | | | | Only MIPS defined the member function, but this feature is not actually MIPS-specific. Also, the dependency to the MIPS-only member function prevented us from merging <Arch>ELF{Object,DSO}Reader classes. This patch moves the feature from MipsLinkingContext to LinkingContext. llvm-svn: 234068
* [ELF] Remove unused typedefSimon Atanasyan2015-04-031-1/+0
| | | | llvm-svn: 234066
* [ELF] Merge Layout and TargetLayout classSimon Atanasyan2015-04-037-95/+52
| | | | | | It is enough to have single TargetLayout class. llvm-svn: 234065
* ELF: Merge ELF{Object,DSO}Reader implementations.Rui Ueyama2015-04-031-43/+12
| | | | | | | The two classes are the same other than a few exceptions. This patch merges them using templates. llvm-svn: 234060
OpenPOWER on IntegriCloud