| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
| |
llvm-svn: 290115
|
|
|
|
|
|
|
|
|
|
|
|
| |
The current implementation of the output section data store commands
can only handle integer literals, but it should really handle arbitrary
expressions [1]. This commit fixes that.
[1] https://sourceware.org/binutils/docs-2.27/ld/Output-Section-Data.html#Output-Section-Data
Differential Revision: https://reviews.llvm.org/D27561
llvm-svn: 289152
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The feature is documented as
-----------------------------
The format of the dynamic list is the same as the version node
without scope and node name. See *note VERSION:: for more
information.
--------------------------------
And indeed qt uses a dynamic list with an 'extern "C++"' in it. With
this patch we support that
The change to gc-sections-shared makes us match bfd. Just because we
kept bar doesn't mean it has to be in the dynamic symbol table.
The changes to invalid-dynamic-list.test and reproduce.s are because
of the new parser.
The changes to version-script.s are the only case where we change
behavior with regards to bfd, but I would like to see a mix of
--version-script and --dynamic-list used in the wild before
complicating the code.
llvm-svn: 289082
|
|
|
|
|
|
| |
Differential revision: https://reviews.llvm.org/D27335
llvm-svn: 288678
|
|
|
|
|
|
| |
Differential revision: https://reviews.llvm.org/D27108
llvm-svn: 288019
|
|
|
|
|
|
| |
This patch rearranges code a bit to make it easy to explain.
llvm-svn: 287515
|
|
|
|
|
|
|
| |
Filler expressions in linker script "=fillexp" are always handled
as 32-bit integers. Thus the new type is more natural.
llvm-svn: 287445
|
|
|
|
| |
llvm-svn: 287324
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Linker script doesn't create a section if it has no content. So the following
script doesn't create .norelocs section if it doesn't have any .rel* sections.
.norelocs : { *(.rel*) }
Later, if you assert that the size of .norelocs is 0, LLD printed out
an error message, because it didn't allow calling SIZEOF() on nonexistent
sections.
This patch allows SIZEOF() on nonexistent sections, so that you can do
something like this.
ASSERT(SIZEOF(.norelocs), "shouldn't contain .rel sections!")
Note that this behavior is compatible with GNU.
Differential Revision: https://reviews.llvm.org/D26810
llvm-svn: 287257
|
|
|
|
|
|
|
|
|
| |
This allows making symbols containing ADDR(section) synthetic,
and defining synthetic symbols outside SECTIONS block.
Differential revision: https://reviews.llvm.org/D25441
llvm-svn: 287090
|
|
|
|
|
|
|
|
|
|
| |
Propagate program headers by walking the commands, not the
sections. This allows us to propagate program headers even from
sections that don't end up in the output.
Fixes pr30997.
llvm-svn: 286837
|
|
|
|
| |
llvm-svn: 286826
|
|
|
|
| |
llvm-svn: 286824
|
|
|
|
|
|
|
|
| |
The disadvantage is that we use uint64_t instad of uint32_t for some
value in 32 bit files. The advantage is a substantially simpler code,
faster builds and less code duplication.
llvm-svn: 286414
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, we do this piece of code to iterate over all input sections.
for (elf::ObjectFile<ELFT> *F : Symtab.getObjectFiles())
for (InputSectionBase<ELFT> *S : F->getSections())
It turned out that this mechanisms doesn't work well with synthetic
input sections because synthetic input sections don't belong to any
input file.
This patch defines a vector that contains all input sections including
synthetic ones.
llvm-svn: 286051
|
|
|
|
|
|
|
|
| |
other minor fixes.
Differential revision: https://reviews.llvm.org/D26320
llvm-svn: 286030
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, it didn't support the character class, so we couldn't
eliminate the use fo llvm::Regex. Now that it is supported, we
can remove compileGlobPattern, which converts a glob pattern to
a regex.
This patch contains optimization for exact/prefix/suffix matches.
Differential Revision: https://reviews.llvm.org/D26284
llvm-svn: 285949
|
|
|
|
|
|
|
|
|
| |
This can speed up lld up to 5 times when linking applications
with large number of sections and using linker script.
Differential revision: https://reviews.llvm.org/D26241
llvm-svn: 285895
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With this patch we keep track of the fact that . is a position in the
file and therefore not absolute. This allow us to compute relative
relocations that involve symbol that are defined in linker scripts
with '.'.
This fixes https://llvm.org/bugs/show_bug.cgi?id=30406
There is still more work to track absoluteness over the various
expressions, but this should unblock linking the EFI bootloader.
llvm-svn: 285641
|
|
|
|
|
|
|
|
|
|
| |
We parse linker scripts very early, but whether an expression is
absolute or not can depend on a symbol defined in a .o. Given that, we
have to delay the computation of IsAbsolute. We can do that by storing
an AST when parsing or by also making IsAbsolute a function like we do
for the expression value. This patch implements the second option.
llvm-svn: 285628
|
|
|
|
|
|
|
|
|
| |
And as a token of the new feature, make ALIGNOF always absolute.
This is a step in making it possible to have non absolute symbols out
of output sections.
llvm-svn: 285608
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, we have a lot of BumpPtrAllocators, but all these
allocators virtually have the same lifetime because they are
not freed until the linker finishes its job. This patch aggregates
them into a single allocator.
Differential revision: https://reviews.llvm.org/D26042
llvm-svn: 285452
|
|
|
|
| |
llvm-svn: 284177
|
|
|
|
|
|
| |
Differential revision: https://reviews.llvm.org/D24298
llvm-svn: 283429
|
|
|
|
|
|
| |
Differential revision: https://reviews.llvm.org/D25242
llvm-svn: 283305
|
|
|
|
|
|
|
|
|
|
| |
If there is not sufficient address space, just give up and don't put
the header in the PT_LOAD.
This matches bfd behaviour and I found at least one script that
depends on having a section at address 0.
llvm-svn: 282750
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The BYTE, SHORT, LONG, and QUAD commands store one, two, four, and eight bytes (respectively).
After storing the bytes, the location counter is incremented by the number of bytes
stored.
Previously our scripts handles these commands incorrectly. For example:
SECTIONS {
.foo : {
*(.foo.1)
BYTE(0x11)
...
We accepted the script above treating BYTE as input section description.
These commands are used in the wild though.
Differential revision: https://reviews.llvm.org/D24830
llvm-svn: 282429
|
|
|
|
|
|
|
|
|
|
|
|
| |
DEFINED(symbol)
Return 1 if symbol is in the linker global symbol table and is defined before
the statement using DEFINED in the script, otherwise return 0.
Can be used to define default values for symbols. Found it in the wild.
Differential revision: https://reviews.llvm.org/D24858
llvm-svn: 282245
|
|
|
|
|
|
| |
Before the symbols were becoming undefined.
llvm-svn: 282159
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is PR30442.
Previously we were failed to parce complex expressions like:
foo : { *(SORT_BY_NAME(bar) zed) }
Main idea of patch that globs and excludes can be wrapped in a SORT.
There is a difference in semanics of ld/gold:
ld likes:
*(SORT(EXCLUDE_FILE (*file1.o) .foo.1))
gold likes:
*(EXCLUDE_FILE (*file1.o) SORT(.foo.1))
Patch implements ld grammar, complex expressions like
next is not a problem anymore:
.abc : { *(SORT(.foo.* EXCLUDE_FILE (*file1.o) .bar.*) .bar.*) }
Differential revision: https://reviews.llvm.org/D24758
llvm-svn: 282078
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit r282021, bringing back r282015.
The problem was that the comparison function was not a strict weak
ordering anymore, which this patch fixes.
Original message:
Only restrict order if both sections are in the script.
This matches gold and bfd behavior and is required to handle some scripts.
The script has to assume where PT_LOADs start in order to align that
spot. If we don't allow section it doesn't know about to move to the
middle, we can need more PT_LOADs and those will not be aligned.
llvm-svn: 282035
|
|
|
|
| |
llvm-svn: 281951
|
|
|
|
| |
llvm-svn: 281817
|
|
|
|
| |
llvm-svn: 281805
|
|
|
|
|
|
| |
It is important to give members names for readability.
llvm-svn: 281803
|
|
|
|
|
|
| |
Because it corresponds to SORT_NONE. None was renamed Default.
llvm-svn: 281776
|
|
|
|
|
|
| |
We have to look at all the relevant input sections at once.
llvm-svn: 281772
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This fixes Bug 30385 - SORT_NONE not implemented,
`SORT_NONE' disables section sorting by ignoring the command line
section sorting option.
That is why this patch also implements --sort-section option.
Description of sorting rules
available at https://sourceware.org/binutils/docs/ld/Input-Section-Wildcards.html
Differential revision: https://reviews.llvm.org/D24604
llvm-svn: 281771
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
of a input section description."
With fix for 2 bots. Details about the fix performed is on a review page.
Initial commit message:
This is PR30387:
From PR description:
We fail to parse
SECTIONS
{
foo :
{
*(sec0 EXCLUDE_FILE (zed1.o) sec1 EXCLUDE_FILE (zed2.o) sec2 )
}
}
The semantics according to bfd are:
Include sec1 from every file but zed1.o
Include sec2 from every file but zed2.o
Include sec0 from every file
Patch implements the support.
Differential revision: https://reviews.llvm.org/D24650
llvm-svn: 281754
|
|
|
|
|
|
| |
Differential revision: https://reviews.llvm.org/D24450
llvm-svn: 281740
|
|
|
|
|
|
|
|
|
|
|
|
| |
This fixes pr30367, but more importantly, it changes how we compute offsets.
Now offset computation in a walk over linker script commands, like the
rest of assignAddresses. IMHO this is simpler to understand and if we
ever have to create multiple outputsections or chunks to change how we
handle test/ELF/linkerscript/alternate-sections.s it should be easier
to do it.
llvm-svn: 281736
|
|
|
|
|
|
|
|
|
| |
middle of a input section description.").
It broke build bot:
http://lab.llvm.org:8011/builders/lld-x86_64-darwin13/builds/27508
llvm-svn: 281723
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
section description.
This is PR30387:
From PR description:
We fail to parse
SECTIONS
{
foo :
{
*(sec0 EXCLUDE_FILE (zed1.o) sec1 EXCLUDE_FILE (zed2.o) sec2 )
}
}
The semantics according to bfd are:
Include sec1 from every file but zed1.o
Include sec2 from every file but zed2.o
Include sec0 from every file
Patch implements the support.
Differential revision: https://reviews.llvm.org/D24650
llvm-svn: 281721
|
|
|
|
|
|
|
|
|
|
|
| |
This is PR30386,
SORT_BY_INIT_PRIORITY is a keyword can be used to sort sections by numerical value of the
GCC init_priority attribute encoded in the section name.
Differential revision: https://reviews.llvm.org/D24611
llvm-svn: 281646
|
|
|
|
| |
llvm-svn: 281449
|
|
|
|
| |
llvm-svn: 281222
|
|
|
|
|
|
| |
Differential revision: https://reviews.llvm.org/D24340
llvm-svn: 281024
|
|
|
|
| |
llvm-svn: 280941
|
|
|
|
|
|
|
|
|
|
| |
Absence of it caused a clang warning:
warning: 'lld::elf::LinkerScriptBase' has virtual functions but non-virtual destructor [-Wnon-virtual-dtor]
At fact we don't need it here because do not destroy this object by
base pointer.
llvm-svn: 280916
|
|
|
|
|
|
| |
Differential revision: https://reviews.llvm.org/D24141
llvm-svn: 280915
|