[project @ 1999-03-02 19:10:07 by sof]
authorsof <unknown>
Tue, 2 Mar 1999 19:10:07 +0000 (19:10 +0000)
committersof <unknown>
Tue, 2 Mar 1999 19:10:07 +0000 (19:10 +0000)
On mingw32, which is the only 'platform' where we support producing
DLLs, prefix each static closure with a zero word. This is needed so
that we can distinguish between pointers to (reversed!) info tables
and static closures just by checking whether there's a zero word just
above the pointed-to entity. Wish there was a better way..

ghc/driver/ghc-asm.lprl

index e640f42..da664ad 100644 (file)
@@ -126,6 +126,7 @@ sub init_TARGET_STUFF {
     $T_HDR_data            = "\.data\n\t\.align 2\n";
     $T_HDR_consist  = "\.text\n";
     $T_HDR_closure  = "\.data\n\t\.align 2\n";
+    $T_HDR_closure  = "\.data\n\t\.align 2\n\t.long 0\n" if ( $TargetPlatform =~ /.*-mingw32$/ );
     $T_HDR_srt      = "\.data\n\t\.align 2\n";
     $T_HDR_info            = "\.text\n\t\.align 2\n"; # NB: requires padding
     $T_HDR_entry    = "\.text\n"; # no .align so we're right next to _info (arguably wrong...?)