Age | Commit message (Collapse) | Author |
|
------------------------------------------------------------------------
r242885 | atanasyan | 2015-07-22 03:32:19 -0700 (Wed, 22 Jul 2015) | 4 lines
[ELF] Protect write access to the ELFLinkingContext::_cidentSections by a mutex
The _cidentSections container is filled during files parsing so we need to
serialize a concurrent access to it.
------------------------------------------------------------------------
git-svn-id: https://llvm.org/svn/llvm-project/lld/branches/release_37@243022 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
git-svn-id: https://llvm.org/svn/llvm-project/lld/branches/release_37@242233 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@242216 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
I am adding support for thin archives. On those, getting the buffer
involves reading another file.
Since we only need an id in here, use the member offset in the archive.
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@242205 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
This patch fixes the TLS dynamic variable exportation from .got.plt segments,
created by General-dynamic relocations (TLSDESC). Current code only export
symbols in dynamic table from .got sections.
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@242142 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@242118 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
This reverts commit r242006. The original issue in Clang was fixed in r242009,
so we can now safely use std::atomic_flag.
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@242112 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
Entry name selection rule is already complicated on x64, but it's more
complicated on x86 because of the underscore name mangling scheme.
If one of _main, _main@<number> (a C function) or ?main@@... (a C++ function)
is defined, entry name is _mainCRTStartup. If _wmain, _wmain@<number or
?wmain@@... is defined, entry name is _wmainCRTStartup. And so on.
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@242110 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@242098 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
When using a linker script expression to change the address of a section, even
if the new address is more than a page of distance from the old address, lld
may put everything in the same segment, forcing it to be unnecessarily large.
This patch changes the logic in Segment::assignVirtualAddress() and
Segment::assignFileOffsets() to allow the segment to be sliced into two or more
if it detects a linker script expression that changes a section address.
Differential Revision: http://reviews.llvm.org/D10952
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@242096 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@242093 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@242092 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
When calculating the start address and size of a segment, lld mistakenly
attributed the start address of the last segment slice to the whole segment
when it should consider the start address of the first slice. In this case, in a
multi-slice segment, Segment::assignVirtualAddress() will return a wrong
segment start address to TargetLayout::assignVirtualAddress(). The effect of
this miscalculation is to allocate some program headers in unnecessarily far
away addresses. This commit fixes this.
Differential Revision: http://reviews.llvm.org/D10951
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@242089 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
This is a direct port of the new PE/COFF linker to ELF.
It can take a single object file and generate a valid executable that executes at the first byte in the text section.
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@242088 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
If /delayload option is given, we have to resolve __delayLoadHelper2
since the function is the dynamic loader to delay-load DLLs.
The function name is mangled in x86 as ___delayLoadHelper2@8.
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@242078 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@242075 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@242066 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@242014 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
clang-cl doesn't compile std::atomic_flag correctly (PR24101). Since the COFF
linker doesn't use threads yet, just revert r241420 and r241481 for now to
work around this clang-cl bug.
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@242006 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
With LLVM_ENABLE_THREADS disabled, all the llvm code assumes that it runs on
a single thread and doesn't use any mutexes. lld still spawned lots of threads
in that case and called into llvm, assuming that llvm is thread-safe.
As fix, let lld use only a single thread if LLVM_ENABLE_THREADS is disabled.
I left in all the mutexes in lld. That means lld is a bit slower than
necessary in single-thread mode, but that's probably worth the simpler code.
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@242004 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
The function uses parallel_for() and then writes error messages from the
parallel loop's body. This produces nondetermistic error messages. Instead,
copy error messages to a vector and sort it by the atom's file offsets before
printing all error messages after the parallel_for(). This results in a few
string copies, but only in the error case. (And passing tests seem more
important than performance.)
This makes tests elf/AArch64/rel-prel16-overflow.test and
elf/AArch64/rel-prel32-overflow.test pass on Windows: Both tests check that
atom error messages are emitted in a certain order, and on Windows they
happened to be emitted in a different order before this patch.
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@241988 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
Base relocations are RVA and not VA, so we shouldn't add ImageBase.
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@241883 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
Symbol foo is mangled as _foo in C and ?foo@@... in C++ on x86.
findMangle has to remove prefix underscore before mangle a given name
as a C++ symbol.
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@241874 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
Symbol names are usually mangled by appending "_" prefix on x86.
But the mangled name is not used in DLL export table. The export
table contains unmangled names.
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@241872 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@241860 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
With this patch, LLD is now able to self-link an .exe file for x86
that runs correctly, although I don't think some headers (particularly
SEH) are not correct. DLL support is coming soon.
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@241857 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
For IMPORT_NAME_NOPREFIX symbols, we should remove only one prefix character.
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@241854 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@241853 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
Previously, we infer machine type at the very end of linking after
all symbols are resolved. That's actually too late because machine
type affects how we mangle symbols (whether or not we need to
add "_").
For example, /entry:foo adds "_foo" to the symbol table if x86 but
"foo" if x64.
This patch moves the code to infer machine type, so that machine
type is inferred based on input files given via the command line
(but not based on .directives files).
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@241843 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
MSVC linker accepts these aliases.
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@241840 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
We can use the type and storage class from the symbol's original object
file to fill in the linked executable's symbol table.
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@241828 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@241819 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
With this patch, LLD is now able to correctly link a "hello world"
program written in assembly for 32-bit x86.
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@241771 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@241767 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@241746 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
r241647 made Driver to infer machine type, so this code is not actually in use.
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@241720 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
Symbols exported by DLLs are listed in import library files.
Exported names may be mangled by "Import Name Type" field as
described in PE/COFF spec 7.3. This patch implements that
mangling scheme.
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@241719 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
Differential Revision: http://reviews.llvm.org/D10983
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@241713 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@241701 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
This situation will only be temporary; I imagine we will eventually want to
have the new linker take the lld-link alias after we remove the old one.
However, I would like to port the CFI test suite in the compiler-rt
repository to Windows using the new COFF linker's LTO support; these tests
currently use gcc-style command lines and invoke the linker via the
compiler driver.
We can select the linker using the -fuse-ld flag, which Clang supports on
Windows, but it takes an executable name, rather than a list of arguments
(so "-fuse-ld=lld -flavor link2" wouldn't work), and it doesn't seem worth
the effort to extend the Clang driver to support arguments.
Differential Revision: http://reviews.llvm.org/D11031
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@241696 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
Providing a symbol table in the executable is quite useful when
debugging a fully-linked executable without having to reconstruct one
from DWARF.
Differential Revision: http://reviews.llvm.org/D11023
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@241689 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@241676 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@241658 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@241657 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@241647 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@241638 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
We now report the names of any files containing undefined symbol references.
Differential Revision: http://reviews.llvm.org/D10982
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@241612 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
Previously we were unnecessarily loading lazy symbols if they appeared in an
archive multiple times, as can happen with comdat symbols. This change fixes
the bug by only loading symbols from archives at load time if the original
symbol was undefined.
Differential Revision: http://reviews.llvm.org/D10980
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@241538 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@241530 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@241489 91177308-0d34-0410-b5e6-96231b3b80d8
|