| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
| |
llvm-svn: 312820
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This allows combining --dynamic-list and version scripts too. The
version script controls which symbols are visible, and
--dynamic-list controls which of those are preemptible.
Unlike previous versions, undefined symbols are still considered
preemptible, which was the issue breaking the cfi tests.
This fixes pr34053.
llvm-svn: 312806
|
|
|
|
|
|
|
|
|
|
|
|
| |
REGION_ALIAS(alias, region)
Alias names can be added to existing memory regions created with
the MEMORY command. Each name corresponds to at most one
memory region.
Differential revision: https://reviews.llvm.org/D37477
llvm-svn: 312777
|
|
|
|
|
|
|
|
|
|
| |
symbols are preemptible""
This reverts commit r312757.
Evgenii Stepanov reports that it broke some tests.
llvm-svn: 312771
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
preemptible"
If --dynamic-list is given, only those symbols are preemptible.
This allows combining --dynamic-list and version scripts too. The
version script controls which symbols are visible, and --dynamic-list
controls which of those are preemptible.
This fixes pr34053.
llvm-svn: 312757
|
|
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D37524
llvm-svn: 312656
|
|
|
|
| |
llvm-svn: 312655
|
|
|
|
|
|
| |
This reverts commit r311468 because it broke some CFI bots.
llvm-svn: 311497
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Patch by Rafael Espíndola.
This is PR34053.
The implementation is a bit of a hack, given the precise location where
IsPreemtible is set, it cannot be used from
SymbolTable::handleAnonymousVersion.
I could add another method to SymbolTable if you think that would be
better.
Differential Revision: https://reviews.llvm.org/D36499
llvm-svn: 311468
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: This small patch adds the support for ! operator in linker scripts.
Reviewers: ruiu, rafael
Reviewed By: ruiu
Subscribers: meadori, grimar, emaste, llvm-commits
Differential Revision: https://reviews.llvm.org/D36451
llvm-svn: 310607
|
|
|
|
|
|
|
|
|
|
|
|
| |
D35945 introduces change when there is useless to check Error flag
in few places, but ErrorCount must be checked instead.
But then we probably can just check ErrorCount always. That should simplify
things. Patch do that.
Differential revision: https://reviews.llvm.org/D36266
llvm-svn: 310046
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Following possible scripts triggered accessing to Target when it was not yet
initialized (was nullptr).
MEMORY { name : ORIGIN = DATA_SEGMENT_RELRO_END; }
MEMORY { name : ORIGIN = CONSTANT(COMMONPAGESIZE); }
Patch errors out instead.
Differential revision: https://reviews.llvm.org/D36140
llvm-svn: 309953
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
value.
Previously we would crash when tried to ALIGN(0).
Patch uses value 1 instead in this case, that
looks to be consistent with GNU linkers
and reasonable and simple behavior itself.
Differential revision: https://reviews.llvm.org/D35942
llvm-svn: 309372
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a bit of a hack, but it is *so* convenient.
Now that we create synthetic linker scripts when none is provided, we
always have to handle paired OutputSection and OutputsectionCommand and
keep a mapping from one to the other.
This patch simplifies things by merging them and creating what used to
be OutputSectionCommands really early.
llvm-svn: 309311
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch fixes a small issue with respect to how memory region names
are parsed on output section descriptions. For example, consider:
.text : { *(.text) } > rom
That can also be written like:
.text : { *(.text) } >rom
The latter form is accepted by GNU LD and is fairly common.
Differential Revision: https://reviews.llvm.org/D35920
llvm-svn: 309191
|
|
|
|
|
|
|
|
|
| |
Also add the test cases for the addition and subtraction both for
the relative and absolute case.
Differential Revision: https://reviews.llvm.org/D35346
llvm-svn: 308692
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
If the linker is invoked with `--chroot /foo` and `/bar/baz.o`, it
tries to read the file from `/foo/bar/baz.o`. This feature is useful
when you are dealing with files created by the --reproduce option.
Reviewers: grimar
Subscribers: llvm-commits, emaste
Differential Revision: https://reviews.llvm.org/D35517
llvm-svn: 308646
|
|
|
|
|
|
|
|
| |
Functions declared in Strings.h should provide generic string operations
for the linker, but some of them are too specific to some features. This
patch moves them to the location where they are used.
llvm-svn: 307949
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The assignAddresses() function accumulates state in the LinkerScript that
prevents it from being called multiple times. This change moves the state
into a separate structure AddressState that is created at the start of the
function and disposed of at the end.
CurAddressState is used rather than passing a reference to the state as a
parameter to the functions used by assignAddresses(). This is because the
getSymbolValue function needs to be executed in the context of AddressState
but it is stored in ScriptParser when AddressState is not available.
The AddressState is also used in a limited context by processCommands()
Differential Revision: https://reviews.llvm.org/D34345
llvm-svn: 307367
|
|
|
|
|
|
|
|
|
|
| |
Previously, it couldn't parse
SECTIONS .text (0x1000) : { *(.text) }
because "(" was interpreted as the begining of the "(NOLOAD)" directive.
llvm-svn: 305006
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is PR32351
Each output section may have a type. The type is a keyword in parentheses.
(https://sourceware.org/binutils/docs/ld/Output-Section-Type.html#Output-Section-Type)
This patch support only one type, it is NOLOAD.
If output section has such type, we force it to be SHT_NOBITS.
More details are available on a review page.
Differential revision: https://reviews.llvm.org/D33647
llvm-svn: 304925
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When linking linux kernel LLD currently reports next errors:
ld: error: unable to evaluate expression: input section .head.text has no output section assigned
ld: error: At least one side of the expression must be absolute
ld: error: At least one side of the expression must be absolute
That does not provide file/line information and overall looks unclear.
Patch adds location information to ExprValue and that allows
to provide more clear error messages.
Differential revision: https://reviews.llvm.org/D33943
llvm-svn: 304881
|
|
|
|
|
|
|
|
|
|
|
|
| |
This creates a new library called BinaryFormat that has all of
the headers from llvm/Support containing structure and layout
definitions for various types of binary formats like dwarf, coff,
elf, etc as well as the code for identifying a file from its
magic.
Differential Revision: https://reviews.llvm.org/D33843
llvm-svn: 304864
|
|
|
|
|
|
|
|
|
|
|
| |
We were looking up sections by name during expression evaluation. By
keeping track of forward declarations we can do the lookup during
script parsing.
Doing the lookup earlier will be more efficient when assignAddresses
is run twice and removes two uses of OutputSections.
llvm-svn: 304381
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
While the following expression is handled fine:
PROVIDE_HIDDEN(newsym = oldsym + address);
The following expression triggers an error because the expression
is evaluated as absolute:
PROVIDE_HIDDEN(newsym = ALIGN(oldsym, CONSTANT(MAXPAGESIZE)) + address);
To avoid this error, we use late evaluation for ALIGN by making the
alignment an attribute of the expression itself.
Differential Revision: https://reviews.llvm.org/D33629
llvm-svn: 304185
|
|
|
|
|
|
|
|
|
|
|
| |
Switch to llvm::to_integer() everywhere in LLD instead of
StringRef::getAsInteger() because API of latter is confusing.
It returns true on error and false otherwise what makes reading
the code incomfortable.
Differential revision: https://reviews.llvm.org/D33187
llvm-svn: 303149
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Adds support for the ORIGIN and LENGTH linker script built in functions.
ORIGIN(memory) Return the origin of the memory region
LENGTH(memory) Return the length of the memory region
Redo of D29775 for refactored linker script parsing.
Patch by Robert Clarke
Differential Revision: https://reviews.llvm.org/D32934
llvm-svn: 302564
|
|
|
|
|
|
|
|
| |
"read" is used as a prefix for functions that read tokens from input
streams. This function doesn't really read anything, but just parses
a given string as an integer, so rename.
llvm-svn: 300281
|
|
|
|
|
|
|
| |
FILL command doesn't need a semicolon.
Fixes https://bugs.llvm.org/show_bug.cgi?id=32657
llvm-svn: 300280
|
|
|
|
|
|
|
|
|
|
| |
Previously, we allowed only integers in this context. Now you can
write expressions there. LLD is now able to handle the following
linker, for example.
MEMORY { rom (rx) : ORIGIN = (1024 * 1024) }
llvm-svn: 300131
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixes PR32572.
When
(a) a library has no soname
and (b) library is given on the command line with path (and not through -L/-l flags)
DT_NEEDED entry for such library keeps the path as given.
This behavior is consistent with gold and bfd, and is used in compiler-rt test suite.
This is a second attempt after r300007 got reverted. This time relro-omagic test is
changed in a way to avoid hardcoding the path to the test directory in the objdump'd
binary.
llvm-svn: 300011
|
|
|
|
|
|
| |
This reverts commit r300007. Reason: breaks all the bots.
llvm-svn: 300008
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixes PR32572.
When
(a) a library has no soname
and (b) library is given on the command line with path (and not through -L/-l flags)
DT_NEEDED entry for such library keeps the path as given.
This behavior is consistent with gold and bfd, and is used in compiler-rt test suite.
llvm-svn: 300007
|
|
|
|
| |
llvm-svn: 300005
|
|
|
|
|
|
| |
success/failure.
llvm-svn: 299600
|
|
|
|
| |
llvm-svn: 299580
|
|
|
|
| |
llvm-svn: 299579
|
|
|
|
|
|
|
| |
Symbols referenced by linker scripts are not necessarily be undefined,
so the previous name didn't convey the meaining of the variable.
llvm-svn: 299573
|
|
|
|
| |
llvm-svn: 299521
|
|
|
|
| |
llvm-svn: 299520
|
|
|
|
|
|
| |
Looks like we can use consume() in many more places.
llvm-svn: 299519
|
|
|
|
| |
llvm-svn: 299518
|
|
|
|
|
|
| |
This class is used only within this file, so it can be file-local.
llvm-svn: 299516
|
|
|
|
|
|
|
|
| |
LinkerScript.cpp contains both the linker script processor and the
linker script parser. I put both into a single file, but the file grown
too large, so it's time to put them into two different files.
llvm-svn: 299515
|
|
|
|
|
|
|
| |
These files contain a lexer, so the new names are better.
The parser is in LinkerScript.{cpp,h}.
llvm-svn: 295022
|
|
|
|
|
|
| |
{ global : local; local: *; };
llvm-svn: 294343
|
|
|
|
|
|
|
|
|
|
|
| |
This is a fix for Bugzilla 31813.
The problem is that the tokenizer does not create a separate token for
":" unless there's white space before it. Changed it to always create
a token for ":" and reworked some logic that relied on ":" being
attached to some tokens like "global:" and "local:".
llvm-svn: 294006
|
|
|
|
|
|
|
|
| |
- Rename currentBuffer -> getCurrentMB to start it with verb.
- Simplify containsString.
- Add llvm_unreachable at end of getCurrentMB.
llvm-svn: 288310
|
|
|
|
| |
llvm-svn: 288309
|
|
|
|
|
|
| |
This patch also renames currentLocation getCurrentLocation.
llvm-svn: 288308
|