summaryrefslogtreecommitdiffstats
path: root/lld/lib/ReaderWriter
Commit message (Collapse)AuthorAgeFilesLines
...
* [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-046-6/+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-047-26/+17
| | | | | | | | 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
* 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-045-75/+18
| | | | | | | | | | 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
* ELF: Remove <Arch>ELFReader.h. NFC.Rui Ueyama2015-04-0310-162/+46
| | | | | | | | | | | <Arch>ELFReader.h contains only a few typedefs. The typedefs are used only by one class in <Arch>TargetHandler.h. Thus, the headers don't worth to be independent files. Since MipsELFReader.h contains code other than the boilerplate, I didn't touch that file in this patch. llvm-svn: 234056
* [ELF] Delete empty TargetLayout class and rename DefaultLayout to TargetLayoutSimon Atanasyan2015-04-039-1037/+1004
| | | | | | No functional changes. llvm-svn: 234052
* ELF: Fix header file dependencies.Rui Ueyama2015-04-036-11/+11
| | | | | | | <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-039-84/+29
| | | | | | | | 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
* Inline typedef'ed type that's used only once. NFC.Rui Ueyama2015-04-031-5/+3
| | | | | | | result_type is no longer part of the type traits, so keeping it here is confusing. llvm-svn: 234044
* [ELF] Fix Layout class name in the commentSimon Atanasyan2015-04-031-2/+2
| | | | | | No functional changes. llvm-svn: 234040
* ELF: Remove partial class definitions of <Arch>LinkingContexts.Rui Ueyama2015-04-037-7/+13
| | | | | | | | | | | | | 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
* Fix for revision r234009 (gcc/msvc compilation differences)Leny Kholodov2015-04-031-1/+1
| | | | llvm-svn: 234014
* [ARM] Implementation of R_ARM_TARGET1 relocationLeny Kholodov2015-04-032-0/+11
| | | | | | | | | | | | | This patch provides implementation of R_ARM_TARGET1 relocation with configuration of its behaviour from a command line. This patch provides two command line options for GnuLd driver: --arm-target1-rel and --arm-target1-abs (similar to ld option names with extra prefix 'arm-'). So user may choose which behaviour of R_ARM_TARGET1 is preferred for his implementation of libc. Differential Revision: http://reviews.llvm.org/D8707 llvm-svn: 234009
* ELF: Remove <Arch>ELFFileCreateELFTraits::result_type.Rui Ueyama2015-04-027-30/+18
| | | | | | | | 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
* [Mips] Inline the MipsELFWriter::hasGlobalGOTEntry functionSimon Atanasyan2015-04-022-6/+2
| | | | | | No functional changes. llvm-svn: 233924
* ELF: Always use variadic templates in CreateELF.h.Rui Ueyama2015-04-021-54/+18
| | | | | | | | Since we no longer support MSVC 2012, we can assume that variadic templates are always supported. This patch removes an #ifdef for C++ compilers that don't support variadic templates. llvm-svn: 233901
* [ARM] Generate PLT entries for calls from ARM and Thumb codeDenis Protivensky2015-04-021-89/+166
| | | | | | | | | | | The function call that goes through PLT table may be performed from both ARM and Thumb code. This situation requires adding a veneer to original PLT code (which is always ARM) to effect Thumb-to-ARM transition. Differential Revision: http://reviews.llvm.org/D8701 llvm-svn: 233900
* [ARM] Report fatal error for wrong ARM entry pointDenis Protivensky2015-04-021-2/+4
| | | | | | | The case is possible with wrong input, so report an error instead of using llvm_unreachable. llvm-svn: 233899
* ELF: Remove {AArch64,X86,X86_64}ELFFile because they are empty.Rui Ueyama2015-04-029-114/+7
| | | | llvm-svn: 233897
* ELF: Replace empty classes with typedefs.Rui Ueyama2015-04-025-74/+15
| | | | llvm-svn: 233896
* ELF: Remove a template parameter from ELF{Object,DOS}Reader constructors.Rui Ueyama2015-04-0213-26/+22
| | | | | | | | | 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: Mips: Remove unused field and almost-empty class.Rui Ueyama2015-04-022-14/+5
| | | | | | | | Looks like MipsTargetHandler::_runtimeFile is unused. MipsRuntimeFile doesn't seem to add values to the base class, so I removed that class too. llvm-svn: 233888
* ELF: Move registerRelocationNames() from TargetHandler to ↵Rui Ueyama2015-04-0226-137/+115
| | | | | | | | | | | | | | | | | | | | | <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
OpenPOWER on IntegriCloud