| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
| |
LLD now prints an error message if /SAFESEH option is specified and one or
more input files are not compatible with SEH.
llvm-svn: 201900
|
|
|
|
| |
llvm-svn: 201109
|
|
|
|
| |
llvm-svn: 200443
|
|
|
|
|
|
|
| |
Relocations for x64 object files should have reference type of
KindArch::x86_64.
llvm-svn: 200183
|
|
|
|
| |
llvm-svn: 199327
|
|
|
|
| |
llvm-svn: 198797
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently .drectve section contents are parsed after other sections are parsed.
That order may result in wrong results if other sections depend on command line
options in the directive section.
For example, if a weak symbol is defined using /alternatename option in the
directive section, we have to read it first and then read the text section
contents. Otherwise the weak symbol won't be defined.
This patch changes the order to fix the issue.
llvm-svn: 198071
|
|
|
|
|
|
|
| |
There are many object files in the standard library who have empty .drective
sections. Parsing the empty string is not wrong but a waste.
llvm-svn: 198067
|
|
|
|
| |
llvm-svn: 197788
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The main changes are in:
include/lld/Core/Reference.h
include/lld/ReaderWriter/Reader.h
Everything else is details to support the main change.
1) Registration based Readers
Previously, lld had a tangled interdependency with all the Readers. It would
have been impossible to make a streamlined linker (say for a JIT) which
just supported one file format and one architecture (no yaml, no archives, etc).
The old model also required a LinkingContext to read an object file, which
would have made .o inspection tools awkward.
The new model is that there is a global Registry object. You programmatically
register the Readers you want with the registry object. Whenever you need to
read/parse a file, you ask the registry to do it, and the registry tries each
registered reader.
For ease of use with the existing lld code base, there is one Registry
object inside the LinkingContext object.
2) Changing kind value to be a tuple
Beside Readers, the registry also keeps track of the mapping for Reference
Kind values to and from strings. Along with that, this patch also fixes
an ambiguity with the previous Reference::Kind values. The problem was that
we wanted to reuse existing relocation type values as Reference::Kind values.
But then how can the YAML write know how to convert a value to a string? The
fix is to change the 32-bit Reference::Kind into a tuple with an 8-bit namespace
(e.g. ELF, COFFF, etc), an 8-bit architecture (e.g. x86_64, PowerPC, etc), and
a 16-bit value. This tuple system allows conversion to and from strings with
no ambiguities.
llvm-svn: 197727
|
|
|
|
|
|
| |
We had lld::coff and lld::pecoff namespaces for no reason. Unify them.
llvm-svn: 197201
|
|
|
|
| |
llvm-svn: 197039
|
|
|
|
| |
llvm-svn: 196754
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
GroupedSectionsPass was a complicated pass. That pass's job was to reorder
atoms by section name, so that the atoms with the same section prefix will be
emitted consecutively to the executable. The pass added layout edges to atoms,
and let the layout pass to actually reorder them.
This patch simplifies the design by making GroupedSectionPass to directly
reorder atoms, rather than adding layout edges. This resembles ELF's
ArrayOrderPass.
This patch improves the performance of LLD; it used to take 7.1 seconds to
link LLD with LLD on my Macbook Pro, but it now takes 6.1 seconds.
llvm-svn: 196628
|
|
|
|
| |
llvm-svn: 196332
|
|
|
|
| |
llvm-svn: 196185
|
|
|
|
|
|
|
| |
This reverts commit r195852 because LLD seems to create broken executables
with that patch when compiled with MSVC 2013.
llvm-svn: 196078
|
|
|
|
|
|
|
| |
Atom ordinals are the indeces in a file. Currently the PECOFF reader assigns
ordinals for each section, so it's (incorrectly) assigning duplicate ordinals.
llvm-svn: 195852
|
|
|
|
|
|
|
|
| |
According to the PE/COFF spec, a section with IMAGE_SCN_LNK_INFO should only
appear in an object file, and not allowed in an executable. So I believe
treating it as the same way as IMAGE_SCN_LNK_INFO is the right thing.
llvm-svn: 195692
|
|
|
|
| |
llvm-svn: 195169
|
|
|
|
|
|
| |
No need to do that in ReaderCOFF.cpp.
llvm-svn: 195109
|
|
|
|
| |
llvm-svn: 194746
|
|
|
|
| |
llvm-svn: 194668
|
|
|
|
|
|
| |
No functionality change.
llvm-svn: 194560
|
|
|
|
| |
llvm-svn: 194556
|
|
|
|
|
|
| |
This reverts commit r194551 because it broke the buildbot.
llvm-svn: 194552
|
|
|
|
| |
llvm-svn: 194551
|
|
|
|
| |
llvm-svn: 194539
|
|
|
|
|
|
| |
Errors in .drectve section were silently ignored. This patch fixes the issue.
llvm-svn: 194110
|
|
|
|
| |
llvm-svn: 194037
|
|
|
|
| |
llvm-svn: 193646
|
|
|
|
| |
llvm-svn: 193440
|
|
|
|
| |
llvm-svn: 193385
|
|
|
|
|
|
|
|
| |
This patch won't change LLD's behavior because it's a temporary file and
LLD does not use the file extension to determine file type. But using the
correct file extension is a good thing.
llvm-svn: 193211
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We should dead-strip atoms only if they are created for COMDAT symbols. If we
remove non-COMDAT atoms from a binary, it will no longer be guaranteed that
the binary will work correctly.
In COFF, you can manipulate the order of section contents in the resulting
binary by section name. For example, if you have four sections
.data$unique_prefix_{a,b,c,d}, it's guaranteed that the contents of A, B, C,
and D will be consecutive in the resulting .data section in that order.
Thus, you can access B's and C's contents by incrementing a pointer pointing
to A until it reached to D. That's why we cannot dead-strip B or C even if
no one is directly referencing to them.
Some object files in the standard library actually use that technique.
llvm-svn: 193017
|
|
|
|
| |
llvm-svn: 192830
|
|
|
|
| |
llvm-svn: 192401
|
|
|
|
|
|
|
|
|
|
|
|
| |
Changes :-
a) Functionality in InputGraph to insert Input elements at any position
b) Functionality in the Resolver to use nextFile
c) Move the functionality of assigning file ordinals to InputGraph
d) Changes all inputs to MemoryBuffers
e) Remove LinkerInput, InputFiles, ReaderArchive
llvm-svn: 192081
|
|
|
|
| |
llvm-svn: 191583
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch inverts the return value of these functions, so that they return
"true" on success and "false" on failure. The meaning of boolean return value
was mixed in LLD; for example, InputGraph::validate() returns true on success.
With this patch they'll become consistent.
CC: llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1748
llvm-svn: 191341
|
|
|
|
|
|
| |
This reverts r189881 because that patch caused dangling StringRefs.
llvm-svn: 190725
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There was a bug that if a section has an alignment requirement and there are
multiple symbols at offset 0 in the section, only the last atom at offset 0
would be aligned properly. That bug would move only the last symbol to an
alignment boundary, leaving other symbols unaligned, although they should be at
the same location. That caused a mysterious SEGV error of the resultant
executable.
With this patch, we manage all symbols at the same location properly, rather
than keeping the last one.
llvm-svn: 190724
|
|
|
|
|
|
| |
Used the fallback mechanism to implement COFF weak external symbols.
llvm-svn: 190633
|
|
|
|
| |
llvm-svn: 190254
|
|
|
|
|
|
| |
reference. Move readFile logic into FileNode::createLinkerInput.
llvm-svn: 190253
|
|
|
|
|
|
| |
Patch by Ron Ofir.
llvm-svn: 190198
|
|
|
|
|
|
| |
header.
llvm-svn: 190120
|
|
|
|
|
|
|
|
|
|
|
| |
The compiler is allowed to add a linker option starting with -?<name> to
.drectve section. If the linker can interpret -<name>, it's processed as if
there's no question mark there. If not, such option is silently ignored.
This is a COFF's feature to allow the compiler to emit new linker options
while keeping compatibility with older linkers.
llvm-svn: 189897
|
|
|
|
|
|
| |
calls of allocateString()
llvm-svn: 189881
|
|
|
|
| |
llvm-svn: 189865
|