| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
| |
llvm-svn: 327280
|
|
|
|
| |
llvm-svn: 327272
|
|
|
|
|
|
|
|
| |
AFTER keyword is mandatory and consume() was
used by mistake here. We accepted broken script before
this patch, testcase shows the issue.
llvm-svn: 327260
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
the start of the .got.plt section so that _GLOBAL_OFFSET_TABLE_[0] =
reserved value that is by convention the address of the dynamic section.
Previously we had defined _GLOBAL_OFFSET_TABLE_ as either the start or end
of the .got section with the intention that the .got.plt section would
follow the .got. However this does not always hold with the current
default section ordering so _GLOBAL_OFFSET_TABLE_[0] may not be consistent
with the reserved first entry of the .got.plt.
X86, X86_64, Arm and AArch64 will use the .got.plt. Mips and Power use .got
Fixes PR36555
Differential Revision: https://reviews.llvm.org/D44259
llvm-svn: 327248
|
|
|
|
|
|
|
|
| |
Subscribers: emaste, arichardson, llvm-commits
Differential Revision: https://reviews.llvm.org/D44264
llvm-svn: 327177
|
|
|
|
|
|
|
|
| |
Subscribers: emaste, nemanjai, arichardson, kbarton, llvm-commits
Differential Revision: https://reviews.llvm.org/D44227
llvm-svn: 327156
|
|
|
|
|
|
|
|
|
|
| |
This avoids creating multiple thunks for symbols with aliases or which
belong to ICF'd sections. This patch reduces the size of Chromium for
Android by 260KB (0.8% of .text).
Differential Revision: https://reviews.llvm.org/D44284
llvm-svn: 327154
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Our code assumes all input sections in an output SHF_LINK_ORDER
section has SHF_LINK_ORDER flag. We do not check that and that can cause a crash.
That happens because we call
std::stable_sort(Sections.begin(), Sections.end(), compareByFilePosition);,
where compareByFilePosition predicate does not expect to see
null when calls getLinkOrderDep.
The same might happen when sections refer to non-regular sections.
Test cases demonstrate the issues, patch fixes them.
Differential revision: https://reviews.llvm.org/D44193
llvm-svn: 327006
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This implements INSERT AFTER in a following way:
During reading scripts it collects all insert statements.
After we done and read all files it inserts statements into script commands list.
With that:
* Rest of code does know nothing about INSERT.
* Approach is straightforward and have no visible limitations.
* It is also easy to support INSERT BEFORE (was seen in clang code once).
* Should work for PR35877 and similar cases.
Cons:
* It assumes we have "main" scripts that describes sections.
Differential revision: https://reviews.llvm.org/D43468
llvm-svn: 327003
|
|
|
|
|
|
|
|
| |
We don't need to handle an object file having more than one symbol table,
so as soon as we find the first one, we can process it and then return
from the function.
llvm-svn: 326977
|
|
|
|
|
|
|
|
|
|
| |
addElfSymbols and readJustSymbolsFile still has duplicate code, but
I didn't come up with a good idea to eliminate them. Since this patch
is an improvement, I'm sending this for review.
Differential Revision: https://reviews.llvm.org/D44187
llvm-svn: 326972
|
|
|
|
| |
llvm-svn: 326934
|
|
|
|
| |
llvm-svn: 326933
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It was raised during the review of D43819.
LLD usually use [X, Y] for reporting ranges, like below:
"relocation R_386_16 out of range: 65536 is not in [0, 65535]"
Patch changes rangeToString() to do the same.
Differential revision: https://reviews.llvm.org/D44207
llvm-svn: 326918
|
|
|
|
|
|
| |
This reverts commit r326911 because it was committed by accident.
llvm-svn: 326914
|
|
|
|
| |
llvm-svn: 326912
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
I originally tried to simplify code and then noticed that lld doesn't
do what it tells to the user by warn(). It says "unable to order
discarded symbol" but it actually can for sections eliminated by ICF.
With this patch, lld doesn't sort such sections.
Reviewers: jhenderson, rafael
Subscribers: emaste, arichardson, llvm-commits
Differential Revision: https://reviews.llvm.org/D44180
llvm-svn: 326911
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
LLD uses the debug info and debug line sections to determine the location of
e.g. references to undefined symbols, when producing error messages. In the
event that debug info was present, but debug line parsing failed for some
reason, then a nullptr would end up being dereferenced by the location-lookup
code.
Differential Revision: https://reviews.llvm.org/D44205
Reviewers: grimar
llvm-svn: 326899
|
|
|
|
|
|
|
|
|
|
|
|
| |
With fix: add missing "RUN:" prefix to test case.
Original commit message:
We do not report LMA region overflows currently.
Both GNU linkers do that. The patch implements it.
Differential revision: https://reviews.llvm.org/D44094
llvm-svn: 326895
|
|
|
|
|
|
|
| |
Bots are still unhappy:
http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/26259
llvm-svn: 326894
|
|
|
|
|
|
|
|
|
| |
We do not report LMA region overflows currently.
Both GNU linkers do that. The patch implements it.
Differential revision: https://reviews.llvm.org/D44094
llvm-svn: 326892
|
|
|
|
|
|
|
|
|
| |
Currently, LLD segfaults when linker script attempts to discard
one of the hash sections. This patch fixes that.
Differential revision: https://reviews.llvm.org/D44012
llvm-svn: 326891
|
|
|
|
| |
llvm-svn: 326841
|
|
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D39348
llvm-svn: 326835
|
|
|
|
|
|
|
|
|
|
|
|
| |
It looks like the problem that caused us to originally warn instead of
error was that of a symbol being assigned to the same version twice.
Now we don't warn if a symbol is assigned to the same version twice,
but error if it is assigned to multiple.
This fixes pr28342.
llvm-svn: 326813
|
|
|
|
| |
llvm-svn: 326753
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We do not expand memory region correctly for following scripts:
.foo.1 :
{
*(.foo.1)
. += 0x1000;
} > ram
Patch generalizes expanding of output sections and memory
regions in one place and fixes the issue.
Differential revision: https://reviews.llvm.org/D43999
llvm-svn: 326688
|
|
|
|
|
|
|
|
|
|
|
| |
"division by zero" or "modulo by zero" are not
very informative errors and even probably confusing
as does not let to know that error is coming from linker script.
Patch adds location reporting.
Differential revision: https://reviews.llvm.org/D43934
llvm-svn: 326686
|
|
|
|
|
|
|
| |
Since r321982 we don't set VersionId in scanShlibUndefined, which
makes InVersionScript redundant.
llvm-svn: 326641
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
LLD can not catch a memory area overflow when using a data command.
If we have the script below:
.foo :
{
*(.foo)
BYTE(0x1)
} > ram
where BYTE overflows the ram region, we do not report it currently.
Patch fixes that.
Differential revision: https://reviews.llvm.org/D43948
llvm-svn: 326545
|
|
|
|
|
|
|
|
|
| |
GNU linkers by convention supports both `--foo bar` and `--foo=bar` styles
for all long options that take arguments.
Differential Revision: https://reviews.llvm.org/D43972
llvm-svn: 326506
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
If an executable needs text relocations, it should be marked as such so
that the loader can prepare for text relocations. We currently create a
dummy segment with DT_TEXTREL for that purpose.
Generic ABI as of 2000 [1] mentioned that "Its [DT_TEXTREL's] use
has been superseded by the DF_TEXTREL flag". However, it's actually not
superseded even after 18 years. OpenBSD and musl recognize only DT_TEXTREL.
So we still need to set both.
[1] http://www.sco.com/developers/gabi/2000-07-17/ch5.dynamic.html
Reviewers: rafael
Subscribers: emaste, llvm-commits, arichardson
Differential Revision: https://reviews.llvm.org/D43920
llvm-svn: 326503
|
|
|
|
| |
llvm-svn: 326498
|
|
|
|
|
|
|
|
|
|
|
|
| |
With the current code if the script has a PHDRS we always obey and try
to allocate a header. This can cause Min - HeaderSize to underflow.
It looks like bfd actually prints an error for this case. With this
patch we do the same.
Found while looking at pr36515.
llvm-svn: 326441
|
|
|
|
|
|
|
|
|
|
|
| |
LLD crashes with broken scripts shown in testcase,
because fails to read memory regon name and accesses
MemoryRegions's element which is nullptr.
Patch fixes it.
Differential revision: https://reviews.llvm.org/D43866
llvm-svn: 326431
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is PR36515.
Currenly if we have a script like .debug_info 0 : { *(.debug_info) },
we would not remove this section and keep it in the output.
That does not work, because it is common case for
debug sections to have a zero address expression.
Patch changes behavior so that we remove only sections
that do not use symbols in its expressions.
Differential revision: https://reviews.llvm.org/D43863
llvm-svn: 326430
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, we didn't try to make effort to put .note sections next
to each other in the output file, so two .note sections were likely
to be stored to two separate NOTE segments. That's undesirable because
we should create as few segments as possible in general.
Differential Revision: https://reviews.llvm.org/D43858
llvm-svn: 326410
|
|
|
|
|
|
|
| |
With this the meaning of the Live bit in output sections is clear: we
have at some point added a input section into it.
llvm-svn: 326401
|
|
|
|
|
|
|
|
| |
This patch improves compatibility with GNU linkers.
Differential Revision: https://reviews.llvm.org/D43883
llvm-svn: 326348
|
|
|
|
| |
llvm-svn: 326347
|
|
|
|
| |
llvm-svn: 326344
|
|
|
|
|
|
|
|
|
| |
This should resolve the issue that lld build fails in some hosts
that uses case-insensitive file system.
Differential Revision: https://reviews.llvm.org/D43788
llvm-svn: 326339
|
|
|
|
|
|
|
|
| |
We should process symbols inside output section declarations the same way as top-level ones.
Differential Revision: https://reviews.llvm.org/D43008
llvm-svn: 326305
|
|
|
|
|
|
| |
This patch fixes a minor compatibility issue with ld.gold and ld.bfd.
llvm-svn: 326243
|
|
|
|
|
|
|
| |
With the recent fixes these symbols have more in common than not with
regular undefined symbols.
llvm-svn: 326242
|
|
|
|
|
|
| |
Should fix the build in some bots.
llvm-svn: 326209
|
|
|
|
|
|
|
| |
Now we don't mark a PT_LOAD as readable if all its sections are
SHF_ARM_PURECODE.
llvm-svn: 326207
|
|
|
|
| |
llvm-svn: 326198
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Imagine that we have sections A, B, C, where A == C and
symbol ordering file containing symbols: symC, symB, symA
Previously because of ICF it was possible that final order would be
B, A or B, C. That violates order specified in ordering file.
Patch changes that.
Differential revision: https://reviews.llvm.org/D43234
llvm-svn: 326179
|
|
|
|
|
|
|
|
|
|
|
| |
referenced by DSOs.
It should be possible to resolve undefined symbols in dynamic libraries
using symbols defined in a linker script.
Differential Revision: https://reviews.llvm.org/D43011
llvm-svn: 326176
|