diff options
author | GHC GitLab CI <ghc-ci@gitlab-haskell.org> | 2021-03-02 02:53:09 +0000 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-10-12 19:16:40 -0400 |
commit | fcd970b56853350c2de330decb5c2658fcf6e7f8 (patch) | |
tree | 01740c88066272a2e58ccd732eedd36b4e6cb615 /rts | |
parent | 82a89df72fbf5da437f52a1375bf1d6ded1c61c5 (diff) | |
download | haskell-fcd970b56853350c2de330decb5c2658fcf6e7f8.tar.gz |
rts/linker: Resolve __fini_array_* symbols to NULL
If the __fini_array_{start,end} symbols are not defined (e.g. as is
often the case when linking against musl) then resolve them to NULL.
Diffstat (limited to 'rts')
-rw-r--r-- | rts/Linker.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/rts/Linker.c b/rts/Linker.c index b31142e8e4..bfbf8338af 100644 --- a/rts/Linker.c +++ b/rts/Linker.c @@ -900,6 +900,10 @@ SymbolAddr* lookupDependentSymbol (SymbolName* lbl, ObjectCode *dependent) # error No OBJFORMAT_* macro set # endif } else { + static void *RTS_NO_FINI = NULL; + if (strcmp(lbl, "__fini_array_end") == 0) { return (SymbolAddr *) &RTS_NO_FINI; } + if (strcmp(lbl, "__fini_array_start") == 0) { return (SymbolAddr *) &RTS_NO_FINI; } + if (dependent) { // Add dependent as symbol's owner's dependency ObjectCode *owner = pinfo->owner; |