| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
| |
llvm-svn: 314093
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, we had two levels of hash table lookup. The first hash
lookup uses CachedHashStringRefs as keys and returns offsets in string
table. Then, we did the second hash table lookup to obtain GdbSymbol
pointers. But we can directly map strings to GDbSymbols.
One test file is updated in this patch because we no longer have a '\0'
byte at the start of the string pool, which was automatically inserted
by StringTableBuilder.
This patch speeds up Clang debug build (with -gdb-index) link time by
0.3 seconds.
llvm-svn: 314092
|
|
|
|
|
|
|
|
| |
This change alone speeds up linking of Clang debug build with -gdb-index
by 1.2 seconds, from 12.5 seconds to 11.3 seconds. (Without -gdb-index,
lld takes 8.5 seconds to link the same input files.)
llvm-svn: 314090
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch rewrites a part of GdbIndexSection to address the following
issues in the previous implementation:
- Previously, some struct declarations were in GdbIndex.h while they
were not used in GdbIndex.cpp. Such structs are moved to
SyntheticSection.h.
- The actual implementation were split into GdbIndexSection and GdbHash
section, but that separation didn't make much sense. They are now
unified as GdbIndexSection.
In addition to the above changes, this patch splits functions, rename
variables and remove redundant functions/variables to generally improve
code quality.
llvm-svn: 314084
|
|
|
|
|
|
|
|
|
|
|
|
| |
Its a PR34648 which was a segfault that happened because
we stored pointers to elements in DenseMap.
When DenseMap grows such pointers are invalidated.
Solution implemented is to keep elements by pointer
and not by value.
Differential revision: https://reviews.llvm.org/D38034
llvm-svn: 313741
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
CieRecord is a struct containing a CIE and FDEs, but oftentimes the
struct itself is named `Cie` which caused some confusion. This patch
renames them `CieRecords` or `Rec`.
llvm-svn: 313681
|
|
|
|
| |
llvm-svn: 313667
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
ID sounds like an identifier, but this is actually a pointer to a section.
llvm-svn: 313588
|
|
|
|
|
|
|
|
| |
EhSectionPiece inherited from SectionPiece, but we did not actually use
EhSectionPiece objects as SectionPiece ojbects. They were handled as
distinct types. So it didn't make much sense to use inheritance.
llvm-svn: 313587
|
|
|
|
| |
llvm-svn: 313586
|
|
|
|
|
|
|
|
| |
"Repl" member is guranteed to have a non-null pointer. If an input
section is not merged by ICF, "Repl" points to "this". Otherwise, it
points to some other section. It must not be NULL.
llvm-svn: 313556
|
|
|
|
| |
llvm-svn: 313095
|
|
|
|
|
|
| |
It is not needed since it is always 0.
llvm-svn: 313076
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
to separate commons based on file name patterns. The following linker script
construct does not work because commons are allocated before section placement
is done and the only synthesized BssSection that holds all commons has no file
associated with it:
SECTIONS { .common_0 : { *file0.o(COMMON) }}
This patch changes the allocation of commons to create a section per common
symbol and let the section logic do the layout.
Differential revision: https://reviews.llvm.org/D37489
llvm-svn: 312796
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The default padding for an executable segment is the target trap
instruction which for x86_64 is 0xCC. However, the .eh_frame section
requires the padding to be zero. The code that writes the .eh_frame
section assumes that its segment is zero initialized and does not
explicitly write the zero padding. This does not work when the .eh_frame
section is in the executable segment (for example when using
-no-rosegment).
This patch changes the .eh_frame writing code to explicitly write the
zero padding.
Differential Revision: https://reviews.llvm.org/D37462
llvm-svn: 312706
|
|
|
|
|
|
|
|
| |
Previously it was called twice for .comment synthetic section.
That created 2 pieces of data, which was deduplicated anyways,
but was not clean.
llvm-svn: 312327
|
|
|
|
|
|
|
|
| |
GdbIndexSection doesn't need lazy finalization because when an instance
of the class is created, we already know all debug info sections.
We can initialize the instnace in the ctor.
llvm-svn: 310931
|
|
|
|
| |
llvm-svn: 310930
|
|
|
|
| |
llvm-svn: 310929
|
|
|
|
|
|
|
| |
This function doesn't seem to add value to the symbol table as
it is easy to write code without it.
llvm-svn: 310925
|
|
|
|
|
|
|
|
|
|
|
|
| |
Liveness is usually a notion of input sections, but this patch adds
"liveness" bit to common symbols because they don't belong to any
input section.
This patch is based on https://reviews.llvm.org/D36520
Differential Revision: https://reviews.llvm.org/D36546
llvm-svn: 310617
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With this Symbol has the same size as before, but DefinedRegular goes
from 72 to 64 bytes.
I also find this a bit easier to read. There are fewer places
initializing File for example.
This has a small but measurable speed improvement on all tests (1%
max).
llvm-svn: 310142
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Following r309829, if a string table appears in an executable segment, the strings
will not be null terminated. This is a problem, for example, for the .dynstr
section when using -no-rosegment. The strings end up being terminated with 0xcc
because prior to this patch, LLD did not explicitly write the null terminators.
This change fixes that by always writing the null terminators.
Reviewers: rafael
Differential Revision: https://reviews.llvm.org/D36267
llvm-svn: 310042
|
|
|
|
|
|
|
|
| |
Makes code a bit more convinent to write/read.
Differential revision: https://reviews.llvm.org/D36089
llvm-svn: 310040
|
|
|
|
|
|
|
|
| |
Enables multithreaded .gdb_index building.
Differential revision: https://reviews.llvm.org/D36090
llvm-svn: 309688
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a bit of a hack, but it is *so* convenient.
Now that we create synthetic linker scripts when none is provided, we
always have to handle paired OutputSection and OutputsectionCommand and
keep a mapping from one to the other.
This patch simplifies things by merging them and creating what used to
be OutputSectionCommands really early.
llvm-svn: 309311
|
|
|
|
|
|
|
| |
Rename it because it was too easy to conflict with llvm::object::ObjectFile
which broke buildbots several times.
llvm-svn: 309199
|
|
|
|
|
|
| |
NFC, just makes it easier to access from non templated code.
llvm-svn: 309152
|
|
|
|
|
|
|
|
| |
SHF_GROUP flag should have been removed when the control reaches here
because InputSectionBase turns the flag off. So this code should be
redundant.
llvm-svn: 308680
|
|
|
|
|
|
|
|
|
|
|
| |
With that in place we can use lld's own infrastructure for the low
level detail of dwarf parsing.
With this we don't decompress sections twice, we don't scan all
realocations and even with this simplistic implementation linking
clang with gdb index goes from 34.09 seconds to 20.80 seconds.
llvm-svn: 308544
|
|
|
|
| |
llvm-svn: 308300
|
|
|
|
| |
llvm-svn: 308297
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is PR33766.
-F name
--filter=name
When creating an ELF shared object, set the internal DT_FILTER field to the specified name. This tells the dynamic linker that the symbol table of the shared object which is being created should be used as a filter on the symbol table of the shared object name.
If you later link a program against this filter object, then, when you run the program, the dynamic linker will see the DT_FILTER field. The dynamic linker will resolve symbols according to the symbol table of the filter object as usual, but it will actually link to the definitions found in the shared object name. Thus the filter object can be used to select a subset of the symbols provided by the object name.
(https://linux.die.net/man/1/ld).
Shared Objects as Filters:
https://docs.oracle.com/cd/E19683-01/817-3677/chapter4-31738/index.html
Differential revision: https://reviews.llvm.org/D35352
llvm-svn: 308167
|
|
|
|
|
|
|
|
|
|
| |
In filling the .got sections, InputSection::OutSecOff was added twice
when finding the position to apply a relocation: first time in
InputSection::writeTo() and then in SectionBase::getOffset().
Differential revision: https://reviews.llvm.org/D34232
llvm-svn: 308003
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I have a patch to let DwarfContext defer to lld for getting section
contents and relocations.
That is a pretty big performance improvement.
This is just a refactoring to make that easier to do.
This change makes the *creation* of gdb index a dedicated step and
makes that templated. That is so that we can uses Elf_Rel in the code.
llvm-svn: 307867
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
-gdb-index building
This is relative to PR33173,
Previously if something wrong happened on DWARF parsers side during parsing
object for building gdb index (like was in PR: unsupported relocation)
then LLD continued and finished the link. DWARF parsers sure showed error
message on their side, but that is all.
Patch changes behavior to fail the link in this case and show more
detailed message.
Differential revision: https://reviews.llvm.org/D34814
llvm-svn: 307370
|
|
|
|
|
|
|
| |
This avoids having to compute relocation section sizes early, removing
the last use of assignOffsets.
llvm-svn: 307219
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add support for the most common SPARC relocations.
Make DT_PLTGOT point to the PLT on SPARC.
Mark the PLT as executable on SPARC.
This adds a basic test that creates a SPARV9 executable
that invokes the exit system call on OpenBSD.
Patch by Mark Kettenis.
Differential Revision: https://reviews.llvm.org/D34618
llvm-svn: 306565
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This fixes PR33598.
Size field for undefined symbols is not significant.
Setting it to fixed value, like zero, may be useful though.
For example when we have 2 DSO's, like in this PR, if lower level DSO may
change slightly (in part of some symbol's st_size) and higher-level DSO is
rebuilt, then tools that monitoring checksum of high level DSO file can notice
it and trigger cascade of some other unnecessary actions.
If we set st_size to zero, that can be avoided.
Differential revision: https://reviews.llvm.org/D34673
llvm-svn: 306526
|
|
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D34093
llvm-svn: 305176
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
SyntheticSections.cpp:1773:29: error: chosen constructor is explicit in copy-initialization
CuVectors.push_back({});
^~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/set:428:14: note: constructor declared here
explicit set(const value_compare& __comp = value_compare())
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/vector:702:59: note: passing argument to parameter '__x' here
_LIBCPP_INLINE_VISIBILITY void push_back(value_type&& __x);
llvm-svn: 305054
|
|
|
|
|
|
|
|
|
|
|
|
| |
paralleling.
This patch reimplements .gdb_index in more natural way,
that makes proccess of switching to multithreaded index building to
be trivial.
Differential revision: https://reviews.llvm.org/D33552
llvm-svn: 304927
|
|
|
|
| |
llvm-svn: 304914
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Approach significantly simplifies LLD .gdb_index code and makes it much faster.
Also it should resolve issues, like D33176 tries to address once and forever in a clean way.
LLC binary linking without patch and without --gdb-index: 1,599241063
LLC binary linking without patch and with --gdb-index: 6,064316262
LLC binary linking with patch and with --gdb-index: 4,116792104
Time spent for building gdbindex changes from (6,064316262 - 1,599241063 == 4,465075199)
to (4,116792104- 1,599241063 == 2,517551041).
That is 2,517551041/4,465075199 = 0,564 or about 44% speedup.
Differential revision: https://reviews.llvm.org/D33183
llvm-svn: 304895
|
|
|
|
|
|
|
|
|
|
|
|
| |
This creates a new library called BinaryFormat that has all of
the headers from llvm/Support containing structure and layout
definitions for various types of binary formats like dwarf, coff,
elf, etc as well as the code for identifying a file from its
magic.
Differential Revision: https://reviews.llvm.org/D33843
llvm-svn: 304864
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before InputSectionBase had an OutputSection pointer, but that was not
always valid. For example, if it was a merge section one actually had
to look at MergeSec->OutSec.
This was brittle and caused bugs like the one fixed by r304260.
We now have a single Parent pointer that points to an OutputSection
for InputSection, but to a SyntheticSection for merge sections and
.eh_frame. This makes it impossible to accidentally access an invalid
OutSec.
llvm-svn: 304338
|
|
|
|
| |
llvm-svn: 304330
|