Skip to content
  • Simon Marlow's avatar
    [project @ 2002-07-16 14:56:08 by simonmar] · 9a972425
    Simon Marlow authored
    Implement a primitive failsafe mechanism for protecting against
    linking inconsistent object files.  The idea is that if object files
    which were compiled in the wrong order (non-dependency order) or
    compiled in different ways (eg. profiled vs. non-profiled) are linked
    together, a link error will result.
    
    This is achieved by adding the module version and the way to the
    module init label.  For example, previously the init label for a
    module Foo was named
    
    	__stginit_Foo
    
    now it is named
    
    	__stginit_Foo_<version>_<way>
    
    where <version> is the module version of Foo (same as the version in
    the interface file), and <way> is the current way (or empty).
    
    We also have to have a way to refer to the old plain init label, for
    using as the argument to shutdownHaskell() in a program using foreign
    exports.  So the old label now points to a jump instruction which
    transfers control to the new init code.
    9a972425