Allocate bss section within proper range of other sections
Concern Raised8306141397d6

Authored by watashi on Oct 15 2018, 12:52 PM.

Description

Allocate bss section within proper range of other sections

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

This depends on D5195: Add a RTS option -xp to load PIC object anywhere in address space

Test Plan:

  1. ./validate

with

DYNAMIC_GHC_PROGRAMS = NO
DYNAMIC_BY_DEFAULT = NO

TEST="T15729" make test passed in both linux and macos.

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: Trac #15729

Differential Revision: https://phabricator.haskell.org/D5219

bgamari raised a concern with this commit.Oct 30 2018, 1:47 PM
bgamari added a subscriber: bgamari.

Unfortunately I only noticed now that this breaks essentially every external interpreter test on i386. I'm afraid I'm going to need to revert. @watashi, do you think you could investigate?

This commit now has outstanding concerns.Oct 30 2018, 1:47 PM

@bgamari I will investigate this, it will take some time to setup an i686 environment, so feel free to revert this.