X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2FLinker.c;h=2a45aac757a89cf7a70e657b39ea77f6365540e6;hb=b5a358ee5582b139e2499d873c696eb27742f028;hp=70aae3b0f9cbb26d9278110017b45c40cf2ac36b;hpb=77b29b5685db2f8745d191af1599ed753bef91e7;p=ghc-hetmet.git diff --git a/rts/Linker.c b/rts/Linker.c index 70aae3b..2a45aac 100644 --- a/rts/Linker.c +++ b/rts/Linker.c @@ -4690,9 +4690,12 @@ static int relocateSection( } else { - value = sections[reloc->r_symbolnum-1].offset - - sections[reloc->r_symbolnum-1].addr - + (uint64_t) image; + // If the relocation is not through the global offset table + // or external, then set the value to the baseValue. This + // will leave displacements into the __const section + // unchanged (as they ought to be). + + value = baseValue; } IF_DEBUG(linker, debugBelch("relocateSection: value = %p\n", (void *)value));