| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
| |
Differential revision: https://reviews.llvm.org/D25232
llvm-svn: 283307
|
|
|
|
|
|
| |
Differential revision: https://reviews.llvm.org/D25242
llvm-svn: 283305
|
|
|
|
|
|
|
|
|
| |
We were implicitly creating space for the headers. That is not the
behaviour of bfd, which requires the script to use SIZEOF_HEADERS. The
difference is important for scripts that don't use SIZEOF_HEADERS and
expect the first section to be at 0.
llvm-svn: 282818
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
| |
This options issupported by both BFD ld and gold and allows
overriding the max page size whose default values are defined by
the target.
https://llvm.org/bugs/show_bug.cgi?id=30541
Differential Revision: https://reviews.llvm.org/D24891
llvm-svn: 282596
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
llvm-svn: 282395
|
|
|
|
| |
llvm-svn: 282307
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We were counting the size of the bss section holding common symbols twice:
Dot += CurOutSec->getSize();
flush();
The new code is also simpler as now flush is the only function that
inserts in AlreadyOutputOS, which makes sense since the set hold fully
output sections.
llvm-svn: 282285
|
|
|
|
| |
llvm-svn: 282268
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously we failed to parse next scripts because disallowed
a space between filler value and '=':
.text : {
...
} :text = 0x9090
Differential revision: https://reviews.llvm.org/D24831
llvm-svn: 282248
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
| |
Found this operators used in the wild scripts, for example:
__got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
__fixup_entries = (. - _FIXUP_TABLE_)>>2;
Differential revision: https://reviews.llvm.org/D24860
llvm-svn: 282243
|
|
|
|
|
|
| |
This fixes a case where we would produce an unaligned PT_LOAD.
llvm-svn: 282180
|
|
|
|
|
|
|
| |
With the recent changes there should always be a 1:1 correspondence in
the correct order between OutputSections and OutputSectionCommands.
llvm-svn: 282176
|
|
|
|
|
|
|
| |
This also fixes the linker script accounting for the ELF header in
some places but not in others.
llvm-svn: 282173
|
|
|
|
|
|
|
| |
It doesn't matter which direction we rotate and we haven't really
started optimizing the linker script code, so keep this simple.
llvm-svn: 282166
|
|
|
|
|
|
| |
Before the symbols were becoming undefined.
llvm-svn: 282159
|
|
|
|
| |
llvm-svn: 282149
|
|
|
|
| |
llvm-svn: 282147
|
|
|
|
|
|
|
|
|
|
| |
The actual logic is to keep the output section if the output section
would have been ro/rw.
This is both simpler and more practical, as the intention is linker
scripts is to always keep of of a pair of ONLY_IF_RO/ONLY_IF_RW.
llvm-svn: 282099
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
When final image has several .bss sections, lld fails
because second .bss always has zero VA. This causes
link error "Not enough space for ELF and program headers"
llvm-svn: 282067
|
|
|
|
|
|
|
|
|
|
|
| |
It is not only a bit more straightforward now, but also next 2 issues are solved:
* It just crashed on ".foo : { *(EXCLUDE_FILE (*file1.o)) }" before.
* It accepted multiple EXCLUDE_FILEs in a row.
Differential revision: https://reviews.llvm.org/D24726
llvm-svn: 282060
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
This reverts commit r282015. It broke some bots.
llvm-svn: 282021
|
|
|
|
|
|
|
|
|
|
| |
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: 282015
|
|
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D24685
llvm-svn: 282006
|
|
|
|
|
|
|
| |
We were already not creating them, and with this other parts of the
code don't have to worry about them.
llvm-svn: 281968
|
|
|
|
| |
llvm-svn: 281901
|
|
|
|
|
|
|
|
|
| |
Will Dietz found and reported that lld does not compile with gcc 6.2.0,
more details https://llvm.org/bugs/show_bug.cgi?id=30438
And confirmed this change fixes the issue.
llvm-svn: 281900
|
|
|
|
| |
llvm-svn: 281836
|
|
|
|
| |
llvm-svn: 281835
|
|
|
|
|
|
|
|
|
|
|
| |
Our implementation supported integer value previously.
ld can use expression,
for example, it is OK to write
. = SEGMENT_START("foobar", .);
Patch implements that.
llvm-svn: 281831
|
|
|
|
|
|
|
|
|
| |
It was possible situation about some commands just were not processed
(were skipped) because of a bug appeared when constraint checking used.
Testcase is attached.
llvm-svn: 281818
|
|
|
|
|
|
| |
It is important to give members names for readability.
llvm-svn: 281803
|
|
|
|
| |
llvm-svn: 281802
|
|
|
|
| |
llvm-svn: 281801
|
|
|
|
| |
llvm-svn: 281794
|
|
|
|
|
|
|
|
|
|
|
|
| |
This matches gold and bfd, and is pretty much required by some linker
scripts. They end with commands like
foo 0 : { *(bar) }
if we put any SHF_ALLOC sections after they can have an address that
is too low.
llvm-svn: 281778
|
|
|
|
|
|
| |
Because it corresponds to SORT_NONE. None was renamed Default.
llvm-svn: 281776
|
|
|
|
|
|
|
| |
This matches bfd behavior. It also makes future changes simpler as we
don't have to worry about ignoring these commands in multiple places
llvm-svn: 281775
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
What bfd and gold do is give up in putting the headers in the PT_LOAD
and just start the PT_LOAD in the second page.
llvm-svn: 281660
|