From f7b999e34f46343c402c34123ca5344f68a94efc Mon Sep 17 00:00:00 2001 From: wolfgang Date: Wed, 29 Sep 2004 16:51:16 +0000 Subject: [PATCH] [project @ 2004-09-29 16:51:16 by wolfgang] Mac OS X: Fix a serious bug in the linker's handling of Mach-O's GENERIC_RELOC_VANILLA relocations. MERGE TO STABLE --- ghc/rts/Linker.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ghc/rts/Linker.c b/ghc/rts/Linker.c index 7924913..71f076b 100644 --- a/ghc/rts/Linker.c +++ b/ghc/rts/Linker.c @@ -3372,7 +3372,12 @@ static int relocateSection( // Step 1: Figure out what the relocated value should be if(scat->r_type == GENERIC_RELOC_VANILLA) { - word = scat->r_value + sect->offset + ((long) image); + word = *wordPtr + (unsigned long) relocateAddress( + oc, + nSections, + sections, + scat->r_value) + - scat->r_value; } else if(scat->r_type == PPC_RELOC_SECTDIFF || scat->r_type == PPC_RELOC_LO16_SECTDIFF -- 1.7.10.4