summaryrefslogtreecommitdiffstats
path: root/lld/ELF/LinkerScript.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Inline small functions that are used only once as lambdas.Rui Ueyama2017-04-051-18/+14
| | | | llvm-svn: 299494
* Add newlines.Rui Ueyama2017-04-051-0/+8
| | | | llvm-svn: 299493
* Make dummy variable's scope smaller.Rui Ueyama2017-04-051-3/+2
| | | | llvm-svn: 299492
* Update comments.Rui Ueyama2017-03-241-3/+3
| | | | llvm-svn: 298669
* [ELF] Allow references to reserved symbols in linker scriptsPetr Hosek2017-03-231-4/+7
| | | | | | | | | This requires collectign all symbols referenced in the linker script and adding them to symbol table as undefined symbol. Differential Revision: https://reviews.llvm.org/D31147 llvm-svn: 298577
* Make elf::ScriptConfig a LinkerScript class member variable.Rui Ueyama2017-03-211-14/+13
| | | | | | | | | | | | LinkerScript used to be a template class, so we couldn't instantiate that class in elf::link. We instantiated ScriptConfig class earlier instead so that the linker script parser can store configurations to the object. Now that LinkerScript is not a template, it doesn't make sense to separate ScriptConfig from LinkerScript. This patch merges them. llvm-svn: 298457
* Rename LinkerScriptBase -> LinkerScript.Rui Ueyama2017-03-211-38/+36
| | | | llvm-svn: 298456
* Sort. NFC.Rui Ueyama2017-03-211-25/+25
| | | | llvm-svn: 298447
* Define Config::Endianness.Rui Ueyama2017-03-211-5/+3
| | | | | | This is a shorthand for `Config->IsLE ? support::little : support::big`. llvm-svn: 298445
* Inline a few functions.Rafael Espindola2017-03-201-24/+6
| | | | | | | I don't foresee having to makes these functions any stricter or fancier, so it probably makes sense to inline them. llvm-svn: 298252
* Initialize dot.Rafael Espindola2017-03-201-0/+1
| | | | | | | This would fix an initialized error found by msan. The error is not showing after r298241, but it is not clear why. llvm-svn: 298251
* [ELF] - Reuse Config->IsLE. NFC.George Rimar2017-03-201-4/+1
| | | | llvm-svn: 298242
* [ELF] - Combine LinkerScriptBase and LinkerScript<ELFT>George Rimar2017-03-201-44/+61
| | | | | | | | | | | | 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] - Apply clang-format. NFC.George Rimar2017-03-201-3/+3
| | | | llvm-svn: 298240
* Handle & and | of non abs values.Rafael Espindola2017-03-171-3/+19
| | | | | | | Handling & in particular is probably important because of its use in aligning addresses. llvm-svn: 298096
* Refuse to add two non absolute symbols.Rafael Espindola2017-03-171-0/+2
| | | | | | | Since there is no way to produce the correct answer at runtime, it is probably better to just err. llvm-svn: 298094
* Support non abs values in the rhs of +.Rafael Espindola2017-03-171-0/+2
| | | | llvm-svn: 298088
* Change our linker script expr representation.Rafael Espindola2017-03-171-82/+116
| | | | | | | | | | | | | | This fixes pr32031 by representing the expressions results as a SectionBase and offset. This allows us to use an input section directly instead of getting lost trying to compute an offset in an outputsection when not all the information is available yet. This also creates a struct to represent the *value* of and expression, allowing the expression itself to be a simple typedef. I think this is easier to read and will make it easier to extend the expression computation to handle more complicated cases. llvm-svn: 298079
* Remove unnecessary (). NFC.Rafael Espindola2017-03-171-2/+2
| | | | llvm-svn: 298076
* [ELF] - Detemplate SymbolBody::getVA and SymbolBody::getPltVA. NFC.George Rimar2017-03-171-1/+1
| | | | llvm-svn: 298071
* Revert r297850: [ELF] - Linkerscript: make Dot public and remove getDot(). NFC.Rui Ueyama2017-03-161-5/+5
| | | | | | | This reverts commit r297850 because this change was made based on a miscommunication. llvm-svn: 298001
* [ELF] - Detemplate SymbolBody::getOutputSection(). NFC.George Rimar2017-03-161-1/+1
| | | | llvm-svn: 297943
* [ELF] - Linkerscript: make Dot public and remove getDot(). NFC.George Rimar2017-03-151-5/+5
| | | | | | | Suggested by Rui Ueyama, also groups member variables in a single place, while I am here. llvm-svn: 297850
* [ELF] - Move LinkerScript::discard to LinkerScriptBase. NFC.George Rimar2017-03-151-3/+2
| | | | | | Became possible after r297844 llvm-svn: 297848
* Support ABSOLUTE on the right hand side in linker scriptsPetr Hosek2017-03-151-21/+15
| | | | | | | | | | | | This also requires postponing the assignment the assignment of symbols defined in input linker scripts since those can refer to output sections and in case we don't have a SECTIONS command, we need to wait until all output sections have been created and assigned addresses. Differential Revision: https://reviews.llvm.org/D30851 llvm-svn: 297802
* [ELF] - Move members of LinkerScript to LinkerScriptBase. NFC.George Rimar2017-03-141-35/+25
| | | | | | | | | | | | That moves all members that s possible to move for now (all which does not depend on ELFT templating). After that change LinkerScript contains only 8 methods in total, and I believe it is possible to move them all after tweaking other parts of linker. And we will be able to have single class for linkerscript at the end. llvm-svn: 297735
* [ELF] - Remove unnecessary template #6. NFC.George Rimar2017-03-141-4/+3
| | | | llvm-svn: 297734
* [ELF] - Remove unnecessary template #5. NFC.George Rimar2017-03-141-5/+4
| | | | llvm-svn: 297732
* [ELF] - Devirtualize LinkerScriptBase::getOutputSectionSize. NFC.George Rimar2017-03-141-14/+13
| | | | | | It does not use ELFT templates so can be non-virtual. llvm-svn: 297727
* [ELF] - Devirtualize LinkerScriptBase::getOutputSectionGeorge Rimar2017-03-141-13/+12
| | | | | | It does not use ELFT templates so can be non-virtual. llvm-svn: 297725
* [ELF] - Move ThreadBssOffset and Dot to LinkerScriptBase. NFC.George Rimar2017-03-141-5/+5
| | | | | | One more step to combine LinkerScript and LinkerScriptBase. llvm-svn: 297722
* [ELF] - Remove unnecessary template #4. NFC.George Rimar2017-03-141-2/+2
| | | | | | OutputSectionFactory has no ELFT templates anymore. llvm-svn: 297720
* [ELF] - Step to combine LinkerScript and LinkerScriptBaseGeorge Rimar2017-03-141-5/+1
| | | | | | | | | | | | | We can move all not templated functionality to LinkerScriptBase. Patch do that for hasPhdrsCommands() and shows how it helps to detemplate things in other places. Probably we should be able to merge these 2 classes into single one after such steps. Even if not, it still looks as reasonable cleanup for me. Differential revision: https://reviews.llvm.org/D30895 llvm-svn: 297714
* [ELF] Fix LMA offset calculationEugene Leviant2017-03-141-4/+5
| | | | | | Differential revision: https://reviews.llvm.org/D30832 llvm-svn: 297713
* [ELF] - Remove unnecessary template. NFC.George Rimar2017-03-131-5/+1
| | | | llvm-svn: 297622
* Don't pass Dot to every callback.Rafael Espindola2017-03-101-70/+56
| | | | | | It is available from ScriptBase. llvm-svn: 297472
* Use SectionBase for linker script expressions.Rafael Espindola2017-03-101-2/+2
| | | | | | | This is a small step for fixing pr32031, which needs expressions that point to input sections. llvm-svn: 297431
* Handle ":" as a regular token character in linker scripts.Rui Ueyama2017-03-091-51/+62
| | | | | | | | | This is an alternative to https://reviews.llvm.org/D30500 to simplify the version definition parser and allow ":" in symbol names. Differential Revision: https://reviews.llvm.org/D30722 llvm-svn: 297402
* Remove DefinedSynthetic.Rafael Espindola2017-03-081-47/+29
| | | | | | | | | | | | | 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
* Remove unnecessary template. NFC.Rafael Espindola2017-03-081-1/+1
| | | | llvm-svn: 297287
* Rename Addralign to Alignment.Rafael Espindola2017-03-071-2/+2
| | | | | | It now matches the name used in InputSectionBase. llvm-svn: 297144
* Simplify. NFC.Rafael Espindola2017-03-011-1/+1
| | | | llvm-svn: 296620
* Simplify. NFC.Rafael Espindola2017-03-011-9/+5
| | | | llvm-svn: 296619
* De-template DefinedRegular.Rui Ueyama2017-02-281-5/+4
| | | | | | Differential Revision: https://reviews.llvm.org/D30348 llvm-svn: 296508
* Move SymbolTableSection::getOutputSection to SymbolBody::getOutputSection.Rui Ueyama2017-02-281-1/+1
| | | | | | | | | That function doesn't use any member of SymbolTableSection, so I couldn't see a reason to make it a member of that class. The function takes a SymbolBody, so it is more natural to make it a member of SymbolBody. llvm-svn: 296433
* De-template SyntheticSection.Rui Ueyama2017-02-271-1/+1
| | | | | | This class didn't use ELFT. llvm-svn: 296313
* Move SymbolTable<ELFT>::Sections out of the class.Rui Ueyama2017-02-271-2/+2
| | | | | | | | | | The list of all input sections was defined in SymbolTable class for a historical reason. The list itself is not a template. However, because SymbolTable class is a template, we needed to pass around ELFT to access the list. This patch moves the list out of the class so that it doesn't need ELFT. llvm-svn: 296309
* De-template OutputSectionFactory.Rui Ueyama2017-02-271-5/+4
| | | | | | | Since OutputSection is no longer a template, it doesn't make much sense to tempalte its factory class. llvm-svn: 296308
* Remove useless template so that Out<ELFT> becomes just Out.Rui Ueyama2017-02-271-2/+2
| | | | llvm-svn: 296307
* Merge OutputSectionBase and OutputSection. NFC.Rafael Espindola2017-02-241-30/+24
| | | | | | | Now that all special sections are SyntheticSections, we only need one OutputSection class. llvm-svn: 296127
OpenPOWER on IntegriCloud