| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
| |
This is a small optimization and avoids the need to use call_once.
llvm-svn: 328686
|
|
|
|
| |
llvm-svn: 328685
|
|
|
|
|
|
|
| |
We don't support input merge sections larger than 4gb, so these can be
uint32_t.
llvm-svn: 328684
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some tools (dwarfdump for example) get confused by the current -O0 -r
output since it has multiple copies of .debug_str.
We cannot just merge sections with the same name as they can have
different sh_entsize.
We could have duplicated logic for merging sections based on name and
sh_entsize, but it seems better to just use the existing logic by
enabling optimizations.
llvm-svn: 328640
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The Data member of synthetic section's is not valid and empty. The Data
member is required to be valid by ICF as it is used by ICF to determine
the equality of section contents. Therefore, exclude synthetic sections
from ICF.
Fixes bug PR36910.
Differential Revision: https://reviews.llvm.org/D44923
llvm-svn: 328624
|
|
|
|
| |
llvm-svn: 328605
|
|
|
|
| |
llvm-svn: 328604
|
|
|
|
|
|
|
|
|
| |
SharedFile::parseRest function grew organically and got a bit hard to
understand. This patch refactor it. This patch also adds comments.
Differential Revision: https://reviews.llvm.org/D44860
llvm-svn: 328579
|
|
|
|
|
|
| |
Thanks to George Rimar for pointing it out.
llvm-svn: 328571
|
|
|
|
| |
llvm-svn: 328569
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
the .got
When the target saves ElfSym::GlobalOffsetTable in the .got rather than
.got.plt, Target->GotHeaderEntriesNum states the number of extra entries
required in the .got. Rather than having to add Target->GotHeaderEntriesNum to
NumEntries in every function which refers to NumEntries, this patch changes the
initial value of NumEntries in the constructor.
Differential Revision: https://reviews.llvm.org/D44744
llvm-svn: 328559
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently, we might have a bug with scripts like below:
.foo : ALIGN(8)
{
*(.foo)
} > ram
because do not expand the memory region when doing ALIGN.
This might result in file range overlaps. The patch fixes the issue.
Differential revision: https://reviews.llvm.org/D44730
llvm-svn: 328479
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
layout for them.
Currently when we build input sections list in linker script
we ignore all rel[a] sections. That was done to support
scripts like .rela.dyn : { *(.rela.data) } for emit relocs.
Though as a result following scripts were also silently ignored:
/DISCARD/ : { *(.rela.plt)
/DISCARD/ : { *(.rela.dyn)
and we produced output with this sections. That is not ideal.
The solution this patch suggests is simple: do not ignore synthetic
rel[a] sections. That way we can enable common discarding logic
for them and report a proper error.
Differential revision: https://reviews.llvm.org/D41640
llvm-svn: 328419
|
|
|
|
|
|
| |
There were a few too many places duplicating this.
llvm-svn: 328402
|
|
|
|
|
|
|
|
| |
Previously, we used 0 as an alias for VER_NDX_GLOBAL and had a dummy
entry in SharedFile::Verdefs so that the access to the array is within
its boundary. But that's not straightforwad. We can just stop doing both.
llvm-svn: 328401
|
|
|
|
|
|
|
|
| |
Since SectionBase::getOutputSection handles ICF replaces and
SectionBase::getOffset was handling it in some cases, it is more
consistent to have getOffset always handle it.
llvm-svn: 328391
|
|
|
|
|
|
|
| |
SectionBase::getOutputSection handles replacement sections, so this
code doesn't have to.
llvm-svn: 328390
|
|
|
|
|
|
| |
A bug in BFD linker is not our FIXME item.
llvm-svn: 328381
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When looking for the output section and the output offset the
expectation was that the caller had looked at Repl. That works fine
for InputSections, but in the case of MergeInputSections the caller
doesn't have the section that is actually replaced.
The original testcase was failing because getOutputSection was
returning null. The slightly extended testcase also checks that
getOffset also checks Repl.
I will send a refactoring separetelly.
llvm-svn: 328332
|
|
|
|
| |
llvm-svn: 328319
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
proccess .eh_frame"
This fixes PR36367 which is about segfault when --emit-relocs is
used together with .eh_frame sections which happens because
of reordering of regular and .rel[a] sections.
Path changes loop that iterates over input sections to create
relocation target sections first.
Differential revision: https://reviews.llvm.org/D44679
llvm-svn: 328299
|
|
|
|
| |
llvm-svn: 328285
|
|
|
|
|
|
|
| |
With this patch lld will iterate over compile units to find the line
tables instead of assuming there is only one at offset 0.
llvm-svn: 328284
|
|
|
|
| |
llvm-svn: 328195
|
|
|
|
|
|
| |
This is more readable and should reduce the noise in a followup patch.
llvm-svn: 328164
|
|
|
|
|
|
|
|
|
| |
The relocations R_PPC64_REL16_LO and R_PPC64_REL16_HA should return R_PC
for getRelExpr since they compute #lo(S + A – P) and #ha(S + A – P).
Differential Revision: https://reviews.llvm.org/D44648
llvm-svn: 328103
|
|
|
|
|
|
|
|
|
| |
Patch teaches LLD to hint user about -fdebug-types-section flag
if relocation overflow happens in debug section.
Differential revision: https://reviews.llvm.org/D40954
llvm-svn: 328081
|
|
|
|
| |
llvm-svn: 328010
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: ruiu
Subscribers: emaste, arichardson, llvm-commits
Differential Revision: https://reviews.llvm.org/D44690
llvm-svn: 328009
|
|
|
|
|
|
|
|
|
| |
There are no reasons for them to be STV_DEFAULT,
recently bfd did the same change.
Differential revision: https://reviews.llvm.org/D44566
llvm-svn: 327983
|
|
|
|
|
|
|
|
|
|
|
| |
Choosing a Shift2 value based on wordsize is cargo-culted from gold.
Assuming that djb hash is a good hash function, choosing bits [4,9]
shouldn't be any worse or better than choosing bits [5,10]. We shouldn't
have copied that behavior that we can't justify in the first place.
Differential Revision: https://reviews.llvm.org/D44547
llvm-svn: 327921
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
making them warnings.
We found that when you pass --allow-multiple-definitions or `-z muldefs`
to GNU linkers, they don't complain about duplicate symbols at all. They
don't even print out warnings on it. We emit warnings in that case.
If you pass --fatal-warnings, that difference results in a link failure.
Differential Revision: https://reviews.llvm.org/D44549
llvm-svn: 327920
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch adds changes to start supporting the Power 64-Bit ELF V2 ABI.
This includes:
- Changing the ElfSym::GlobalOffsetTable to be named .TOC.
- Creating a GotHeader so the first entry in the .got is .TOC.
- Setting the e_flags to be 1 for ELF V1 and 2 for ELF V2
Differential Revision: https://reviews.llvm.org/D44483
llvm-svn: 327871
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is the same as 327248 except Arm defining _GLOBAL_OFFSET_TABLE_ to
be the base of the .got section as some existing code is relying upon it.
For most Targets the _GLOBAL_OFFSET_TABLE_ symbol is expected to be at
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 and AArch64 will use the .got.plt. Arm, Mips and Power use .got
Fixes PR36555
Differential Revision: https://reviews.llvm.org/D44259
llvm-svn: 327823
|
|
|
|
|
|
|
|
|
|
|
| |
expected to be at"
This change broke ARM code that expects to be able to add
_GLOBAL_OFFSET_TABLE_ to the result of an R_ARM_REL32.
I will provide a reproducer on llvm-commits.
llvm-svn: 327688
|
|
|
|
|
|
|
|
|
|
|
| |
"&" should have higher priority than "|" [1]. Previously, they had
the same priority.
[1] https://sourceware.org/binutils/docs/ld/Operators.html
Differential Revision: https://reviews.llvm.org/D43880
llvm-svn: 327684
|
|
|
|
| |
llvm-svn: 327645
|
|
|
|
|
|
| |
Missed this one.
llvm-svn: 327616
|
|
|
|
|
|
|
| |
Error was:
error: field 'Size' will be initialized after field 'CommandString' [-Werror,-Wreorder]
llvm-svn: 327613
|
|
|
|
|
|
|
|
|
| |
Patch teaches LLD to print BYTE/SHORT/LONG/QUAD and
location move commands to the map file.
Differential revision: https://reviews.llvm.org/D44004
llvm-svn: 327612
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Updates error message for dynamic relocation attempt for read only segments.
Reviewers: ruiu
Reviewed By: ruiu
Subscribers: emaste, javed.absar, arichardson, llvm-commits
Differential Revision: https://reviews.llvm.org/D44453
llvm-svn: 327584
|
|
|
|
|
|
|
|
|
| |
This patch is a simplified version of https://reviews.llvm.org/D42960
written by Andrew Ng.
Differential Revision: https://reviews.llvm.org/D44168
llvm-svn: 327574
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is an option to print out a table of symbols and filenames.
The output format of this option is the same as GNU, so that it can be
processed by the same scripts as before after migrating from GNU to lld.
This option is mildly useful; we can live without it. But it is pretty
convenient sometimes, and it can be implemented in 50 lines of code, so
I think lld should support this option.
Differential Revision: https://reviews.llvm.org/D44336
llvm-svn: 327565
|
|
|
|
| |
llvm-svn: 327555
|
|
|
|
|
|
|
|
| |
This "fixes" PR36678 by just producing an error when we find a case
where we would produce an plt entry that used ebx but ebx would not be
set.
llvm-svn: 327542
|
|
|
|
|
|
|
| |
The code for computing the offset of an entry in the plt is simple,
but it was duplicated in quite a few places.
llvm-svn: 327536
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently, we can end up with NBuckets==0 and android loader
does not like it (PR36537).
Seems we can go with a minimal amount of changes here for simplicity
and be consistent with gold and so just always use >= 1 value for NBuckets.
Differential revision: https://reviews.llvm.org/D44422
llvm-svn: 327481
|
|
|
|
|
|
|
|
|
|
|
| |
This finishes PR35877.
INSERT BEFORE used similar to INSERT AFTER,
it inserts sections before the given target section.
Differential revision: https://reviews.llvm.org/D44380
llvm-svn: 327378
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is part of PR36515.
With some linkerscripts it is possible to get file offset overlaps
and overflows. Currently LLD checks overlaps in checkNoOverlappingSections().
And also we allow broken output with --no-inhibit-exec.
Problem is that sometimes final offset of sections is completely broken
and we calculate output file size wrong and might crash.
Patch implements check to verify that there is no output section
which offset exceeds file size.
Differential revision: https://reviews.llvm.org/D43819
llvm-svn: 327376
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This fixes PR36598.
LLD currently crashes when we have empty output section
with SHF_LINK_ORDER flag. This might happen if we place an
empty synthetic section in the linker script, but keep output
section alive with the use of additional symbol, for example.
The patch fixes the issue by dropping all special flags
for empty sections.
Differential revision: https://reviews.llvm.org/D44376
llvm-svn: 327374
|