| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously the RTS linker would call initializers during the
"resolve" phase of linking. However, this is problematic in the
case of cyclic dependencies between objects. In particular, consider
the case where we have a situation where a static library
contains a set of recursive objects:
* object A has depends upon symbols in object B
* object B has an initializer that depends upon object A
* we try to load object A
The linker would previously:
1. start resolving object A
2. encounter the reference to object B, loading it resolve object B
3. run object B's initializer
4. the initializer will attempt to call into object A,
which hasn't been fully resolved (and therefore protected)
Fix this by moving constructor execution to a new linking
phase, which follows resolution.
Fix #21253.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
This reverts commit eebec97aa7a54754d86a0456d4b0e84c0ec48e64.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
ghc-prim doesn't depend on base so can't have any Monoid or Semigroup
instances. However, attempting to load these definitions ran into issues
when the interface for `GHC.Base` did exist as that would try and load
the interface for `GHC.Types` (which is the module we are trying to
compile and has no interface).
The fix is to just not do this check when we are compiling a module in
ghc-prim.
Fixes #21069
|
|\ \ \ \
| | | | |
| | | | |
| | | | | |
'wip/windows-clang-2', 'wip/T21059' and 'wip/no-c-stubs' into wip/windows-clang-join
|
| | | | | |
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Previously `addLibrarySearchPath` failed to normalise the added path to
UNC form before passing it to `AddDllDirectory`. Consequently, the call
was subject to the MAX_PATH restriction, leading to the failure of
`test-defaulting-plugin-fail`, among others. Happily, this also nicely
simplifies the implementation.
Closes #21059.
|
| | | | |
| | | | |
| | | | |
| | | | | |
We no longer support Windows Vista.
|
| | | | | |
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
The new toolchain has fixed it.
Closes #15670.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
I have not seen it fail since moving to clang.
Closes #12714.
|
| | | | | |
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Unfortunately, `lld`'s COFF backend does not currently support object
merging. With ld.bfd having broken support for high image-load base
addresses, it's necessary to find an alternative. Here I introduce
support in the driver for generating static archives, which we use on
Windows instead of object merging.
|
| | | | |
| | | | |
| | | | |
| | | | | |
For consistency with --make and friends.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Previously this test was C++ which made it a bit of a portability
problem.
|
| | | | |
| | | | |
| | | | |
| | | | | |
The testing that I have done on Windows thusfar suggests that it works.
|
| | | | | |
|
| | | | | |
|
| | | | | |
|
| | | | | |
|
| | | | |
| | | | |
| | | | |
| | | | | |
It appears that LLD detects that the output is large on its own.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Drop hack for #1828, among others as they appear to be unnecessary when
using `llvm-windres`.
|
| | | | | |
|
| | | | | |
|
| | | | |
| | | | |
| | | | |
| | | | | |
This is a gcc-specific extension.
|
| | | | | |
|
| | | |/
| | |/| |
|
| | | | |
|
| | | | |
|
| | | | |
|
| | | | |
|
| |/ /
| | |
| | |
| | |
| | |
| | |
| | | |
On Windows with high-entropy ASLR we must use %rip-relative addressing
to avoid overflowing the signed 32-bit immediate size of x86-64.
Since %rip-relative addressing comes essentially for free and can make
linking significantly easier, we use it on all platforms.
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | | |
We now preserve the address that we last mapped, allowing us to resume
our search and avoiding quadratic allocation costs. This fixes the
runtime of T10296a, which allocates many adjustors.
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This is a significant rework of the PEi386 linker, making the linker
compatible with high image base addresses. Specifically, we now use the
m32 allocator instead of `HeapAllocate`.
In addition I found a number of latent bugs in our handling of import
libraries and relocations. I've added quite a few comments describing
what I've learned about Windows import libraries while fixing these.
Thanks to Tamar Christina (@Phyx) for providing the address space search
logic, countless hours of help while debugging, and his boundless
Windows knowledge.
Co-Authored-By: Tamar Christina <tamar@zhox.com>
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This fixes handling of overflowed relocations on PEi386 targets:
* Refuse to create jump islands for relocations of data symbols
* Correctly handle the `__imp___acrt_iob_func` symbol, which is an new
type of symbol: `SYM_TYPE_INDIRECT_DATA`
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
As noted in #20978, the linker would previously handle overflowed
relocations by creating a jump island. While this is fine in the case of
code symbols, it's very much not okay in the case of data symbols. To
fix this we must keep track of whether each symbol is code or data and
relocate them appropriately. This patch takes the first step in this
direction, adding a symbol type field to the linker's symbol table. It
doesn't yet change relocation behavior to take advantage of this
knowledge.
Fixes #20978.
|
| | | |
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | | |
Here we try to separate the policy decisions of where to place mappings
from the mechanism of creating the mappings. This makes things
significantly easier to follow.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
As noted in #21057, we really shouldn't be using MAP_FIXED. I would much
rather have the process crash with a "failed to map" error than randomly
overwrite existing mappings.
Closes #21057.
|