- Oct 11, 2017
-
-
Rui Ueyama authored
"Commands" was ambiguous because in the linker script, everything is a command. We used to handle only SECTIONS commands, and at the time, it might make sense to call them the commands, but it is no longer the case. We handle not only SECTIONS but also MEMORY, PHDRS, VERSION, etc., and they are all commands. llvm-svn: 315409
-
Rui Ueyama authored
HasSections is true if there is at least one SECTIONS linker script command, and it is not directly related to whether we have section objects or not. So I think the new name is better. llvm-svn: 315405
-
Rui Ueyama authored
llvm-svn: 315404
-
Rui Ueyama authored
ScriptConfiguration was a class to contain parsed results of linker scripts. LinkerScript is a class to interpret it. That ditinction was needed because we haven't instantiated LinkerScript early (because, IIRC, LinkerScript class was a ELFT template function). So, when we parse linker scripts, we couldn't directly store the result to a LinkerScript instance. Now, that limitation is gone. We instantiate LinkerScript at the very beginning of our main function. We can directly store parse results to a LinkerScript instance. llvm-svn: 315403
-
Rui Ueyama authored
Because addRegular's functionality is tightly coupled with addSymbol, and the former is called only once, it makes sense to merge the two functions. This patch also adds comments. llvm-svn: 315401
-
Rui Ueyama authored
I think three ctors are too many for this simple class. llvm-svn: 315394
-
Rui Ueyama authored
llvm-svn: 315393
-
Rui Ueyama authored
llvm-svn: 315386
-
Rui Ueyama authored
The condition whether a section is alive or not by default is becoming increasingly complex, so the decision of garbage collection is spreading over InputSection.h and MarkLive.cpp, which is not a good state. This moves the code to MarkLive.cpp, to keep the file the central place to make decisions about garbage collection. llvm-svn: 315384
-
Rafael Espindola authored
llvm-svn: 315377
-
- Oct 10, 2017
-
-
Rafael Espindola authored
We just don't need one with the current setup. We only error on undefined references that are used by some relocation. If we managed to relax all uses of __tls_get_addr, no relocation uses it and we don't produce an error. This is less code and fixes the case were we fail to relax. Before we would produce a broken output, but now we produce an error. llvm-svn: 315334
-
James Henderson authored
When parsing linker scripts, LLD previously started with a '.' value of 0, regardless of the internal default image base for the target, and regardless of switches such as --image-base. It seems reasonable to use a different image base value when using linker scripts and --image-base is specified, since otherwise the switch has no effect. This change does this, as well as removing unnecessary initialisation of Dot where it is not used. The default image base should not be used when processing linker scripts, because this will change the behaviour for existing linker script users, and potentially result in invalid output being produced, as a subsequent assignment to Dot could move the location counter backwards. Instead, we maintain the existing behaviour of starting from 0 if --image-base is not specified. Reviewers: ruiu Differential Revision: https://reviews.llvm.org/D38360 llvm-svn: 315293
-
Andrew Ng authored
When findOrphanPos does the reverse search to find the OutputSection preceding the orphan's insertion point, look for a live OutputSection and ignore "dead" OutputSection's. This matches the behaviour of the forward search performed earlier in this function. Added test which without the above fix fails as a result of an orphan executable section being incorrectly placed in a non-executable segment. Differential Review: https://reviews.llvm.org/D38690 llvm-svn: 315292
-
George Rimar authored
It did not contain information about relocation type and symbol. Differential revision: https://reviews.llvm.org/D38623 llvm-svn: 315280
-
Rui Ueyama authored
llvm-svn: 315271
-
Rui Ueyama authored
llvm-svn: 315270
-
Rui Ueyama authored
llvm-svn: 315269
-
Rui Ueyama authored
llvm-svn: 315268
-
Rui Ueyama authored
llvm-svn: 315267
-
Rui Ueyama authored
This patch also moves declarations so that related declarations next to each other. llvm-svn: 315266
-
Rui Ueyama authored
llvm-svn: 315265
-
- Oct 08, 2017
-
-
Rui Ueyama authored
This should improve consistency. Also added comment. llvm-svn: 315169
-
Rui Ueyama authored
llvm-svn: 315168
-
Rui Ueyama authored
llvm-svn: 315167
-
Rui Ueyama authored
llvm-svn: 315166
-
Rui Ueyama authored
This patch also make its return type to `void` because it always returns a given value as-is. llvm-svn: 315165
-
Rui Ueyama authored
llvm-svn: 315164
-
Rui Ueyama authored
llvm-svn: 315163
-
Rui Ueyama authored
llvm-svn: 315158
-
- Oct 07, 2017
-
-
Rafael Espindola authored
llvm-svn: 315141
-
Rui Ueyama authored
I feel it is easier to understand without this function. llvm-svn: 315140
-
Rui Ueyama authored
llvm-svn: 315139
-
Rui Ueyama authored
Previously, when we added an input section to an output section, we called `OutputSectionFactory::addInputSec`. This isn't a good design because, a factory class is intended to create a new object and return it, but in this use case, it will never create a new object. This patch fixes the design flaw. llvm-svn: 315138
-
Rui Ueyama authored
llvm-svn: 315137
-
Rui Ueyama authored
llvm-svn: 315133
-
Rui Ueyama authored
Factory::addInputSec added an output section to Script->Opt.Commands, but that is too subtle. This patch makes it explicit so that it is easy to see when a new element is added to Script->Opt.Commands. llvm-svn: 315129
-
Rui Ueyama authored
This patch moves a std::find to a new function. It also removes the following piece of code. I believe it should be fine because all tests still pass. unsigned Index = std::distance(Opt.Commands.begin(), I); assert(Sec->SectionIndex == INT_MAX || Sec->SectionIndex == Index); Sec->SectionIndex = Index; llvm-svn: 315125
-
Rui Ueyama authored
addSection function was hard to read because it behaves differently depending on its arguments but what exactly it does is not clear. Now it should be better. Still, it is not clear (not what but) why it does what it does, but I'll take a look at it later. llvm-svn: 315124
-
Peter Collingbourne authored
Reland r315114, "ELF: Export preempted symbols even if there is a dynamic list." which was reverted in r315116. I hadn't synced past the change that changed the default hash style to --hash-style=both, so my test had the symbols in the wrong order. llvm-svn: 315119
-
- Oct 06, 2017
-
-
Peter Collingbourne authored
For some reason the symbols get emitted in the wrong order on one of the buildbots: http://bb9.pgr.jp/#builders/15/builds/180 llvm-svn: 315116
-