[commit: ghc] master: Test for misaligned sections, and fail if we find one (ada1385)
Ian Lynagh
igloo at earth.li
Mon May 7 18:59:58 CEST 2012
Repository : ssh://darcs.haskell.org//srv/darcs/ghc
On branch : master
http://hackage.haskell.org/trac/ghc/changeset/ada138569326adf704a8b17ad8aa1ecbf2216f43
>---------------------------------------------------------------
commit ada138569326adf704a8b17ad8aa1ecbf2216f43
Author: Ian Lynagh <igloo at earth.li>
Date: Mon May 7 15:18:57 2012 +0100
Test for misaligned sections, and fail if we find one
>---------------------------------------------------------------
rts/Linker.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/rts/Linker.c b/rts/Linker.c
index 2899ee1..62096e6 100644
--- a/rts/Linker.c
+++ b/rts/Linker.c
@@ -3628,6 +3628,10 @@ ocGetNames_PEi386 ( ObjectCode* oc )
}
if (kind != SECTIONKIND_OTHER && end >= start) {
+ if ((((size_t)(start)) % (size_t)sizeof(void *)) != 0) {
+ barf("Misaligned section: %p", start);
+ }
+
addSection(oc, kind, start, end);
addProddableBlock(oc, start, end - start + 1);
}
More information about the Cvs-ghc
mailing list