1. 04 Feb, 2019 1 commit
  2. 03 Feb, 2019 7 commits
  3. 02 Feb, 2019 3 commits
  4. 01 Feb, 2019 3 commits
  5. 31 Jan, 2019 23 commits
  6. 30 Jan, 2019 3 commits
    • Zejun Wu's avatar
      Don't use X86_64_ELF_NONPIC_HACK for +RTS -xp · 6e96aa2d
      Zejun Wu authored
      Summary:
      When `+RTS -xp` is passed, when don't need the X86_64_ELF_NONPIC_HACK,
      becasue the relocation offset should only be out of range if
      
      * the object file was not compiled with `-fPIC -fexternal-dynamic-refs`;
      * ghc generates non-pic code while it should (e.g. #15723)
      
      In either case, we should print an error message rather that silently
      attempt to use a hacky workaround that may not work.
      
      This could have made debugging #15723 and #15729 much easier.
      
      Test Plan:
      Run this in a case where ghci used to crash becasue of T15723. Now we
      see helpful message like:
      
      ```
      ghc-iserv-prof: R_X86_64_PC32 relocation out of range:
      stmzm2zi4zi4zi1zmJQn4hNPyYjP5m9AcbI88Ve_ControlziConcurrentziSTMziTMVar_readTMVar_C61n_cc
      = 9b95ffac
      ```
      
      Reviewers: simonmar, bgamari, erikd
      
      Reviewed By: simonmar, bgamari
      
      Subscribers: rwbarton, carter
      
      Differential Revision: https://phabricator.haskell.org/D5233
      6e96aa2d
    • Zejun Wu's avatar
      Allocate bss section within proper range of other sections · 740534d4
      Zejun Wu authored
      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
      740534d4
    • Zejun Wu's avatar
      Add a RTS option -xp to load PIC object anywhere in address space · e29b1ee7
      Zejun Wu authored
      Summary:
      This re-applies {D5195} with fixes for i386:
      * Fix unused label warnings, see {D5230} or {D5273}
      * Fix a silly bug introduced by moving `#if`
      
      {P190}
      
      Add a RTS option -xp to load PIC object anywhere in address space. We do
      this by relaxing the requirement of <0x80000000 result of
      `mmapForLinker` and implying USE_CONTIGUOUS_MMAP.
      
      We also need to change calls to `ocInit` and `ocGetNames` to avoid
      dangling pointers when the address of `oc->image` is changed by
      `ocAllocateSymbolExtra`.
      
      Test Plan:
      See {D5195}, also test under i386:
      
      ```
      $ uname -a
      Linux watashi-arch32 4.18.5-arch1-1.0-ARCH #1 SMP PREEMPT Tue Aug 28
      20:45:30 CEST 2018 i686 GNU/Linux
      $ cd testsuite/tests/th/ && make test
      ...
      ```
      
      will run `./validate` on stacked diff.
      
      Reviewers: simonmar, bgamari, alpmestan, trommler, hvr, erikd
      
      Reviewed By: simonmar
      
      Subscribers: rwbarton, carter
      
      Differential Revision: https://phabricator.haskell.org/D5289
      e29b1ee7