| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
| |
llvm-svn: 285611
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
llvm-svn: 285567
|
|
|
|
|
|
|
|
|
|
|
| |
This patch make lld show following details for undefined symbol errors:
- file (line)
- file (function name)
- file (section name + offset)
Differential revision: https://reviews.llvm.org/D25826
llvm-svn: 285186
|
|
|
|
| |
llvm-svn: 284846
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This script below shouldn't include file and program headers
to PT_LOAD segment, because it doesn't have PHDRS and FILEHDR
attributes:
PHDRS { all PT_LOAD; }
SECTIONS { /* list of sections here */ }
Differential revision: https://reviews.llvm.org/D25774
llvm-svn: 284709
|
|
|
|
|
|
|
|
| |
Previously, we were checking the existence of an entry symbol
too early. It was done before the linker script processor creates
symbols defined in scripts. Fixes bug 30743.
llvm-svn: 284676
|
|
|
|
|
|
| |
Fixes bug 30741.
llvm-svn: 284662
|
|
|
|
|
|
|
| |
This test is failing on FreeBSD bots. This is an attempt to fix it
by not using grep command.
llvm-svn: 284645
|
|
|
|
|
|
|
|
| |
This is what other linkers and clang driver do.
Differential Revision: https://reviews.llvm.org/D25780
llvm-svn: 284634
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Linker scripts may specify PHDRS, but not specify section to
segment assignments, i.e:
PHDRS { seg PT_LOAD; }
SECTIONS {
.sec1 {} : seg
.sec2 {}
}
In such case linker should still choose some segment for .sec2 section.
This patch will add .sec2 to previously opened segments (seg) or to the
very first PT_LOAD segment, if no section-to-segment assignments has been
made
Differential revision: https://reviews.llvm.org/D24795
llvm-svn: 284600
|
|
|
|
|
|
| |
Differential revision: https://reviews.llvm.org/D25729
llvm-svn: 284575
|
|
|
|
| |
llvm-svn: 284474
|
|
|
|
|
|
|
|
|
|
| |
Both gold and ld accepts integers instead of named constants
for PHDRS.
Patch adds support for that.
Differential revision: https://reviews.llvm.org/D25549
llvm-svn: 284470
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is 30646.
PT_OPENBSD_RANDOMIZE
The array element specifies the location and size of a part of the memory image of the program that must be filled with random data before any code in the object is executed. The memory region specified by a segment of this type may overlap the region specified by a PT_GNU_RELRO segment, in which case the intersection will be filled with random data before being marked read-only.
Reference links:
http://man.openbsd.org/OpenBSD-current/man5/elf.5
https://github.com/openbsd/src/commit/c494713c450d98da3f2e1451ee8c7fb675a7c461
Differential revision: https://reviews.llvm.org/D25469
llvm-svn: 284234
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
-z wxneeded creates a PHDR PT_OPENBSD_WXNEEDED.
PT_OPENBSD_WXNEEDED
The array element specifies that a process executing this file may need to be able to map or protect memory regions as simultaneously executable and writable. If the system is unable or unwilling to permit that for this executable then it may fail immediately. This segment type is meaningful only for executable files and is ignored in other objects.
http://man.openbsd.org/OpenBSD-current/man5/elf.5
Differential revision: https://reviews.llvm.org/D25472
llvm-svn: 284226
|
|
|
|
|
|
|
|
|
|
|
|
| |
r283984 introduced a problem of too many warning messages being shown
when -ffunction-sections and -fdata-sections were used in conjunction
with --gc-sections linker flag and debugging information present. This
happens because lot of relocations from .debug_line section may become
invalid in such case. The newer fix doesn't show any warning message but
zeroes OutSec pointer in createInputSectionList() to avoid crash, when
relocations are written
llvm-svn: 284010
|
|
|
|
|
|
| |
Differential revision: https://reviews.llvm.org/D25433
llvm-svn: 283984
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Sometimes the very first PT_LOAD segment, created by lld, can be empty.
This happens when (all conditions met):
- Linker script is used
- First section in ELF image is not RO
- Not enough space for program headers.
Differential revision: https://reviews.llvm.org/D25330
llvm-svn: 283760
|
|
|
|
|
|
| |
Differential revision: https://reviews.llvm.org/D25240
llvm-svn: 283431
|
|
|
|
|
|
| |
Differential revision: https://reviews.llvm.org/D24298
llvm-svn: 283429
|
|
|
|
| |
llvm-svn: 283372
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently lld will implicitly reserve space for the headers. This is
not the case is bfd, where it is the script responsibility to use
SIZEOF_HEADERS. This means that a script not using SIZEOF_HEADERS and
expecting the address of the first section to be 0 would fail with lld.
I am fixing that is the next commit. This one just makes the tests
explicitly use SIZEOF_HEADERS to avoid the dependency on the current
behaviour.
llvm-svn: 282814
|
|
|
|
| |
llvm-svn: 282806
|
|
|
|
|
|
|
|
| |
Since they end up going on the same PT_LOAD, there is no reason to
sort them. This matches bfd's behaviour and is user visible in the
placement of orphan sections.
llvm-svn: 282799
|
|
|
|
|
|
| |
This makes the test less brittle with regards to orphan section placement.
llvm-svn: 282797
|
|
|
|
| |
llvm-svn: 282760
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
| |
If we two sections reside in the same PT_LOAD segment,
we compute second section using the following formula:
Off2 = Off1 + VA2 - VA1. This allows OS kernel allocating
sections correctly when loading an image.
Differential revision: https://reviews.llvm.org/D25014
llvm-svn: 282705
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
| |
This matches the behavior of Binutils linkers. We also change the
default MaxPageSize on x86-64 to 0x1000 to preserver the current
behavior, which is the same as the behavior implemented by gold.
https://llvm.org/bugs/show_bug.cgi?id=30541
Differential Revision: https://reviews.llvm.org/D24987
llvm-svn: 282560
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
Differential revision: https://reviews.llvm.org/D24870
llvm-svn: 282393
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
| |
If section contains local symbols ldd crashes, because local
symbols are added to symbol table before section is discarded
by linker script processor. This patch calls copyLocalSymbols()
after createSections, so discarded section symbols are not copied
llvm-svn: 282244
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
Should fix the windows bots.
llvm-svn: 282181
|
|
|
|
|
|
| |
This fixes a case where we would produce an unaligned PT_LOAD.
llvm-svn: 282180
|
|
|
|
|
|
| |
Before the symbols were becoming undefined.
llvm-svn: 282159
|
|
|
|
| |
llvm-svn: 282149
|
|
|
|
| |
llvm-svn: 282147
|
|
|
|
|
|
| |
This should finally give a stable sorting over all implementations.
llvm-svn: 282118
|
|
|
|
|
|
|
|
|
|
| |
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
|