| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
| |
This reverts commit r232253.
Fix comments from dblaikie. Since these functions dont access member state, its ok to be static.
llvm-svn: 232271
|
|
|
|
|
|
|
|
|
| |
Handle resolution of symbols coming from linked object files lazily.
Add implementation of handling _GLOBAL_OFFSET_TABLE_ and __exidx_start/_end symbols for ARM platform.
Differential Revision: http://reviews.llvm.org/D8159
llvm-svn: 232261
|
|
|
|
|
|
| |
Functions hasOutputSegment/maybeGetSOName doesnot need not be static.
llvm-svn: 232253
|
|
|
|
|
|
| |
Gnu doesnot creates only a .got section.
llvm-svn: 232252
|
|
|
|
| |
llvm-svn: 232251
|
|
|
|
|
|
| |
Fix ambiguous finalize function.
llvm-svn: 232250
|
|
|
|
|
|
|
|
| |
The Segment Chunk had two functions one to append a section and one to append a
chunk. A section is a subclass of a chunk and clearly this can be merged into
one single function.
llvm-svn: 232249
|
|
|
|
|
|
|
|
|
|
|
| |
GNU LD has an option named -T/--script which allows a user to specify
a linker script to be used [1]. LLD already accepts linker scripts
without this option, but the option is widely used. Therefore it is
best to support it in LLD as well.
[1] https://sourceware.org/binutils/docs/ld/Options.html#Options
llvm-svn: 232183
|
|
|
|
|
|
| |
This patch implements evaluation of the GNU ld EXTERN command.
llvm-svn: 232111
|
|
|
|
|
|
|
|
|
| |
This patch implements parsing of the GNU ld EXTERN command [1].
Evaluation will be added at a later point in time.
[1] https://sourceware.org/binutils/docs/ld/Miscellaneous-Commands.html#Miscellaneous-Commands
llvm-svn: 232110
|
|
|
|
|
|
| |
Avoids the need for an assert-only variable, among other benefits.
llvm-svn: 232088
|
|
|
|
|
|
|
|
| |
template class instantiation
No functional changes.
llvm-svn: 232081
|
|
|
|
| |
llvm-svn: 232030
|
|
|
|
|
|
| |
Patch by Mike Edwards. Thanks!
llvm-svn: 232015
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
the spec required by std::sort and friends.
Ordering things this way also dramatically simplifies the code as
short-circuit ensures we can skip all of the negative tests.
I've left one FIXME where we're establishing a fairly arbitrary
ordering. Previously, the function compared all types as equal except
for the ones it explicitly handled, but it didn't delegate correctly to
the atomflags when doing so, and so it would fail to be a SWO. The two
possible fixes are to stop comparing the atom flags entirely, or to
establish some arbitrary ordering of the types.
Since it was pure luck which ordering of unequal types we ended up with
previously (the caller was std::sort, not std::stable_sort) I chose to
make the ordering explicit and guaranteed. This seems like the best
conservative approach as I suspect we would want to switch to
stable_sort otherwise in order to have deterministic output.
Differential Revision: http://reviews.llvm.org/D8266
llvm-svn: 231968
|
|
|
|
|
|
|
|
|
|
|
| |
This patch implements parsing of the GNU ld MEMORY command [1].
The command and the memory block definitions are parsed as
specified (including the slightly strange "o" and "l" keywords).
Evaluation will be added at a later point in time.
[1] https://sourceware.org/binutils/docs-2.25/ld/MEMORY.html
llvm-svn: 231928
|
|
|
|
|
|
|
|
|
|
| |
This will be replaced by a more generic class to handle
all the default symbols in an executable, e.g. __init_array.
Differential Revision: http://reviews.llvm.org/D8234
Reviewed by: shankare
llvm-svn: 231906
|
|
|
|
|
|
| |
conventions. Sorry for missing this before I committed the patch!
llvm-svn: 231766
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
of the vector. For a vector 'v', '&v[v.size()]' isn't a valid way to
compute a pointer one-past-the-end of the vector. Instead, write the
loop in terms of iterators and save the beginning iterator. Once we have
that we can compute the beginning pointer from the beginning iterator,
and compute the distance which we should increment the beginning pointer
by subtracting the iterators.
What might be simpler would be to convert the function accepting a raw
pointer for begin and end to accept iterators or a range or some other
construct, but I wanted to keep this to a minimal bug-fix change.
This fixes a crash on any debug STL implementation which checks for
indexing out of bounds.
llvm-svn: 231765
|
|
|
|
|
|
| |
We dropped Visual Studio 2012 support, so we can use template aliases.
llvm-svn: 231756
|
|
|
|
| |
llvm-svn: 231718
|
|
|
|
|
|
|
| |
SimpleReference, which is defined in Core, provides the same functionality
as COFFReference does, so we don't need a custom class.
llvm-svn: 231715
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
llvm-svn: 231688
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
This patch broke a buildbot.
llvm-svn: 231611
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
llvm-svn: 231557
|
|
|
|
|
|
|
|
|
|
|
| |
Atoms with fallback atoms are never be added to the symbol table.
However, we added such atoms to _undefines array. We had to call
isCoalescedAway to identify and skip them. We should just stop
adding them in the first place.
This seems to make the linker ~1% faster in my test case.
llvm-svn: 231552
|
|
|
|
|
|
|
|
| |
If an undefined symbol is added to the symbol table by the previous
call of SymbolTable::add, SymbolTable::isDefined will always return
false for the same symbol.
llvm-svn: 231551
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is yet another optimization patch. Previously we called
SymbolTable::isDefined() and SymbolTable::findByName() from a very
frequently executed function. Because isDefined calls findByName,
findByName is called twice on each iteration.
findByName is not a cheap function. It computes a hash value for a
given symbol name. When linking C++ programs, it can be expensive
because of C++ mangled long symbols.
This patch reduces the number of call from 2 to 1. Performance
improvements by this patch was larger than I expected. Linking time
of chrome.dll gets almost 5% shorter.
llvm-svn: 231549
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
llvm-svn: 231518
|