| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The fallback atom was used only when it's searching for a symbol in a library;
if an undefined symbol was not found in a library, the LLD looked for its
fallback symbol in the library.
Although it worked in most cases, because symbols with fallbacks usually occur
only in OLDNAMES.LIB (a standard library), that behavior was incompatible with
link.exe. This patch fixes the issue so that the semantics is the same as
MSVC's link.exe
The new (and correct, I believe) behavior is this:
- If there's no definition for an undefined atom, replace the undefined atom
with its fallback and then proceed (e.g. look in the next file or stop
linking as usual.)
Weak External symbols are underspecified in the Microsoft PE/COFF spec. However,
as long as I observed the behavior of link.exe, this seems to be what we want
for compatibility.
Differential Revision: http://llvm-reviews.chandlerc.com/D2162
llvm-svn: 195269
|
|
|
|
| |
llvm-svn: 195107
|
|
|
|
| |
llvm-svn: 195051
|
|
|
|
| |
llvm-svn: 194784
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We can add multiple undefined atoms having the same name to the symbol table.
If such atoms are added, the symbol table compares their canBeNull attributes,
and select one having a stronger constraint. If their canBeNulls are the same,
the choice is arbitrary. Currently it choose the existing one.
This patch changes the preference, so that the symbol table choose the new one
if the new atom has a greater canBeNull or a fallback atom. This shouldn't
change the behavior except the case described below.
A new undefined atom may have a new fallback atom attribute. By choosing the new
atom, we can update the fallback atom during Core Linking. PE/COFF actually need
that. For example, _lseek is an alias for __lseek on Windows. One of an object
file in OLDNAMES.LIB has an undefined atom for _lseek with the fallback to
__lseek. When the linker tries to resolve _read, it supposed to read the file
from OLDNAMES.LIB and use the new fallback from the file. Currently LLD cannot
handle such case because duplicate undefined atoms with the same attributes are
ignored.
Differential Revision: http://llvm-reviews.chandlerc.com/D2161
llvm-svn: 194777
|
|
|
|
| |
llvm-svn: 194671
|
|
|
|
| |
llvm-svn: 194641
|
|
|
|
| |
llvm-svn: 194624
|
|
|
|
| |
llvm-svn: 194620
|
|
|
|
| |
llvm-svn: 194619
|
|
|
|
|
|
| |
This reverts commit r194551 because it broke the buildbot.
llvm-svn: 194552
|
|
|
|
| |
llvm-svn: 194551
|
|
|
|
|
|
| |
CMake files
llvm-svn: 194177
|
|
|
|
| |
llvm-svn: 194037
|
|
|
|
|
|
| |
It was never transporting any value in addition to the error_code.
llvm-svn: 194028
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Enable this for the following flavors
a) core
b) gnu
c) darwin
Its disabled for the flavor PECOFF. Convenient markers are added with FIXME
comments in the Driver that would be removed and code removed from each flavor.
llvm-svn: 193585
|
|
|
|
|
|
|
| |
The patch have completely broken COFF port and disabled many tests.
This also reverts r193302 (comment fix).
llvm-svn: 193362
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Disable tests to be run with REQUIRES: disable. Note disable is not added to the
config by the test runner Mkaefiles, so essentially disables the test.
Code changes would be required to fix these tests :-
test/darwin/hello-world.objtxt
test/elf/check.test
test/elf/phdr.test
test/elf/ppc.test
test/elf/undef-from-main-dso.test
test/elf/X86_64/note-sections-ro_plus_rw.test
test/pecoff/alignment.test
test/pecoff/base-reloc.test
test/pecoff/bss-section.test
test/pecoff/drectve.test
test/pecoff/dynamic.test
test/pecoff/dynamicbase.test
test/pecoff/entry.test
test/pecoff/hello.test
test/pecoff/imagebase.test
test/pecoff/importlib.test
test/pecoff/lib.test
test/pecoff/multi.test
test/pecoff/reloc.test
test/pecoff/weak-external.test
llvm-svn: 193300
|
|
|
|
|
|
|
|
|
| |
Dead-strip root symbols can be undefined atoms, but should not really be
nonexistent, because dead-strip root symbols should be added to initial
undefined atoms at startup. Whenever you look up its name in the symbol
table, some type of atom will always exist.
llvm-svn: 192831
|
|
|
|
|
|
|
| |
We want to make the program to exit with non-zero exit code if there's an error
during dead stripping.
llvm-svn: 192771
|
|
|
|
| |
llvm-svn: 192424
|
|
|
|
| |
llvm-svn: 192422
|
|
|
|
| |
llvm-svn: 192416
|
|
|
|
|
|
|
| |
This patch also handles errors other than no_more_files error. They were silently
ignored.
llvm-svn: 192415
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change removes code in various places which was setting the File Ordinals.
This is because the file ordinals are assigned by the way files are resolved.
There was no other way than making the getNextFileAndOrdinal be set const and
change the _nextOrdinal to mutable.
There are so many places in code, that you would need to cleanup to make
LinkingContext non-const!
llvm-svn: 192280
|
|
|
|
| |
llvm-svn: 192277
|
|
|
|
|
|
|
|
|
|
| |
This associates resolveState to FileNodes. The control node derive
their resolution state from the inputElements that are contained in
it.
This makes --start-group/--end-group to work with ELF linking.
llvm-svn: 192269
|
|
|
|
| |
llvm-svn: 192261
|
|
|
|
| |
llvm-svn: 192260
|
|
|
|
| |
llvm-svn: 192183
|
|
|
|
| |
llvm-svn: 192163
|
|
|
|
| |
llvm-svn: 192149
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
The original code with enum "_" is intended to emulate scoped enums.
Now we have real scoped enums, so use it.
Reviewers: Bigcheese
CC: llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1852
llvm-svn: 192148
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
| |
This adds an option --output-filetype that can be set to either
YAML/Native(case insensitive). The linker would create the outputs
associated with the type specified by the user.
Changes all the tests to use the new option.
llvm-svn: 191183
|
|
|
|
|
|
|
|
|
| |
This also makes it support debugging executables built with lld.
Initial patch done by Bigcheese. This is only a revised patch to
have the functionality in the Writer.
llvm-svn: 191032
|
|
|
|
|
|
| |
Used the fallback mechanism to implement COFF weak external symbols.
llvm-svn: 190633
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In COFF, an undefined symbol can have up to one alternative name. If a symbol
is resolved by its regular name, then it's linked normally. If a symbol is not
found in any input files, all references to the regular name are resolved using
the alternative name. If the alternative name is not found, it's a link error.
This mechanism is called "weak externals".
To support this mechanism, I added a new member function fallback() to undefined
atom. If an undefined atom has the second name, fallback() returns a new undefined
atom that should be used instead of the original one to resolve undefines. If it
does not have the second name, the function returns nullptr.
Differential Revision: http://llvm-reviews.chandlerc.com/D1550
llvm-svn: 190625
|
|
|
|
|
|
|
|
|
| |
attribute in LinkerInput to isWholeArchive and use that for deciding
whether library archives should be expanded. Implement the -all_load
option of the Darwin linker using this flag and drop the support for it
in GNU mode.
llvm-svn: 190275
|
|
|
|
|
|
| |
reference. Move readFile logic into FileNode::createLinkerInput.
llvm-svn: 190253
|
|
|
|
|
|
|
|
|
|
| |
It looks like there is a possibility of seeing RO/RW note sections
and we would need to create an appropriate RO/RW segment associated
with them.
Adds a test too.
llvm-svn: 189907
|
|
|
|
|
|
|
|
| |
Emit note sections if the input contains a note section.
Also emit a note segment.
llvm-svn: 189896
|
|
|
|
| |
llvm-svn: 189775
|
|
|
|
|
|
|
|
|
|
|
|
| |
available in YAML
This adds an API to the LinkingContext for flavors to add Internal files
containing atoms that need to appear in the YAML output as well, when -emit-yaml
switch is used.
Flavors can add more internal files for other options that are needed.
llvm-svn: 189718
|
|
|
|
| |
llvm-svn: 189413
|
|
|
|
|
|
|
|
|
|
|
| |
typeTLV content type is used by Darwin to represent thread local
storage. A new contentType has to be made to represent ELF
thread local storage data. These have been set to
- typeThreadZeroFill (represents TBSS storage)
- typeThreadData (represents TDATA storage)
llvm-svn: 189137
|
|
|
|
| |
llvm-svn: 188049
|
|
|
|
|
|
|
|
|
| |
Also change some local variable names: "ti" -> "context" and
"_targetInfo" -> "_context".
Differential Revision: http://llvm-reviews.chandlerc.com/D1301
llvm-svn: 187823
|
|
|
|
| |
llvm-svn: 186996
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch adds a new pass, IdataPass, to transform shared atom references
to real references and to construct the .idata section data. With this patch
lld can produce a working Hello World program by linking it against
kernel32.dll and user32.dll.
Reviewers: Bigcheese
CC: llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1096
llvm-svn: 186071
|