diff options
author | Ben Gamari <ben@well-typed.com> | 2022-03-17 17:52:47 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2022-04-06 16:25:25 -0400 |
commit | 209fd61b32855aa3151e222dee1513ec1fa362d3 (patch) | |
tree | af441e99c4c48258f63d96ae33fc64b6204c3c73 /rts/linker | |
parent | eb60565b30225b2a215c0ae168b899a257706877 (diff) | |
download | haskell-209fd61b32855aa3151e222dee1513ec1fa362d3.tar.gz |
rts/linker: Split up object resolution and initialization
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.
Diffstat (limited to 'rts/linker')
0 files changed, 0 insertions, 0 deletions