diff options
author | Ben Gamari <ben@smart-cactus.org> | 2018-10-30 14:47:53 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2018-10-30 16:12:00 -0400 |
commit | 9cbf6f2baf793e361d41b9c36497c5601ff22253 (patch) | |
tree | a6fcb61e43f95c23d046301edf41a727959054ad /rts/Linker.c | |
parent | 7e1690d17b39a9491e46b12297adad8d0c89b550 (diff) | |
download | haskell-9cbf6f2baf793e361d41b9c36497c5601ff22253.tar.gz |
Revert "Allocate bss section within proper range of other sections"
This reverts commit e019ec94f12268dd92ea5d5204e9e57e7ebf10ca.
This sadly breaks the external interpreter on i386.
For instance, see https://circleci.com/gh/ghc/ghc/10925.
Diffstat (limited to 'rts/Linker.c')
-rw-r--r-- | rts/Linker.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/rts/Linker.c b/rts/Linker.c index 48d52c3f3d..b42a0de9c3 100644 --- a/rts/Linker.c +++ b/rts/Linker.c @@ -1284,8 +1284,6 @@ mkOc( pathchar *path, char *image, int imageSize, #if defined(NEED_SYMBOL_EXTRAS) oc->symbol_extras = NULL; #endif - oc->bssBegin = NULL; - oc->bssEnd = NULL; oc->imageMapped = mapped; oc->misalignment = misalignment; @@ -1499,35 +1497,35 @@ HsInt loadOc (ObjectCode* oc) } /* Note [loadOc orderings] - The order of `ocAllocateExtras` and `ocGetNames` matters. For MachO + The order of `ocAllocateSymbolExtras` and `ocGetNames` matters. For MachO and ELF, `ocInit` and `ocGetNames` initialize a bunch of pointers based - on the offset to `oc->image`, but `ocAllocateExtras` may relocate + on the offset to `oc->image`, but `ocAllocateSymbolExtras` may relocate the address of `oc->image` and invalidate those pointers. So we must - compute or recompute those pointers after `ocAllocateExtras`. + compute or recompute those pointers after `ocAllocateSymbolExtras`. On Windows, when we have an import library we (for now, as we don't honor the lazy loading semantics of the library and instead GHCi is already lazy) don't use the library after ocGetNames as it just populates the - symbol table. Allocating space for jump tables in ocAllocateExtras + symbol table. Allocating space for jump tables in ocAllocateSymbolExtras would just be a waste then as we'll be stopping further processing of the library in the next few steps. If necessary, the actual allocation - happens in `ocGetNames_PEi386` and `ocAllocateExtras_PEi386` simply + happens in `ocGetNames_PEi386` and `ocAllocateSymbolExtras_PEi386` simply set the correct pointers. */ #if defined(NEED_SYMBOL_EXTRAS) # if defined(OBJFORMAT_MACHO) - r = ocAllocateExtras_MachO ( oc ); + r = ocAllocateSymbolExtras_MachO ( oc ); if (!r) { IF_DEBUG(linker, - debugBelch("loadOc: ocAllocateExtras_MachO failed\n")); + debugBelch("loadOc: ocAllocateSymbolExtras_MachO failed\n")); return r; } # elif defined(OBJFORMAT_ELF) - r = ocAllocateExtras_ELF ( oc ); + r = ocAllocateSymbolExtras_ELF ( oc ); if (!r) { IF_DEBUG(linker, - debugBelch("loadOc: ocAllocateExtras_ELF failed\n")); + debugBelch("loadOc: ocAllocateSymbolExtras_ELF failed\n")); return r; } # endif @@ -1548,7 +1546,7 @@ HsInt loadOc (ObjectCode* oc) } # if defined(OBJFORMAT_PEi386) - ocAllocateExtras_PEi386 ( oc ); + ocAllocateSymbolExtras_PEi386 ( oc ); # endif #endif |