Commit a914a224 authored by gwright@antiope.com's avatar gwright@antiope.com

Fix #4867, ghci displays negative floats incorrectly

This patch fixes the erroneous relocations that caused
the bug in ticket #4867.  External addresses and global
offset table entries were relocated correctly, but all other
relocations were incorrectly calculated.  This caused, for
example, bad references to constants stored in the __const
section of the __TEXT segment.

This bug only affected OS X on 64-bit platforms.
parent 72c4f624
......@@ -4690,9 +4690,7 @@ static int relocateSection(
}
else
{
value = sections[reloc->r_symbolnum-1].offset
- sections[reloc->r_symbolnum-1].addr
+ (uint64_t) image;
value = relocateAddress(oc, nSections, sections, reloc->r_address);
}
IF_DEBUG(linker, debugBelch("relocateSection: value = %p\n", (void *)value));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment