summaryrefslogtreecommitdiff
path: root/rts
diff options
context:
space:
mode:
authorArtem Pyanykh <artempyanykh@gmail.com>2019-03-16 18:12:00 +0300
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-03-20 19:52:39 -0400
commitd950f11eff0a5dc0ad950fbd47e3ee32649d1d62 (patch)
treef2bcc1c6aaac15a0a0a1501fbdb9e99685b2d3c6 /rts
parentcb745c84a192c4a1f992649fbda584941f8ec3eb (diff)
downloadhaskell-d950f11eff0a5dc0ad950fbd47e3ee32649d1d62.tar.gz
Directly test section alignment, fix internal reloc probing length
Diffstat (limited to 'rts')
-rw-r--r--rts/linker/MachO.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/rts/linker/MachO.c b/rts/linker/MachO.c
index b720077bbb..6e109e592d 100644
--- a/rts/linker/MachO.c
+++ b/rts/linker/MachO.c
@@ -977,11 +977,15 @@ relocateSection(ObjectCode* oc, int curSection)
}
IF_DEBUG(linker, debugBelch("relocateSection: thing = %p\n", (void *) thing));
+
+ /* Thing points to memory within one of the relocated sections. We can
+ * probe the first byte to sanity check internal relocations.
+ */
if (0 == reloc->r_extern) {
if (reloc->r_pcrel) {
- checkProddableBlock(oc, (void *)((char *)thing + baseValue), relocLenBytes);
+ checkProddableBlock(oc, (void *)((char *)thing + baseValue), 1);
} else {
- checkProddableBlock(oc, (void *)thing, relocLenBytes);
+ checkProddableBlock(oc, (void *)thing, 1);
}
}