| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
| |
This change simplifies interaction between Writer and the linker script
because we can make needsInterpSection() a file-scope function.
llvm-svn: 276261
|
|
|
|
| |
llvm-svn: 276260
|
|
|
|
|
|
|
|
|
| |
Previously OutputSectionCommand::Filler was introduced, but unused.
Patch fixes that.
Differential revision: https://reviews.llvm.org/D22615
llvm-svn: 276253
|
|
|
|
|
|
|
|
|
|
|
| |
Approach uses LLVM-style RTTI for representing the linker script
commands in a form of tree for future simplification of parsing.
Core idea and code sample belongs to Rui Ueyama.
Differential revision: https://reviews.llvm.org/D22604
llvm-svn: 276243
|
|
|
|
| |
llvm-svn: 276165
|
|
|
|
| |
llvm-svn: 276163
|
|
|
|
| |
llvm-svn: 276162
|
|
|
|
|
|
|
|
|
| |
This patch simplifies output section management by making
Factory class have ownership of sections that creates.
Differential Revision: https://reviews.llvm.org/D22575
llvm-svn: 276141
|
|
|
|
|
|
|
|
|
| |
Previously it was harder to read and also has a error:
command kind was not checked.
Differential revision: https://reviews.llvm.org/D22574
llvm-svn: 276137
|
|
|
|
| |
llvm-svn: 276121
|
|
|
|
| |
llvm-svn: 275972
|
|
|
|
| |
llvm-svn: 275965
|
|
|
|
| |
llvm-svn: 275961
|
|
|
|
| |
llvm-svn: 275959
|
|
|
|
| |
llvm-svn: 275549
|
|
|
|
| |
llvm-svn: 275528
|
|
|
|
|
|
|
|
|
| |
In a linker script, `.` is a special symbol indicating a counter.
Previously, we had two expression types, ExprKind and SymbolAssignmentKind
for `.` and all the other symbol names, respectively. But we could merge
them because the former is a special case of the latter.
llvm-svn: 275527
|
|
|
|
| |
llvm-svn: 275385
|
|
|
|
| |
llvm-svn: 275383
|
|
|
|
| |
llvm-svn: 275158
|
|
|
|
| |
llvm-svn: 274757
|
|
|
|
| |
llvm-svn: 274343
|
|
|
|
| |
llvm-svn: 274342
|
|
|
|
| |
llvm-svn: 274109
|
|
|
|
| |
llvm-svn: 274103
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Example:
VERSION_1.0 {
global: foo*;
local: *; }
now correctly matches all the symbols which name starts with
`foo`.
Differential Revision: http://reviews.llvm.org/D21732
llvm-svn: 274091
|
|
|
|
| |
llvm-svn: 273817
|
|
|
|
|
|
|
|
| |
I think it is me who named these variables, but I always find that
they are slightly confusing because align is a verb.
Adding four letters is worth it.
llvm-svn: 272984
|
|
|
|
|
|
|
|
|
|
| |
the linker script. The cycle in the ELF/LinkerScript.cpp:assignAddresses()
routine will be used to go through all the sections and set all the
addresses correctly.
Add new test to check this case.
llvm-svn: 270090
|
|
|
|
| |
llvm-svn: 268497
|
|
|
|
|
|
|
|
| |
Patch adds support of <,>,!=,==,>=,<= operators.
Differential revision: http://reviews.llvm.org/D19419
llvm-svn: 267382
|
|
|
|
|
|
|
|
| |
Previously, we have re-implemented utility functions such as `expect`
or `next` in LinkerScript.cpp. This patch reuses the existing
implementation that is in ScriptParser.cpp.
llvm-svn: 267255
|
|
|
|
|
|
|
|
|
|
|
| |
ScriptParserBase class is a container of collection of various methods
to parse linker script-ish text. It had a virtual method `run` to run
the parser. But we don't have to enforce its descendents to implement
that. It's up to them.
This patch removes pure virtual function `run`.
llvm-svn: 267246
|
|
|
|
| |
llvm-svn: 267219
|
|
|
|
| |
llvm-svn: 267218
|
|
|
|
|
|
| |
Now it is doable because LinkerScript is a template class.
llvm-svn: 267212
|
|
|
|
|
|
|
|
|
|
|
|
| |
ALIGN(exp)
Return the location counter (.) aligned to the next exp boundary. (https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/4/html/Using_ld_the_GNU_Linker/expressions.html)
Patch implements this command.
This fixes PR27406.
Differential revision: http://reviews.llvm.org/D19364
llvm-svn: 267145
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
expressions"
With fix: removed redundant Dot parameter.
Original commit message:
[ELF] - implemented ternary operator for linkerscript expressions
Patch implements ternary operator for linkerscript expressions.
Like:
SECTIONS {
. = 0x1 ? 0x2 : 0x3;
...
}
Differential revision: http://reviews.llvm.org/D19332
llvm-svn: 267140
|
|
|
|
| |
llvm-svn: 267134
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Patch implements ternary operator for linkerscript expressions.
Like:
SECTIONS {
. = 0x1 ? 0x2 : 0x3;
...
}
Differential revision: http://reviews.llvm.org/D19332
llvm-svn: 267132
|
|
|
|
|
|
| |
This short function was used only once and didn't provide much value.
llvm-svn: 267086
|
|
|
|
|
|
|
|
| |
I will eventually make `evaluate` function a usual parse function
rather than a function that works on a separate token list.
This is the first step toward that.
llvm-svn: 267083
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
You can instruct the linker to not discard sections even if they
are unused and --gc-sections option is given. The linker script
command for doing that is KEEP. The syntax is KEEP(foo) where foo
is a section name. KEEP commands are written in SECTIONS command,
so you can specify the order of sections *and* which sections
will be kept.
Each sub-command in SECTIONS command are translated into SectionRule
object. Previously, each SectionRule has `Keep` bit. However,
if you think about it, this hid information in too deep in elements
of a list. Semantically, KEEP commands aren't really related to
SECTIONS subcommands. We can keep the section list for KEEP in a
separate list. This patch does that.
llvm-svn: 267065
|
|
|
|
|
|
| |
Also changed the function name and added comments.
llvm-svn: 267044
|
|
|
|
| |
llvm-svn: 266978
|
|
|
|
|
|
|
|
|
|
|
| |
SectionOrder vector was a part of LinkerScript class.
It can be removed because Commands vector contains the
same information and SectiorOrder is just a subset.
Differential revision: http://reviews.llvm.org/D19171
llvm-svn: 266974
|
|
|
|
| |
llvm-svn: 266914
|
|
|
|
|
|
|
|
|
| |
Previously the function reads an operator and the rest of
the expressions. This patch makes it to actually parse an expression
which starts with a primary pexression followed by other expressions
concatenated with operators.
llvm-svn: 266912
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Originally, linker scripts were basically an alternative way to specify
options to the command line options. But as we add more features to hanlde
symbols and sections, many member functions needed to be templated.
Now most the members are templated. It is probably time to template the
entire class.
Previously, LinkerScript is an executor of the linker script as well as
a storage of linker script configurations. This is not suitable to template
the class because when we are reading linker script files, we don't know
the ELF type yet, so we can't instantiate ELF-templated classes.
In this patch, I defined a new class, ScriptConfiguration, to store
linker script configurations. ScriptParser writes parse results to it,
and LinkerScript uses them.
Differential Revision: http://reviews.llvm.org/D19302
llvm-svn: 266908
|
|
|
|
| |
llvm-svn: 266816
|