[project @ 2002-07-16 14:56:08 by simonmar]
authorsimonmar <unknown>
Tue, 16 Jul 2002 14:56:11 +0000 (14:56 +0000)
committersimonmar <unknown>
Tue, 16 Jul 2002 14:56:11 +0000 (14:56 +0000)
commit9a972425548b14c2267e4a82fa1525314ebd7b06
tree50594080e781377224f9457abea04621e11d89d1
parent8c086331fdf6977aea94b69337ed4c9723b6de19
[project @ 2002-07-16 14:56:08 by simonmar]
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.
ghc/compiler/absCSyn/AbsCSyn.lhs
ghc/compiler/absCSyn/AbsCUtils.lhs
ghc/compiler/absCSyn/CLabel.lhs
ghc/compiler/absCSyn/PprAbsC.lhs
ghc/compiler/codeGen/CodeGen.lhs
ghc/compiler/compMan/CompManager.lhs
ghc/compiler/main/HscMain.lhs
ghc/compiler/main/HscTypes.lhs
ghc/compiler/nativeGen/AbsCStixGen.lhs
ghc/includes/StgMacros.h
ghc/rts/StgStartup.hc