| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
| |
llvm-svn: 321081
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It is currently in InputSectionBase. Only InputSections are used in
ICF, so Repl should be move to InputSection to clear the class
hierarchy or, like this patch does, to SectionBase for convenience.
The convenience of having it on the base class is that we can just
access the replacement without having to first check if it is an
InputSection. It is a bit less code and a bit faster as some of this
code is very hot.
I got up to 1.77% improvement in clang-gdb-index and no regressions
according to lnt.
llvm-svn: 320654
|
|
|
|
|
|
|
|
|
|
|
|
| |
Having a SectionBase method check Repl is inconsistent with how we
handle other section information.
For example, if a section is replaced, Sec->Live is false and it is
natural for Sec->getOutputSection() to be null.
It is the symbol that is moved to the replacement section.
llvm-svn: 320599
|
|
|
|
|
|
|
| |
It is constructed with a kind of Regular and will dyn_cast to
InputSection, but is declared to be an InputSectionBase.
llvm-svn: 320539
|
|
|
|
|
|
|
| |
They were not used in InputFiles.h and it was getting too easy to add
circular includes.
llvm-svn: 320256
|
|
|
|
|
|
|
|
|
|
| |
Since MarkLive.cpp is the place where we set Live flags for
other sections, it looks correct to do that there.
Benefit is that we stop spreading GC logic outsize of MarkLive.cpp.
Differential revision: https://reviews.llvm.org/D40454
llvm-svn: 319435
|
|
|
|
| |
llvm-svn: 319404
|
|
|
|
| |
llvm-svn: 319403
|
|
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D40571
llvm-svn: 319221
|
|
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D40510
llvm-svn: 319108
|
|
|
|
|
|
|
|
|
|
|
|
| |
--emit-relocs is used.
Previously our relocations we rewrote were broken for that case.
We emited incorrect addend and broken relocation info field
because did not produce section symbol for mergeable synthetic sections.
Differential revision: https://reviews.llvm.org/D40070
llvm-svn: 318394
|
|
|
|
| |
llvm-svn: 317781
|
|
|
|
|
|
|
|
|
| |
Now that DefinedRegular is the only remaining derived class of
Defined, we can merge the two classes.
Differential Revision: https://reviews.llvm.org/D39667
llvm-svn: 317448
|
|
|
|
|
|
|
|
|
|
| |
This patch is mechanically created by
sed -i -e s/Body/Sym/g lld/ELF/*.{cpp,h}
and clang-format-diff.
llvm-svn: 317392
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Now that we have only SymbolBody as the symbol class. So, "SymbolBody"
is a bit strange name now. This is a mechanical change generated by
perl -i -pe s/SymbolBody/Symbol/g $(git grep -l SymbolBody lld/ELF lld/COFF)
nd clang-format-diff.
Differential Revision: https://reviews.llvm.org/D39459
llvm-svn: 317370
|
|
|
|
|
|
| |
It is already initialized in header file to same value.
llvm-svn: 317320
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is PR34826.
Currently LLD is unable to report line number when reporting
duplicate declaration of some variable.
That happens because for extracting line information we always use
.debug_line section content which describes mapping from machine
instructions to source file locations, what does not help for
variables as does not describe them.
In this patch I am taking the approproate information about
variables locations from the .debug_info section.
Differential revision: https://reviews.llvm.org/D38721
llvm-svn: 317080
|
|
|
|
|
|
| |
This reverts commit r316305 because performance regression was observed.
llvm-svn: 317026
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is for PR34852.
GCC 8.0 or earlier have a bug that it emits R_386_GOTPC relocations
against _GLOBAL_OFFSET_TABLE for .debug_info. The bug seems to have
been fixed in 2017: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82630,
but we do not want LLD to report errors for such inputs.
In this patch we ignore such relocations.
Differential revision: https://reviews.llvm.org/D38625
llvm-svn: 316761
|
|
|
|
| |
llvm-svn: 316735
|
|
|
|
| |
llvm-svn: 316733
|
|
|
|
| |
llvm-svn: 316732
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
The COFF linker and the ELF linker have long had similar but separate
Error.h and Error.cpp files to implement error handling. This change
introduces new error handling code in Common/ErrorHandler.h, changes the
COFF and ELF linkers to use it, and removes the old, separate
implementations.
Reviewers: ruiu
Reviewed By: ruiu
Subscribers: smeenai, jyknight, emaste, sdardis, nemanjai, nhaehnle, mgorny, javed.absar, kbarton, fedor.sergeev, llvm-commits
Differential Revision: https://reviews.llvm.org/D39259
llvm-svn: 316624
|
|
|
|
|
|
|
| |
ArrayRef<T>() equals to ArrayRef<T>(nullptr, 0), so it looks like
we don't need to handle size 0 as a special case.
llvm-svn: 316600
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We used to have a map from section piece offsets to section pieces
as a cache for binary search. But I found that the map took quite a
large amount of memory and didn't make linking faster. So, in this
patch, I removed the map.
This patch saves 566 MiB of RAM (2.019 GiB -> 1.453 GiB) when linking
clang with debug info, and the link time is 4% faster in that test case.
Thanks for Sean Silva for pointing this out.
llvm-svn: 316305
|
|
|
|
| |
llvm-svn: 316281
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
By assuming that mergeable input sections are smaller than 4 GiB,
lld's memory usage when linking clang with debug info drops from
2.788 GiB to 2.019 GiB (measured by valgrind, and that does not include
memory space for mmap'ed files). I think that's a reasonable assumption
given such a large RAM savings, so this patch.
According to valgrind, gold needs 3.54 GiB of RAM to do the same thing.
NB: This patch does not introduce a limitation on the size of
output sections. You can still create sections larger than 4 GiB.
llvm-svn: 316280
|
|
|
|
|
|
| |
This takes linking the linux kernel from 1.52s to 0.58s.
llvm-svn: 316251
|
|
|
|
| |
llvm-svn: 315654
|
|
|
|
|
|
|
|
| |
A section was passed to getRelExpr just to create an error message.
But if there's an invalid relocation, we would eventually report it
in relocateOne. So we don't have to pass a section to getRelExpr.
llvm-svn: 315552
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We were using uint32_t as the type of relocation kind. It has a
readability issue because what Type really means in `uint32_t Type`
is not obvious. It could be a section type, a symbol type or a
relocation type.
Since we do not do any arithemetic operations on relocation types
(e.g. adding one to R_X86_64_PC32 doesn't make sense), it would be
more natural if they are represented as enums. Unfortunately, that
is not doable because relocation type definitions are spread into
multiple header files.
So I decided to use typedef. This still should be better than the
plain uint32_t because the intended type is now obvious.
llvm-svn: 315525
|
|
|
|
|
|
|
| |
Even though they are called sequentially, they are separate
operations, so it is better to split it.
llvm-svn: 315422
|
|
|
|
|
|
|
|
|
|
|
|
| |
The condition whether a section is alive or not by default
is becoming increasingly complex, so the decision of garbage
collection is spreading over InputSection.h and MarkLive.cpp,
which is not a good state.
This moves the code to MarkLive.cpp, to keep the file the central
place to make decisions about garbage collection.
llvm-svn: 315384
|
|
|
|
|
|
|
|
| |
It did not contain information about relocation type and symbol.
Differential revision: https://reviews.llvm.org/D38623
llvm-svn: 315280
|
|
|
|
| |
llvm-svn: 315271
|
|
|
|
| |
llvm-svn: 315270
|
|
|
|
|
|
|
| |
This patch also moves declarations so that related declarations next
to each other.
llvm-svn: 315266
|
|
|
|
| |
llvm-svn: 315096
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When reporting a symbol conflict, LLD parses the debug info to report
source location information. Sections have not been decompressed at this
point, so if an object file contains zlib compressed debug info, LLD
ends up passing this compressed debug info to the DWARF parser, which
causes debug info parsing failures and can trigger assertions in the
parser (as the test case demonstrates).
Decompress debug sections when constructing the LLDDwarfObj to avoid
this issue. This doesn't handle GNU-style compressed debug info sections
(.zdebug_*), which at present are simply ignored by LLDDwarfObj; those
can be done in a follow-up.
Differential Revision: https://reviews.llvm.org/D38491
llvm-svn: 314866
|
|
|
|
| |
llvm-svn: 314637
|
|
|
|
|
|
|
|
|
|
|
| |
The result of hash_value(StringRef) depends on sizeof(size_t).
That causes lld to create different mergeable table contents on
32-bit machines.
This patch is to use xxHash64 so that we get the same hash values
on 32-bit machines.
llvm-svn: 314603
|
|
|
|
|
|
| |
As suggested in review comments of D38170.
llvm-svn: 314392
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is "Bug 34688 - lld much slower than bfd when linking the linux kernel"
Inside copyRelocations() we have O(N*M) algorithm, where N - amount of
relocations and M - amount of symbols in symbol table. It isincredibly slow
for linking linux kernel.
Patch creates local search tables to speedup.
With this fix link time goes for me from 12.95s to 0.55s what is almost 23x
faster. (used release LLD).
Differential revision: https://reviews.llvm.org/D38129
llvm-svn: 314282
|
|
|
|
|
|
|
|
| |
Fixes PR34660.
Differential Revision: https://reviews.llvm.org/D38053
llvm-svn: 313841
|
|
|
|
|
|
|
| |
It broke selfhosting.
http://lab.llvm.org:8011/builders/clang-with-lto-ubuntu/builds/4896
llvm-svn: 313731
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
EhSectionPiece used to have a pointer to a section, but that pointer was
mostly redundant because we almost always know what the section is without
using that pointer. This patch removes the pointer from the struct.
This patch also use uint32_t/int32_t instead of size_t to represent
offsets that are hardly be larger than 4 GiB. At the moment, I think it is
OK even if we cannot handle .eh_frame sections larger than 4 GiB.
Differential Revision: https://reviews.llvm.org/D38012
llvm-svn: 313697
|
|
|
|
|
|
|
|
|
| |
We crashed when --emit-relocs was used
and relocated section was collected by GC.
Differential revision: https://reviews.llvm.org/D37561
llvm-svn: 313620
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch removes lot of static Instances arrays from different input file
classes and introduces global arrays for access instead. Similar to arrays we
have for InputSections/OutputSectionCommands.
It allows to iterate over input files in a non-templated code.
Differential revision: https://reviews.llvm.org/D35987
llvm-svn: 313619
|
|
|
|
| |
llvm-svn: 313188
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The patch implements initial support of microMIPS code linking:
- Handle microMIPS specific relocations.
- Emit both R1-R5 and R6 microMIPS PLT records.
For now linking mixed set of regular and microMIPS object files is not
supported. Also the patch does not handle (setup and clear) the
least-significant bit of an address which is utilized as the ISA mode
bit and allows to make jump between regular and microMIPS code without
any thunks.
Differential revision: https://reviews.llvm.org/D37335
llvm-svn: 313028
|