| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
| |
The expression evaluation is needed when interpreting linker scripts, in order
to calculate the value for new symbols or to determine a new position to load
sections in memory. This commit extends Expression nodes from the linker script
AST with evaluation functions, and also contains a unit test.
http://reviews.llvm.org/D8156
llvm-svn: 231707
|
|
|
|
|
|
| |
No functional changes.
llvm-svn: 231646
|
|
|
|
|
|
| |
No functional changes.
llvm-svn: 231645
|
|
|
|
|
|
| |
No functional changes.
llvm-svn: 231644
|
|
|
|
| |
llvm-svn: 231643
|
|
|
|
| |
llvm-svn: 231642
|
|
|
|
|
|
|
|
|
|
|
| |
1. Move relocation addendum reading code to the MipsRelocationHandler
class to reduce code duplication.
2. Factor out the relocations calculation code into the separate
function to be ready to handle MIPS N64 ABI relocation chains.
No functional changes.
llvm-svn: 231641
|
|
|
|
| |
llvm-svn: 231640
|
|
|
|
|
|
|
|
| |
We should not take in account a type of "source" symbol. Cross mode jump
adjustment is requred when target symbol and relocation belong to
different (regular/microMIPS) instruction sets.
llvm-svn: 231639
|
|
|
|
| |
llvm-svn: 231629
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
All readers except PE/COFF reader create layout-after edges to preserve
the original symbol order. PE/COFF uses layout-before edges as primary
edges for no reason.
This patch makes PE/COFF reader to create layout-after edges.
Resolver is updated to recognize reverse edges of layout-after edges
in the garbage collection pass.
Now we can retire layout-before edges. I don't do that in this patch
because if I do, I would have updated many tests to replace all
occurrrences of "layout-before" with "layout-after". So that's a TODO.
llvm-svn: 231615
|
|
|
|
|
|
|
| |
"first" and "second" are not easy to memorize.
Define a type to use meaningful names.
llvm-svn: 231614
|
|
|
|
|
|
|
| |
That commit was reverted in r231582 as it was a culprit for
buildbot breakage. Turned out it's not.
llvm-svn: 231610
|
|
|
|
|
|
| |
We accidentally skipped the last base relocation entry for each block.
llvm-svn: 231586
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If an output is large, its base relocation section can be also large.
For example, chrome.dll is almost 300 MB, and it has about 9 million
base relocations. Creating the section took 1.5 seconds on my machine.
This patch changes the way to create the section so that we can use
parallel_sort to group base relocations by high bits. This change
makes the linker almost 4% faster for the above test case on my machine.
If I replace parallel_sort with std::sort, performance remains the same,
so single thread performance should remain the same.
This has no functionality change. The output should be identical as
before.
llvm-svn: 231585
|
|
|
|
|
|
|
|
| |
This code is simply dead. No one is using it.
http://reviews.llvm.org/D8125
llvm-svn: 231583
|
|
|
|
|
|
|
|
|
| |
This patch reverts r231545 "PECOFF: Do not add extraneous symbols
to the dead strip root." CrWinClangLLD buildbot is currently broken.
Since I can't reproduce the issue locally, I'm reverting the most
relevant change.
llvm-svn: 231582
|
|
|
|
| |
llvm-svn: 231570
|
|
|
|
|
|
|
|
|
|
| |
Previously we added all undefined symbols found in object files to
the dead strip root. This patch makes the linker to stop doing that.
Undefined symbols would be resolved anyway, so this patch doesn't
change the linker behavior. It should slightly improve performance
but it's really marginal. This is a cleanup.
llvm-svn: 231545
|
|
|
|
| |
llvm-svn: 231543
|
|
|
|
| |
llvm-svn: 231542
|
|
|
|
|
|
|
|
|
| |
Previously applying 1 million relocations took about 2 seconds on my
Xeon 2.4GHz 8 core workstation. After this patch, it takes about 300
milliseconds. As a result, time to link chrome.dll becomes 23 seconds
to 21 seconds.
llvm-svn: 231454
|
|
|
|
| |
llvm-svn: 231330
|
|
|
|
|
|
|
| |
DefinedAtom, which is the base class of ELFCommonAtom, has a
virtual destructor, so this is redundant.
llvm-svn: 231329
|
|
|
|
| |
llvm-svn: 231316
|
|
|
|
|
|
|
|
| |
The last use of layout-after edge for PE/COFF was removed in r231290.
Now layout-after edges do nothing. We can stop adding them to the graph.
No functionality change intended.
llvm-svn: 231301
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Merge::mergeByLargestSection is half-baked since it's defined
in terms of section size, there's no way to get the section size
of an atom.
Currently we work around the issue by traversing the layout edges
to both directions and calculate the sum of all atoms reachable.
I wrote that code but I knew it's hacky. It's even not guaranteed
to work. If you add layout edges before the core linking, it
miscalculates a size.
Also it's of course slow. It's basically a linked list traversal.
In this patch I added DefinedAtom::sectionSize so that we can use
that for mergeByLargestSection. I'm not very happy to add a new
field to DefinedAtom base class, but I think it's legitimate since
mergeByLargestSection is defined for section size, and the section
size is currently just missing.
http://reviews.llvm.org/D7966
llvm-svn: 231290
|
|
|
|
| |
llvm-svn: 231271
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
File objects are not really const in the resolver. We set ordinals to
them and call beforeLink hooks. Also, File's member functions marked
as const are not really const. ArchiveFile never returns the same
member file twice, so it remembers files returned before. find() has
side effects.
In order to deal with the inconsistencies, we sprinkled const_casts
and marked member varaibles as mutable.
This patch removes const from there to reflect the reality.
llvm-svn: 231212
|
|
|
|
|
|
| |
This reverts accidental commit r231205.
llvm-svn: 231208
|
|
|
|
|
|
|
| |
This patch moves local variable definitions so that their scope get narrower.
Also uses range-based loop. Both are for readability.
llvm-svn: 231206
|
|
|
|
| |
llvm-svn: 231205
|
|
|
|
| |
llvm-svn: 231196
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
std::promise and std::future in old version of libstdc++ are buggy.
I think that's the reason why LLD tests were flaky on Ubuntu 13
buildbots until we disabled file preloading.
In this patch, I implemented very simple future and used that in
FileArchive. Compared to std::promise and std::future, it lacks
many features, but should serve our purpose.
http://reviews.llvm.org/D8025
llvm-svn: 231153
|
|
|
|
| |
llvm-svn: 231139
|
|
|
|
|
|
|
|
|
| |
Yet another chapter in the story. We're getting there, finally.
Note for the future: the tests for relocation have a lot of duplication
and probably can be unified in a single file. Let's reevaluate this once
the support will be complete (hopefully, soon).
llvm-svn: 231057
|
|
|
|
|
|
|
|
|
| |
"virtual" was present at a wrong place. FileArchive is a subclass of
ArchiveLibraryFile, and a FileArchive can be deleted through a
pointer of ArchiveLibraryFile. We want to make the destructor of the
base class virtual.
llvm-svn: 231033
|
|
|
|
| |
llvm-svn: 231005
|
|
|
|
|
|
|
| |
While at it, point the correct document where the missing TLS
relocation(s) are described.
llvm-svn: 230937
|
|
|
|
| |
llvm-svn: 230925
|
|
|
|
|
|
|
|
|
| |
This reverts commit r230086. I added a lock to guard FileCOFF::doParse(),
which killed parallel file parsing. Now the buildbots got back to green,
I believe the threading issue was resolved, so it's time to remove the
guard to see if it works with the buildbots.
llvm-svn: 230886
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
FileCOFF::beforeLink
In doParse, we shouldn't do anything that has side effects. That function may be
called speculatively and possibly in parallel.
We called WinLinkDriver::parse from doParse to parse a command line in a .drectve
section. The parse function updates a linking context object, so it has many side
effects. It was not safe to call that function from doParse. beforeLink is a
function for a File object to do something that has side effects. Moving a call
of WinLinkDriver::parse to there.
llvm-svn: 230791
|
|
|
|
| |
llvm-svn: 230770
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If no initial live symbols are set up, and deadStrip() == true,
the Resolver ends up reclaiming all the symbols that aren't absolute. This is wrong.
This patch fixes the issue by setting entrySymbolName() as live, and this allows
us to self-host lld when --gc-sections is enabled. There are still quite a few problems
with --gc-sections (test failures), so the option can't be enabled by default.
Differential Revision: D7926
Reviewed by: ruiu, shankarke
llvm-svn: 230737
|
|
|
|
|
|
|
|
|
| |
This reverts commit r230732.
sectionSize() in lib/Core/SymbolTable.cpp still depends on the layout-
after edges, so we couldn't remove them yet.
llvm-svn: 230734
|
|
|
|
|
|
| |
This remove(s) include of the filename twice.
llvm-svn: 230733
|
|
|
|
|
|
|
|
| |
Previously we needed to create atoms as a doubly-linked link, but it's
no longer needed. Also we don't use layout-after edges in PE/COFF.
Creating such edges is just waste.
llvm-svn: 230732
|
|
|
|
| |
llvm-svn: 230730
|
|
|
|
| |
llvm-svn: 230729
|
|
|
|
| |
llvm-svn: 230728
|