| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
It's time to remove old COFF linker because the new one is now complete.
llvm-svn: 244226
|
|
|
|
|
|
| |
Patch from Eugene.Zelenko!
llvm-svn: 243060
|
|
|
|
| |
llvm-svn: 241530
|
|
|
|
|
|
|
|
| |
None of the implementations replace the SimpleFile with some other file,
they just modify the SimpleFile in-place, so a direct reference to the
file is sufficient.
llvm-svn: 240167
|
|
|
|
| |
llvm-svn: 240147
|
|
|
|
| |
llvm-svn: 239671
|
|
|
|
|
|
| |
This just reduces the noise from another patch.
llvm-svn: 235776
|
|
|
|
| |
llvm-svn: 235741
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
loadFile could load mulitple files just because yaml has a feature for
putting multiple documents in one file.
Designing a linker around what yaml can do seems like a bad idea to
me. This patch changes it to read a single file.
There are further improvements to be done to the api and they
will follow shortly.
llvm-svn: 235724
|
|
|
|
|
|
|
|
|
|
|
|
| |
The function took either StringRef or Twine. Since string literals are
ambiguous when resolving the overloading, many code calls used this
function with explicit type conversion. That led awkward code like
make_dynamic_error_code(Twine("Error occurred")).
This patch adds a function definition for string literals, so that
you can directly call the function with literals.
llvm-svn: 234841
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This doesn't compile with MSVC 2013:
include\lld/ReaderWriter/PECOFFLinkingContext.h(356) : error C2797:
'lld::PECOFFLinkingContext::_imageVersion': list initialization
inside member initializer list or non-static data member initializer
is not implemented
include\lld/ReaderWriter/PECOFFLinkingContext.h(357) : error C2797:
'lld::PECOFFLinkingContext::_imageVersion': list initialization
inside member initializer list or non-static data member initializer
is not implemented
llvm-svn: 234676
|
|
|
|
| |
llvm-svn: 234649
|
|
|
|
|
|
|
|
| |
I believe this patch eliminates all remaining uses of _context
or _linkingContext variable names. Consistent naming improves
readability.
llvm-svn: 234645
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The Native file format was designed to be the fastest on-memory or
on-disk file format for object files. The problem is that no one
is working on that. No LLVM tools can produce object files in
the Native, thus the feature of supporting the format is useless
in the linker.
This patch removes the Native file support. We can add it back
if we really want it in future.
llvm-svn: 234641
|
|
|
|
|
|
| |
Type names should start with an uppercase letter in the LLVM coding style.
llvm-svn: 234452
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
atom_collection is basically a wrapper for std::vector. The class
provides begin and end member functions, so that it "hides" the
other member functions provided by std::vector. However, you can
still directly access _atoms member since the member is not
protected.
We cannot simply make the member private because we need that member
when we are constructing atom vectors.
This patch splits atom_collection into two types: std::vector<Atom *>
and AtomRange. When we are constructing atom vectors, we use the
former class. We return instances of the latter class from File
objects so that callers cannot add or remove atoms from the lists.
std::vector<Atom *> is automatically converted to AtomRange.
llvm-svn: 234450
|
|
|
|
|
|
|
| |
atom_collection_vector is the only derived class of atom_collection.
This patch merges the two.
llvm-svn: 234443
|
|
|
|
|
|
|
|
| |
SimpleFile is the only derived class of MutableFile.
This patch reduces the height of class hierarchy by removing
MutableFile class.
llvm-svn: 234354
|
|
|
|
|
|
|
| |
All instances of the `createImplicitFiles` always return `true` and this
return value is used nowhere.
llvm-svn: 234205
|
|
|
|
|
|
|
|
| |
canParse took three parameters -- file magic, filename extension and
memory buffer. All but YAMLReader ignored the second parameter.
This patch removes the parameter.
llvm-svn: 234080
|
|
|
|
|
|
|
|
| |
Most developers prefer to not have them, and we agreed to
remove them from LLD.
http://lists.cs.uiuc.edu/pipermail/llvmdev/2015-March/083368.html
llvm-svn: 233313
|
|
|
|
|
|
|
|
| |
This patch defines implicit conversion between integers and PowerOf2
instances, so uses of the classes is now implicit and look like
regular integers. Now we are ready to remove the scaffolding.
llvm-svn: 233245
|
|
|
|
|
|
|
|
|
|
| |
This patch is to make instantiation and conversion to an integer explicit,
so that we can mechanically replace all occurrences of the class with
integer in the next step.
Now get() returns an alignment value rather than its log2 value.
llvm-svn: 233242
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Import Lookup Table in Import Directory Table has the same contents
as Hint/Name Table. Symbol names imported from DLLs are pointed by
both Import Directory Table and Hint/Name Table. We had duplicate
strings there.
This patch eliminates that duplication to make the table smaller.
This should reduce binary size by the sum of lengths of imported
symbols.
llvm-svn: 233128
|
|
|
|
| |
llvm-svn: 232646
|
|
|
|
| |
llvm-svn: 232639
|
|
|
|
|
|
|
|
| |
I knew I cut corners when I wrote this. Turned out that it is
actually slow when a file being read has many symbols. This patch
is to stop doing linear search and instead do map lookup.
llvm-svn: 232436
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
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
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
| |
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: 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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
llvm-svn: 231139
|
|
|
|
| |
llvm-svn: 231005
|
|
|
|
| |
llvm-svn: 230925
|