| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| |
|
|
| |
llvm-svn: 303961
|
| |
|
|
| |
llvm-svn: 303959
|
| |
|
|
| |
llvm-svn: 303958
|
| |
|
|
| |
llvm-svn: 303948
|
| |
|
|
|
|
|
| |
In this way, the content and the flag is always consistent, which I
think better than removing the bit when input sections reaches the Writer.
llvm-svn: 303926
|
| |
|
|
|
|
|
|
|
|
|
| |
CachedHashStringRef."
This reverts commit r303787.
It caused a slowdown in fast links. That is, links with no debug info
or optimizations.
llvm-svn: 303925
|
| |
|
|
| |
llvm-svn: 303905
|
| |
|
|
|
|
|
|
|
| |
It is not clear why a synthetic section wants to use padding defined
in the linker script. The padding is for the space between sections.
It was also missing a test.
llvm-svn: 303812
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is the only place we use threads for ICF. The intention of this code
was to split an input vector into 256 shards and process them in parallel.
What the code was actually doing was to split an input into 257 shards,
process the first 256 shards in parallel, and the remaining one in serial.
That means this code takes ceil(256/n)+1 instead of ceil(256/n) where n
is the number of available CPU cores. The former converges to 2 while
the latter converges to 1.
This patches fixes the above issue.
llvm-svn: 303797
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
This is required on some platforms, as GNU libstdc++ std::call_once is known to be buggy.
This fixes operation of LLD on at least NetBSD and perhaps OpenBSD and Linux PowerPC.
The same change has been introduced to LLVM and LLDB.
Reviewers: ruiu
Reviewed By: ruiu
Subscribers: emaste, #lld
Tags: #lld
Differential Revision: https://reviews.llvm.org/D33508
llvm-svn: 303788
|
| |
|
|
|
|
|
|
|
|
| |
A variable `ComdatGroup` is not supposed to contain a large number of
items. Even when linking clang, it ends up having only 300K strings.
It doesn't make sense to use CachedHashStringRef for this hash table.
This patch has neutral or slightly positive impact on performance while
reducing code complexity.
llvm-svn: 303787
|
| |
|
|
|
|
|
|
|
|
|
|
| |
This reduces how many times we have to map from OutputSection to
OutputSectionCommand. It is a required step to moving
clearOutputSections earlier.
In order to always use writeTo in OutputSectionCommand we have to call
fabricateDefaultCommands for -r links and move section compression
after it.
llvm-svn: 303784
|
| |
|
|
| |
llvm-svn: 303781
|
| |
|
|
|
|
|
|
| |
dummy sections.
Fix for PR33029.
llvm-svn: 303770
|
| |
|
|
|
|
|
|
|
|
|
| |
Once the dummy linker script is created, we want it to be used for
everything to avoid having two redundant representations that can get
out of sync.
We were already clearing OutputSections. With this patch we clear the
Sections vector of every OutputSection.
llvm-svn: 303703
|
| |
|
|
|
|
|
|
|
| |
By the time we get to linker scripts, all special InputSectionBase
should have been combined into synthetic sections, which are a type of
InputSection. The net result is that we can use InputSection in a few
places that were using InputSectionBase.
llvm-svn: 303702
|
| |
|
|
|
|
|
|
|
| |
If the compiler driver passes --build-id and the user uses -Wl to
pass --build-id= then the user's flag should take precedence.
Differential Revision: https://reviews.llvm.org/D33461
llvm-svn: 303689
|
| |
|
|
|
|
| |
Fix for PR33096.
llvm-svn: 303579
|
| |
|
|
|
|
|
|
|
|
| |
This converts the last (chronologically) user of OutputSections to use
the linker script commands instead.
The idea is to convert all uses after fabricateDefaultCommands, so
that we have a single representation.
llvm-svn: 303384
|
| |
|
|
| |
llvm-svn: 303363
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
GetSection is a template because write calls relocate.
relocate has two parts. The non alloc code really has to be a
template, as it is looking a raw input file data.
The alloc part is only a template because of getSize.
This patch folds the value of getSize early, detemplates
getRelocTargetVA and splits relocate into a templated non alloc case
and a regular function for the alloc case. This has the nice advantage
of making sure we collect all the information we need for relocations
before getting to InputSection::relocateNonAlloc.
Since we know got is alloc, it can just call the function directly and
avoid the template.
llvm-svn: 303355
|
| |
|
|
|
|
| |
Thanks to Andrew Ng for noticing it.
llvm-svn: 303354
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change adds support for the R_ARM_SBREL32 relocation. The relocation
is a base relative relocation that is produced by clang/llvm when -frwpi
is used. The use case for the -frwpi option is position independent data
for embedded systems that do not have a GOT. With -frwpi all data is
accessed via an offset from a base register (usually r9), where r9 is set
at run time to where the data has been loaded. The base of the data is
known as the static base.
The ARM ABI defines the static base as:
B(S) is the addressing origin of the output segment defining the symbol S.
The origin is not required to be the base address of the segment. For
simplicity we choose to use the base address of the segment.
The ARM procedure call standard only defines a read write variant using
R_ARM_SBREL32 relocations. The read-only data is accessed via pc-relative
offsets from the code, this is implemented in clang as -fropi.
Fixes PR32924
Differential Revision: https://reviews.llvm.org/D33280
llvm-svn: 303337
|
| |
|
|
|
|
|
|
|
| |
Nothing special here, just detemplates code that became possible
to detemplate after recent commits in a straghtforward way.
Differential revision: https://reviews.llvm.org/D33234
llvm-svn: 303237
|
| |
|
|
| |
llvm-svn: 303164
|
| |
|
|
| |
llvm-svn: 303155
|
| |
|
|
|
|
| |
Follow up for r303150.
llvm-svn: 303153
|
| |
|
|
|
|
|
|
|
|
| |
SymbolTableBaseSection was introduced.
Detemplation of SymbolTableSection should allow to detemplate more things.
Differential revision: https://reviews.llvm.org/D33124
llvm-svn: 303150
|
| |
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We should only ever expect this function to return a regular
InputSection; I would not expect a function definition to be in a
MergeInputSection or EhInputSection. We were previously crashing
in writeTo if this function returned a section that was not an
InputSection because we do not set OutSec for such sections.
This can happen in practice if a function is defined in an empty
section which shares its offset-in-file with a MergeInputSection,
as in the provided test case.
A better fix for this bug would be to fix the
DWARFUnit::collectAddressRanges() interface to provide section
information (see D33183), but this at least fixes the crash.
Differential Revision: https://reviews.llvm.org/D33176
llvm-svn: 303089
|
| |
|
|
|
|
|
|
| |
Fixes PR33032.
Differential Revision: https://reviews.llvm.org/D33175
llvm-svn: 303088
|
| |
|
|
| |
llvm-svn: 302921
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We used to place orphans by just using compareSectionsNonScript.
Then we noticed that since linker scripts can use another order, we
should first try match the section to a given PT_LOAD. But there is
nothing special about PT_LOAD. The same issue can show up for
PT_GNU_RELRO for example.
In general, we have to search for the most similar section and put the
orphan next to it. Most similar being defined as how long they follow
the same code path in compareSecitonsNonScript.
That is what this patch does. We now compute a rank for each output
section, with a bit for each branch in what was
compareSectionsNonScript.
With this findOrphanPos is now fully general and orphan placement can
be optimized by placing every section with the same rank at once.
The included testcase is a variation of many-sections.s that uses
allocatable sections to avoid the fast path in the existing
code. Without threads it goes form 46 seconds to 0.9 seconds.
llvm-svn: 302903
|
| |
|
|
|
|
|
|
| |
This reverts changes introduced in r302414 "[ELF] - Set DF_STATIC_TLS flag for i386 target."
Because DF_STATIC_TLS does not look to be used by glibc or anything else.
llvm-svn: 302884
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Both gold and bfd restrict that one:
ld.bfd: test.o: relocation R_X86_64_TPOFF32 against `var' can not be
used when making a shared object; recompile with -fPIC
ld.gold: error: test.o: unsupported reloc 23 against global symbol var
What looks reasonable because it is 32 bit one. Patch do the same.
Differential revision: https://reviews.llvm.org/D33100
llvm-svn: 302881
|
| |
|
|
| |
llvm-svn: 302849
|
| |
|
|
| |
llvm-svn: 302848
|
| |
|
|
| |
llvm-svn: 302847
|
| |
|
|
| |
llvm-svn: 302846
|
| |
|
|
|
|
| |
This is a bit hackish, but allows for a lot of followup cleanups.
llvm-svn: 302845
|
| |
|
|
| |
llvm-svn: 302843
|
| |
|
|
| |
llvm-svn: 302832
|
| |
|
|
| |
llvm-svn: 302828
|
| |
|
|
| |
llvm-svn: 302826
|
| |
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D33024
llvm-svn: 302748
|
| |
|
|
| |
llvm-svn: 302719
|
| |
|
|
|
|
| |
So that it is clear that the function is a wrapper for for_each_n.
llvm-svn: 302718
|
| |
|
|
|
|
| |
This improves many-sections.s with a linker script from 22s to 0.9s.
llvm-svn: 302708
|
| |
|
|
|
|
| |
We now always use getCmd. I will optimize it in a followup commit.
llvm-svn: 302706
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously we were not printing out the type of the incompatible section
which made it difficult to determine what the problem was.
The error message format has been change to the following:
error: section type mismatch for .shstrtab
>>> <internal>:(.shstrtab): SHT_STRTAB
>>> output section .shstrtab: Unknown
Patch by Alexander Richardson.
Differential Revision: https://reviews.llvm.org/D32488
llvm-svn: 302694
|