summaryrefslogtreecommitdiffstats
path: root/lld/ELF/SyntheticSections.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* [ELF] - Simplify redundant templated call. NFC.George Rimar2017-03-201-4/+2
| | | | llvm-svn: 298244
* [ELF] - Get rid of uintX_t in GdbIndexSection. NFC.George Rimar2017-03-201-2/+2
| | | | llvm-svn: 298243
* [ELF] - Combine LinkerScriptBase and LinkerScript<ELFT>George Rimar2017-03-201-1/+1
| | | | | | | | | | | | Patch removes templated linkerscript class. Unfortunately that required 2 additional static methods findSymbol() and addRegularSymbol() because code depends on Symtab<ELFT>::X Differential revision: https://reviews.llvm.org/D30982 llvm-svn: 298241
* [ELF] clang-format sortMipsSymbols. NFCSimon Atanasyan2017-03-191-1/+2
| | | | llvm-svn: 298230
* Compute Config member function return values only once.Rui Ueyama2017-03-171-17/+17
| | | | | | | | | | | We had a few Config member functions that returns configuration values. For example, we had is64() which returns true if the target is 64-bit. The return values of these functions are constant and never change. This patch is to compute them only once to make it clear that they'll never change. llvm-svn: 298168
* Define Config::isLE and Config::wordsize.Rui Ueyama2017-03-171-4/+4
| | | | | | | isLE() return true if the target is little-endian. wordsize() returns 8 for 64-bit and 4 for 32-bit. llvm-svn: 298167
* [ELF] - Move template instantiations to the end of file. NFC.George Rimar2017-03-171-9/+5
| | | | | | | To be consistent with other code, addresses post commit review comments. llvm-svn: 298102
* [ELF][MIPS] Always collect .reginfo, .MIPS.options, and .MIPS.abiflags input ↵Simon Atanasyan2017-03-171-3/+3
| | | | | | | | | | | sections Do not take in account the `Live` flag while collecting .reginfo, .MIPS.options, and .MIPS.abiflags input sections to produce corresponding output sections. These sections have information purpose and should be always produced per ABI requirements. llvm-svn: 298093
* [ELF] - Detemplate findSection() global static method. NFC.George Rimar2017-03-171-2/+1
| | | | llvm-svn: 298087
* [ELF] - Recommit r298078 "[ELF] - Simplify logic of creating "COMMON" section."George Rimar2017-03-171-19/+9
| | | | | | | | | | | | | | With fix of next warning: Writer.cpp:361:3: warning: suggest parentheses around assignment used as truth value [-Wparentheses] Original commit message: Patch reuses BssSection section to simplify creation of COMMON section. Differential revision: https://reviews.llvm.org/D30690 llvm-svn: 298086
* [ELF] - Revert r298078 and 298082George Rimar2017-03-171-9/+19
| | | | | | It segfaults. llvm-svn: 298084
* [ELF] - Simplify logic of creating "COMMON" section.George Rimar2017-03-171-19/+9
| | | | | | | | | Patch reuses BssSection section to simplify creation of COMMON section. Differential revision: https://reviews.llvm.org/D30690 llvm-svn: 298078
* [ELF] - Detemplate DynamicReloc class. NFC.George Rimar2017-03-171-6/+5
| | | | llvm-svn: 298072
* [ELF] - Detemplate SymbolBody::getVA and SymbolBody::getPltVA. NFC.George Rimar2017-03-171-7/+7
| | | | llvm-svn: 298071
* [ELF] - Detemplate PltSection. NFC.George Rimar2017-03-171-13/+18
| | | | | | | Alternative approach can be remove templated method either, like D31028 do. llvm-svn: 298065
* [ELF] - Recommit "[ELF] - Make Bss and BssRelRo sections to be synthetic (#3)."George Rimar2017-03-171-11/+11
| | | | | | | | | | | | | | | | | | Was fixed, details on review page. Original commit message: That removes CopyRelSection class completely, making Bss/BssRelRo to be just regular synthetics. This is splitted from D30541 and polished. Difference from D30541 that all logic of SharedSymbol converting to DefinedRegular was removed for now and probably will be posted as separate patch. Differential revision: https://reviews.llvm.org/D30892 llvm-svn: 298062
* [ELF] - Rename Config->Is64Bit() to is64(). NFC.George Rimar2017-03-161-4/+4
| | | | | | Addresses post commit review comment. llvm-svn: 297953
* [ELF] - Detemplate SymbolBody::getGotPltVA and ↵George Rimar2017-03-161-1/+1
| | | | | | | | | SymbolBody::getGotPltOffset(). NFC. That opens road to detemplate PltSection<ELFT>, what allows then to detemplate all methods of SymbolBody. llvm-svn: 297950
* [ELF] Fix builbot.George Rimar2017-03-161-1/+1
| | | | | | Excessive typename keyword. llvm-svn: 297949
* [ELF] - Don't use uintX_t in DynamicReloc<ELFT>. NFC.George Rimar2017-03-161-1/+1
| | | | | | | | That allows to detemplate getGotPltOffset/getGotPltVA methods of SymbolBody and also will help to detemplate DynamicReloc itself later. llvm-svn: 297946
* [ELF] - Detemplate SymbolBody::getOutputSection(). NFC.George Rimar2017-03-161-1/+1
| | | | llvm-svn: 297943
* [ELF] Detemplate ThunkSection and Thunk classes. NFC.George Rimar2017-03-161-14/+7
| | | | llvm-svn: 297939
* Revert r297813 "[ELF] - Make Bss and BssRelRo sections to be synthetic (#3)."George Rimar2017-03-161-10/+11
| | | | | | | | | I suppose it is the reason of BB fail: http://lab.llvm.org:8011/builders/clang-cmake-aarch64-lld/builds/921 https://bugs.llvm.org/show_bug.cgi?id=32167 llvm-svn: 297933
* [ELF] - Split struct In<ELFT> to have templated and non-templated sections ↵George Rimar2017-03-151-0/+12
| | | | | | | | | | | | | areas. Patch splits In<ELFT> into 2 classes: one for non-templated sections, second contains ELFT templated ones. That allows to code that was detemplated to access non-templated sections freely, and should open road for futher detemplation proccess. Differential revision: https://reviews.llvm.org/D30939 llvm-svn: 297844
* Use uint32_t for alignment.Rafael Espindola2017-03-151-2/+2
| | | | llvm-svn: 297831
* [ELF] - Detemplate MipsRldMapSection. NFC.George Rimar2017-03-151-10/+4
| | | | | | | | | After introducing Config->is64Bit() and recent changes in LinkerScriptBase, some sections can be detemplated trivially. This is one of such cases. llvm-svn: 297825
* [ELF] - Detemplate StringTableSection.George Rimar2017-03-151-13/+5
| | | | | | | | | | | | | | | | | StringTableSection was <ELFT> templated previously, It disallow to de-template code that uses it, for example LinkerScript<ELFT>::discard uses it as: if (S == In<ELFT>::ShStrTab) error("discarding .shstrtab section is not allowed"); It seems we can try to detemplate some of synthetic sections and somehow make them available for non-templated calls. (move out of In<ELFT> struct probably). Differential revision: https://reviews.llvm.org/D30933 llvm-svn: 297815
* [ELF] - Make Bss and BssRelRo sections to be synthetic (#3).George Rimar2017-03-151-10/+8
| | | | | | | | | | | | | | That removes CopyRelSection class completely, making Bss/BssRelRo to be just regular synthetics. This is splitted from D30541 and polished. Difference from D30541 that all logic of SharedSymbol converting to DefinedRegular was removed for now and probably will be posted as separate patch. Differential revision: https://reviews.llvm.org/D30892 llvm-svn: 297814
* [ELF] - Detemplate GotPltSection and IgotPltSection sections.George Rimar2017-03-151-22/+10
| | | | | | | | | Patch introduces Config->is64Bit() and with help of that detemplates GotPltSection and IgotPltSection sections Differential revision: https://reviews.llvm.org/D30944 llvm-svn: 297813
* [ELF] Propely handle .eh_frame in linker scriptsPetr Hosek2017-03-101-0/+2
| | | | | | | | | | | Using .eh_frame input section pattern in linker script currently causes a crash; this is because .eh_frame input sections require special handling since they're all combined into a synthetic section rather than regular output section. Differential Revision: https://reviews.llvm.org/D30627 llvm-svn: 297501
* [ELF] - Implemented -znotextGeorge Rimar2017-03-091-0/+2
| | | | | | | | | | | | | gold linker manual describes them as: -z text Do not permit relocations in read-only segments -z notext Permit relocations in read-only segments (default) In LLD default is to not permit them. Patch implements -z notext. Differential revision: https://reviews.llvm.org/D30530 llvm-svn: 297366
* Remove DefinedSynthetic.Rafael Espindola2017-03-081-3/+4
| | | | | | | | | | | | | With this we have a single section hierarchy. It is a bit less code, but the main advantage will be in a future patch being able to handle foo = symbol_in_obj; in a linker script. Currently that fails since we try to find the output section of symbol_in_obj. With this we should be able to just return an InputSection from the expression. llvm-svn: 297313
* Use uint32_t for alignment in more places, NFC.Rafael Espindola2017-03-081-1/+1
| | | | llvm-svn: 297305
* Revert r297008: [ELF] - Make Bss and BssRelRo sections to be synthetic (#2).Rui Ueyama2017-03-081-15/+8
| | | | | | | This reverts commit r297008 because it's reported that that change broke AArch64 bots. llvm-svn: 297297
* Remove unnecessary template.Rafael Espindola2017-03-081-3/+2
| | | | llvm-svn: 297293
* Remove unnecessary template. NFC.Rafael Espindola2017-03-081-4/+3
| | | | llvm-svn: 297292
* Rename one of the getOffset methods.Rafael Espindola2017-03-081-3/+4
| | | | | | | It is sufficiently different in that it returns an offset in the input file, not the output section. llvm-svn: 297290
* Remove unnecessary template. NFC.Rafael Espindola2017-03-081-4/+2
| | | | llvm-svn: 297287
* Remove redundant member of InputSectionBase. NFC.Rafael Espindola2017-03-081-3/+4
| | | | | | With this InputSectionBase is now 144 bytes. llvm-svn: 297278
* Finalize content of synthetic sections prior to Thunk CreationPeter Smith2017-03-081-1/+9
| | | | | | | | | | | | This change moves the calls to finalizeContent() for each synthetic section before createThunks(). This will allow us to assign addresses prior to calling createThunks(). As addition of thunks may add to the static symbol table and may affect the size of the mips got section we introduce a couple of additional member functions to update these values. Differential revision: https://reviews.llvm.org/D29983 llvm-svn: 297277
* Remove Config->Rela and define Config->isRela() instead.Rui Ueyama2017-03-071-7/+7
| | | | llvm-svn: 297108
* Remove Config->Mips64EL and define Config->isMips64EL() instead.Rui Ueyama2017-03-071-4/+4
| | | | llvm-svn: 297107
* Detemplate EhInputSection. NFC.Rafael Espindola2017-03-061-6/+6
| | | | llvm-svn: 297077
* Detemplate merge (input and synthetic) sections. NFC.Rafael Espindola2017-03-061-31/+20
| | | | llvm-svn: 297061
* Convert two uses of uintX_t. NFC.Rafael Espindola2017-03-061-2/+3
| | | | llvm-svn: 297059
* [ELF] - Make Bss and BssRelRo sections to be synthetic (#2).George Rimar2017-03-061-8/+15
| | | | | | | | | | | | | | | In compare with D30458, this makes Bss/BssRelRo to be pure synthetic sections. That removes CopyRelSection class completely, making Bss/BssRelRo to be just regular synthetics. SharedSymbols involved in creating copy relocations are converted to DefinedRegular, what also simplifies things. Differential revision: https://reviews.llvm.org/D30541 llvm-svn: 297008
* Split GdbIndexBuilder class into non-member functions.Rui Ueyama2017-03-011-8/+83
| | | | | | | | | | | | That class had three member functions, and all of them are just reader methods that did not depend on class members, so they can be just non- member functions. Probably we should reorganize the functions themselves because their return types doesn't make much sense to me, but for now I just moved these functions out of the class. llvm-svn: 296700
* Remove useless variables and declarations.Rui Ueyama2017-03-011-3/+1
| | | | llvm-svn: 296695
* Inline a function that is too short to be an independent function.Rui Ueyama2017-03-011-10/+7
| | | | llvm-svn: 296686
* Don't implement the gdb hash table as a generic in-memory hash table.Rui Ueyama2017-03-011-0/+1
| | | | | | | | | | | | | | | | | | Looks like .gdb.index and its support classes do things that they don't have to or shouldn't do do. This patch addresses one of these issues. GdbHashTab class is a hash table class. Just like other in-memory hash tables, that incrementally updates its internal data and resizes buckets as new elements are added so that key lookup is always fast. But that is completely not necessary. Unlike debuggers, we only produce hash tables for .gdb.index and never read them. So incrementally updating a hash table in memory is just a waste of resource and complicates the code. What we should do is to accumulate symbols and then create the final hash table at once. llvm-svn: 296678
OpenPOWER on IntegriCloud