From 740534d43cf9f1635c60f6311b7e0d89af962617 Mon Sep 17 00:00:00 2001 From: Zejun Wu Date: Fri, 28 Dec 2018 20:47:33 -0800 Subject: Allocate bss section within proper range of other sections Summary: This re-applies {D5195} and {D5235}, they were reverted as part of diff stack to unbreak i386. The proper fix is done in {D5289}. Allocate bss section within proper range of other sections: * when `+RTS -xp` is passed, allocate it contiguously as we did for jump islands * when we mmap the code to lower 2Gb, we should allocate bss section there too Test Plan: 1. `./validate` 2. with ``` DYNAMIC_GHC_PROGRAMS = NO DYNAMIC_BY_DEFAULT = NO ``` `TEST="T15729" make test` passed in both linux (both i386 and x86_64) and macos. 3. Also test in a use case where we used to encouter error like: ``` ghc-iserv-prof: R_X86_64_PC32 relocation out of range: (noname) = b90282ba ``` and now, everything works fine. Reviewers: simonmar, bgamari, angerman, erikd Reviewed By: simonmar Subscribers: rwbarton, carter GHC Trac Issues: #15729 Differential Revision: https://phabricator.haskell.org/D5290 --- rts/linker/SymbolExtras.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'rts/linker/SymbolExtras.h') diff --git a/rts/linker/SymbolExtras.h b/rts/linker/SymbolExtras.h index 4974c06e7d..af828e66fa 100644 --- a/rts/linker/SymbolExtras.h +++ b/rts/linker/SymbolExtras.h @@ -7,7 +7,7 @@ #if defined(NEED_SYMBOL_EXTRAS) -int ocAllocateSymbolExtras( ObjectCode* oc, int count, int first ); +int ocAllocateExtras(ObjectCode* oc, int count, int first, int bssSize); #if defined(arm_HOST_ARCH) SymbolExtra* makeArmSymbolExtra( ObjectCode const* oc, -- cgit v1.2.1