| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
| |
llvm-svn: 277090
|
|
|
|
|
|
| |
Thanks to Rui Ueyama who noticed that.
llvm-svn: 277062
|
|
|
|
|
|
|
|
| |
http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/17294
Change:
std::make_unique -> llvm::make_unique
llvm-svn: 277059
|
|
|
|
|
|
| |
peek()[0] == '*' changed to peek().startswith("*")
llvm-svn: 277043
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Scripts can contain something like:
KEEP (*crtbegin.o(.ctors))
What means that "*crtbegin.o" is a wildcard of file to take the sections from.
This is some kind of opposite to EXCLUDE_FILE and used in FreeBSD script:
https://svnweb.freebsd.org/base/head/sys/conf/ldscript.amd64?revision=284870&view=markup#l122
Patch implements this.
Differential revision: https://reviews.llvm.org/D22852
llvm-svn: 277042
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Sometimes += is used to move the location counter.
Example from the wild is:
.dbg_excpt _DBG_EXCPT_ADDR (NOLOAD) :
{
. += (DEFINED (_DEBUGGER) ? 0x8 : 0x0);
https://github.com/chipKIT32/pic32-Arduino-USB-Bootloader-original/blob/master/boot-linkerscript.ld
Patch implements it and opens way for others type of assignments (-= *= etc), though I think only += is
actual to support.
Differential revision: https://reviews.llvm.org/D22916
llvm-svn: 277035
|
|
|
|
|
|
|
|
|
| |
All other singleton instances are accessible globally.
CommonInputSection shouldn't be an exception.
Differential Revision: https://reviews.llvm.org/D22935
llvm-svn: 277034
|
|
|
|
| |
llvm-svn: 277023
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a bit of an odd feature. It is normally used in
. = SEGMENT_START(seg, val);
In bfd it evaluates to val or to the value of the corresponding
-T<seg>-segment. Note that the -T<seg>-segment in bfd doesn't actually
change the segment address, just the value this evaluates too,
including in the default linker script.
In gold the -T<seg>-segment options do change the segment address and
seeing this expressions in linker scripts disables the options.
For new this just always evaluates the expression to val.
llvm-svn: 277014
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some scripts can contain SORT(CONSTRUCTORS) expression:
https://svnweb.freebsd.org/base/head/sys/conf/ldscript.amd64?revision=284870&view=markup#l152
for ELF it just a nop:
"When linking object file formats which do not support arbitrary sections, such as ECOFF and XCOFF, the linker will automatically recognize C++ global constructors and destructors by name. For these object file formats, the CONSTRUCTORS command tells the linker to place constructor information in the output section where the CONSTRUCTORS command appears. The CONSTRUCTORS command is ignored for other object file formats."
(http://www.sourceware.org/binutils/docs-2.10/ld_3.html)
So patch implements ignoring.
Differential revision: https://reviews.llvm.org/D22848
llvm-svn: 276965
|
|
|
|
| |
llvm-svn: 276868
|
|
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D22795
llvm-svn: 276825
|
|
|
|
| |
llvm-svn: 276794
|
|
|
|
| |
llvm-svn: 276790
|
|
|
|
|
|
| |
http://lab.llvm.org:8011/builders/lld-x86_64-darwin13/builds/25329/steps/build_Lld
llvm-svn: 276789
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
of expression.
In symbol assignments symbol may appear on the right-hand side of the expression:
(https://svnweb.freebsd.org/base/head/sys/conf/ldscript.amd64?revision=284870&view=markup#l8)
kernphys = CONSTANT (MAXPAGESIZE);
. = kernbase + kernphys + SIZEOF_HEADERS;
Patch implements that.
Differential revision: https://reviews.llvm.org/D22759
llvm-svn: 276784
|
|
|
|
|
|
|
|
|
|
|
| |
Output section description can contain ALIGN modificator:
https://sourceware.org/binutils/docs/ld/Output-Section-Description.html#Output-Section-Description
Patch implements it.
Differential revision: https://reviews.llvm.org/D22674
llvm-svn: 276780
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In compare with what GNU linkers do (https://sourceware.org/binutils/docs/ld/Builtin-Functions.html),
this implementation simple:
Do not touch DATA_SEGMENT_ALIGN, it do what it do now - just aligns to the page boundary.
Parameters of DATA_SEGMENT_RELRO_END is ignored. That should be correct as it is usually just a 24 bytes
shift that allows to protect first 3 entries of got.plt with relro.
(https://svnweb.freebsd.org/base/head/sys/conf/ldscript.amd64?revision=284870&view=markup#l146).
DATA_SEGMENT_RELRO_END just aligns to the page boundary.
That is what expected because all sections that are not affected by relro should be on another memory page.
So at fact the difference with documented behavior is that we do not pad DATA_SEGMENT_ALIGN.
3 entries of got.plt are uncovered by relro, but functionality is simple and equal to lld behavior
for case when script is not given.
Differential revision: https://reviews.llvm.org/D22813
llvm-svn: 276778
|
|
|
|
| |
llvm-svn: 276768
|
|
|
|
|
|
|
|
|
|
|
| |
We can simplify the evaluation of DATA_SEGMENT_ALIGN
just to simple align(). That way it will work exactly like we have in non-script case.
Change was suggested by Rafael Ávila de Espíndola
Differential revision: https://reviews.llvm.org/D22807
llvm-svn: 276745
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We can have Opt.Commands size greater then Sections.size().
For example if we have next script:
SECTIONS {
.aaa : { *(.aaa) }
.bbb : { *(.bbb) }
.ccc : { *(.ccc) }
}
and next code:
.global _start
_start:
nop
.section .aaa,"a"
.quad 0
Then amount of sections is less than amound of Opt.Commands
and if we for example have all commands NoConstraint,
that overflowed the iterator used.
llvm-svn: 276741
|
|
|
|
|
|
| |
from ruiu)
llvm-svn: 276731
|
|
|
|
| |
llvm-svn: 276717
|
|
|
|
| |
llvm-svn: 276715
|
|
|
|
|
|
|
|
|
|
|
| |
createSections function is getting longer, so it is time to split it
into small functions. The reason why the function is long is because
it has deeply nested for-loops. This patch constructs temporary data
to reduce nesting level.
Differential Revision: https://reviews.llvm.org/D22786
llvm-svn: 276706
|
|
|
|
|
|
|
|
| |
match() returns true of the first argument, a target string, matches
one of the second argument, a list of glob patterns. Calling the
target string, which is not a glob pattern, "Pattern" was very confusing.
llvm-svn: 276705
|
|
|
|
|
|
|
| |
Because the file from which an input section is created can be
obtained using getFile().
llvm-svn: 276702
|
|
|
|
| |
llvm-svn: 276697
|
|
|
|
|
|
|
|
|
|
|
| |
This will grow because I have a patch to support more complex
constructs, e.g.:
KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
Let's make this a separate function.
llvm-svn: 276695
|
|
|
|
|
|
| |
Re-commit r276543 with a fix for buildbots.
llvm-svn: 276693
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Output section description in SECTIONS looks like that:
section [address] [(type)] :
...
{
...
}
Patch implements support of address atribute.
Differential revision: https://reviews.llvm.org/D22689
llvm-svn: 276619
|
|
|
|
|
|
|
|
|
|
| |
PROVIDE request us to define a symbol only if it is referenced and is
not defined by any object included in the link. We created the
symbol in the symbol table no matter what.
Differential Revision: https://reviews.llvm.org/D22739
llvm-svn: 276592
|
|
|
|
| |
llvm-svn: 276586
|
|
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D22738
llvm-svn: 276579
|
|
|
|
| |
llvm-svn: 276575
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, we handled an expression as a vector of tokens. In other
words, an expression was a vector of uncooked raw StringRefs.
When we need a value of an expression, we used ExprParser to run
the expression.
The separation was needed essentially because parse time is too
early to evaluate an expression. In order to evaluate an expression,
we need to finalize section sizes. Because linker script parsing
is done at very early stage of the linking process, we can't
evaluate expressions while parsing.
The above mechanism worked fairly well, but there were a few
drawbacks.
One thing is that we sometimes have to parse the same expression
more than once in order to find the end of the expression.
In some contexts, linker script expressions have no clear end marker.
So, we needed to recognize balanced expressions and ternary operators.
The other is poor error reporting. Since expressions are parsed
basically twice, and some information that is available at the first
stage is lost in the second stage, it was hard to print out
apprpriate error messages.
This patch fixes the issues with a new approach.
Now the expression parsing is integrated into ScriptParser.
ExprParser class is removed. Expressions are represented as lambdas
instead of vectors of tokens. Lambdas captures information they
need to run themselves when they are created.
In this way, ends of expressions are naturally detected, and
errors are handled in the usual way. This patch also reduces
the amount of code.
Differential Revision: https://reviews.llvm.org/D22728
llvm-svn: 276574
|
|
|
|
| |
llvm-svn: 276543
|
|
|
|
| |
llvm-svn: 276540
|
|
|
|
|
|
|
|
| |
createSections is getting longer, so it is probably time to split.
Differential Revision: https://reviews.llvm.org/D22730
llvm-svn: 276538
|
|
|
|
|
|
|
|
|
| |
Otherwhise undefined references to symbols defined in linker scripts
are never resolved.
Differential Revision: https://reviews.llvm.org/D22664
llvm-svn: 276536
|
|
|
|
|
|
| |
I don't think this typedef contributes to readability.
llvm-svn: 276525
|
|
|
|
| |
llvm-svn: 276524
|
|
|
|
| |
llvm-svn: 276398
|
|
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D22660
llvm-svn: 276384
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
DATA_SEGMENT_END, CONSTANT
It is called basic because:
CONSTANT expression can refer to COMMONPAGESIZE and MAXPAGESIZE.
This sizes are usually different and used for possible optimization of
memory consumption.
More details are here: https://sourceware.org/ml/binutils/2002-02/msg00265.html
We currently do not support this optimization, so both CONSTANT(MAXPAGESIZE)
and CONSTANT(COMMONPAGESIZE) just return Target->PageSize value.
DATA_SEGMENT_ALIGN and DATA_SEGMENT_END are used as a part of opt.
The latter one is just ignored now.
According to documentation DATA_SEGMENT_ALIGN has 2 possible
calculation, but since we do not support mentioned opt - it
is always calculated now as (ALIGN(MAXPAGESIZE) + (. & (MAXPAGESIZE - 1))).
In general this should work for now until we deside to support this opt.
Differential revision: https://reviews.llvm.org/D19663
llvm-svn: 276323
|
|
|
|
| |
llvm-svn: 276322
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It doesn't appear to like this pattern:
for (auto X : Xs)
if (...) { ... }
else ...;
We have heard anecdotes that range based for loops are implemented as a
token rewrite in MSVC's lexer, and that the most challenging part of the
rewrite is finding the end of the for loop. That makes sense, given that
it's a lexer.
llvm-svn: 276315
|
|
|
|
|
|
| |
by grimar)
llvm-svn: 276301
|
|
|
|
|
|
|
|
|
|
| |
LinkerScript<ELFT>::assignAddresses is becoming larger and looks
it can be good time for splitting. I expect to can more SectionsCommand's there,
and dispatching some of them separatelly can help to keep method smaller either.
Differential revision: https://reviews.llvm.org/D22506
llvm-svn: 276300
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds InputSectionDescription command to represent
the input section declaration.
This leads to next cleanup:
SectionRule removed.
ScriptConfiguration::Sections mamber removed.
LinkerScript<ELFT>::getOutputSection() removed.
Differential revision: https://reviews.llvm.org/D22617
llvm-svn: 276283
|