1. 04 Feb, 2002 11 commits
  2. 01 Feb, 2002 2 commits
    • simonmar's avatar
      [project @ 2002-02-01 10:50:35 by simonmar] · b8684d58
      simonmar authored
      When distinguishing between code & data pointers, rather than testing
      for membership of the text section, test for not membership of one of
      the data sections.
      
      The reason for this change is that testing for membership of the text
      section was fragile:  we could only test whether a value was smaller
      than the end address, because there doesn't appear to be a portable
      way to find the beginning of the text section.  Indeed, the test
      breaks on very recent Linux kernels which mmap() memory below the
      program text.
      
      In fact, the reversed test may be faster because the expected common
      case is when the pointer is into the dynamic heap, and we eliminate
      these case immediately in the new test.  A quick test shows no
      measurable performance difference with the change.
      
      MERGE TO STABLE
      b8684d58
    • sof's avatar
      [project @ 2002-02-01 02:05:52 by sof] · 7d1c6665
      sof authored
      Add URLs and other pointers to resources on the PE COFF format.
      7d1c6665
  3. 31 Jan, 2002 3 commits
    • sof's avatar
      [project @ 2002-01-31 23:04:15 by sof] · 48ccd03c
      sof authored
      Win32 implementation, first pass.
      48ccd03c
    • sof's avatar
      [project @ 2002-01-31 11:18:06 by sof] · 3b9c5eb2
      sof authored
      First steps towards implementing better interop between
      Concurrent Haskell and native threads.
      
      - factored out Capability handling into a separate source file
        (only the SMP build uses multiple capabilities tho).
      - factored out OS/native threads handling into a separate
        source file, OSThreads.{c,h}. Currently, just a pthreads-based
        implementation; Win32 version to follow.
      - scheduler code now distinguishes between multi-task threaded
        code (SMP) and single-task threaded code ('threaded RTS'),
        but sharing code between these two modes whenever poss.
      
      i.e., just a first snapshot; the bulk of the transitioning code
      remains to be implemented.
      3b9c5eb2
    • sof's avatar
      [project @ 2002-01-31 07:04:27 by sof] · 1ac8af86
      sof authored
      got tired of seeing gcc trigraph warning
      1ac8af86
  4. 30 Jan, 2002 2 commits
    • simonmar's avatar
      [project @ 2002-01-30 16:27:34 by simonmar] · 1e046f78
      simonmar authored
      Set $(HC) *after* including boilerplate.mk, which re-defines it.
      1e046f78
    • simonmar's avatar
      [project @ 2002-01-30 12:17:21 by simonmar] · 975ef297
      simonmar authored
      Clean up this Makefile:
      
        - Use the enhanced automatic source-finding machinery from
          paths.mk rather than rolling our own,
      
        - Turn on UseGhcForCc to get our C files compiled with GHC.
          This fixes some obscure bugs caused by the fact that we
          were re-initializing $(CC_OPTS) in this Makefile using
          :=, when it had previously already been set with = (apparently
          different versions of GNU make behave differently presented
          with this kind of mixed assigment).
      975ef297
  5. 29 Jan, 2002 4 commits
    • simonmar's avatar
      [project @ 2002-01-29 16:24:08 by simonmar] · 662555be
      simonmar authored
      Inline mpz_cmp_si() into cmpIntegerInt#, and mpz_cmp() into cmpInteger#
      to offset recent performance degradation caused by outlining of these
      primitives.
      
      Also remove heap checks in these primitives: they don't do any
      allocation, so no heap check is necessary.
      662555be
    • simonmar's avatar
      [project @ 2002-01-29 14:41:52 by simonmar] · 5bed878b
      simonmar authored
      Fix highly obscure bug.
      
      The heap check in cmpIntegerzh_fast was erroneously passing
      cmpIntegerIntzh_fast as the resumption point instead of
      cmpIntegerzh_fast, with the result that if a heap-check happened to
      strike in cmpIntegerzh_fast then we would end up resuming in
      cmpIntegerIntzh and returning an incorrect comparison result.  One
      symptom is that very occasionally floating point numbers would print
      incorrectly (ending in an 'a').
      5bed878b
    • sof's avatar
      [project @ 2002-01-29 06:15:03 by sof] · a704ee9c
      sof authored
      Update comments re: reloc overflow. A careful re-read of the PE
      spec did prove useful; Sec 4.1 (last para) describes how overflow
      is handled.
      a704ee9c
    • sof's avatar
      [project @ 2002-01-29 02:41:21 by sof] · 9efa7107
      sof authored
      PEi386/COFF: handle relocation overflows, i.e., if a section is
      marked with the flag (MY)IMAGE_SCN_LNK_NRELOC_OVFL, then
      the first entry in the relocation table holds the 32-bit
      relocation count rather than 16-bit number in the section header.
      Apparently, a version of the MS PE spec exists that spells this
      out, but haven't been able to locate it (perhaps people on the
      'inside' could try to locate an up-to-date version...?) winnt.h
      is clear enough about it though (as is the GNU libbfd sources).
      
      This is the Right Way to compute the relocation count, but
      unfortunately libbfd / GNU ld is generating bogus output
      when the reloc field overflows (causing objdump/nm etc. to
      crash when trying to read the generated output!) Looking into it.
      
      Once this has been cleared up/fixed, the splitting up of HSstd.o
      (and HSwin32.o) should be a thing of the past. I've taken the
      liberty of disabling the suspiciously-large-reloc-section test
      already.
      9efa7107
  6. 26 Jan, 2002 2 commits
    • rje's avatar
      [project @ 2002-01-26 18:04:48 by rje] · d117cff1
      rje authored
      Minor tweak to use the new names.
      
      X_ret_info -> X_info.
      
      Just so the mangler finds things more easily.
      
      For more info, see the commit to HeapStackCheck.hc
      d117cff1
    • rje's avatar
      [project @ 2002-01-26 17:58:47 by rje] · 464f0373
      rje authored
      This is a simple fix for a rather obscure bug.
      
      In the heap/stack checking code, we were creating info tables with names of the form stg_gc_X_ret_info, and giving them entry points with names of the form stg_gc_X_ret.
      
      Unfortunately, the mangler expects that if an info table is called Y_info, the entry point should be called Y_ret or Y_entry.
      
      In this case, the mangler thus looks for stg_gc_X_ret_ret and stg_gc_X_ret_entry, neither of which exists.
      
      As a result, the entry points aren't placed directly after the info tables.
      
      Fortunately, the code for the entry points was defined emmediately after the info table definition, and so was *usually* in the right place already.
      
      
      However, in certain circumstances (that can result from some tweaks on my private tree, and might possibly occur by other means), this was not happening, and thus any attempts to enter the entry point for this info table will cause problems.
      
      
      The fix is quite simple: rename the info tables so that the mangler finds the entry points and puts them in the right places.
      
      
      I don't think this commit is likely to have a notable effect on anything else.
      464f0373
  7. 25 Jan, 2002 2 commits
  8. 24 Jan, 2002 5 commits
  9. 23 Jan, 2002 1 commit
    • sewardj's avatar
      [project @ 2002-01-23 11:29:12 by sewardj] · 830c1108
      sewardj authored
      Fix two problems with the ELF linker:
      
      1.  Determine section attributes by examining various bits in the
          section header tables, rather than from the section names.  This
          makes it robust against future changes / additions to the set of
          section names.
      
      2.  Handle local symbols differently.  Do not add them to our own
          local symbol table for this object, since that's
      
          (a) wrong -- multiple local symbols can have the same name so long
              as each is in a different section, so if we just dump them into
              the local symbol table we'll wind up with apparently duplicate
              symbols
      
          (b) totally unnecessary, since the relocations against local symbols
              simply specify an index into the ELF symbol table for the object,
              from whence the address can be calculated without reference to the
              name.
      
      TODO: Test on sparc-solaris
            Investigate whether PEi386 linker needs fixing similarly
      and then
      MERGE TO STABLE
      830c1108
  10. 22 Jan, 2002 1 commit
    • simonmar's avatar
      [project @ 2002-01-22 13:54:22 by simonmar] · 33a7aa8b
      simonmar authored
      Deadlock is now an exception instead of a return status from
      rts_evalIO().
      
      The current behaviour is as follows, and can be changed if necessary:
      in the event of a deadlock, the top main thread is taken from the main
      thread queue, and if it is blocked on an MVar or an Exception (for
      throwTo), then it receives a Deadlock exception.  If it is blocked on
      a BLACKHOLE, we instead send it the NonTermination exception.  Note
      that only the main thread gets the exception: it is the responsibility
      of the main thread to unblock other threads if necessary.
      
      There's a slight difference in the SMP build: *all* the main threads
      get an exception, because clearly none of them may make progress
      (compared to the non-SMP situation, where all but the top main thread
      are usually blocked).
      33a7aa8b
  11. 21 Jan, 2002 1 commit
  12. 15 Jan, 2002 1 commit
  13. 08 Jan, 2002 1 commit
    • sof's avatar
      [project @ 2002-01-08 16:38:27 by sof] · dd7f7b3d
      sof authored
      Make better use of the -M<size> setting under Win32. Use it to guide
      the amount of VM to reserve -- the default is (still) 256M, but the
      user will now have a way of overriding this setting.
      dd7f7b3d
  14. 07 Jan, 2002 1 commit
    • ken's avatar
      [project @ 2002-01-07 22:35:55 by ken] · 30f68dc6
      ken authored
      On the alpha, __divq() in libc.a clobbers $s6, so StgRun() needs to save
      $s6.  While we are at it, let us save $f8 and $f9 as well.
      MERGE TO STABLE
      30f68dc6
  15. 29 Dec, 2001 1 commit
  16. 20 Dec, 2001 1 commit
  17. 19 Dec, 2001 1 commit