summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavier Leroy <xavierleroy@users.noreply.github.com>2019-03-29 15:31:21 +0100
committerGabriel Scherer <gabriel.scherer@gmail.com>2019-07-16 16:41:55 +0200
commit03fa0f040cc803d29b26dae0047ad1adfccf06f9 (patch)
tree984584e320e2897ddf8bbfc8fabd01f7309828ff
parent6fb3d3ab4b65c7332028bd3e929f26e77bcda490 (diff)
downloadocaml-03fa0f040cc803d29b26dae0047ad1adfccf06f9.tar.gz
Ensure frame table is 8-aligned on ARM64 and PPC64 (#8557)
This is a follow-up to commit 7077b60 that fixed a lack of 8-alignment for the frame table on ADM64, as reported in #7591. A similar issue was reported in #7887 for ARM64 and is fixed here. For good measure, explicit alignment was added to PPC64 as well, although there was probably no issue there. Closes: #7887.
-rw-r--r--Changes4
-rw-r--r--asmcomp/arm64/emit.mlp3
-rw-r--r--asmcomp/power/emit.mlp1
3 files changed, 7 insertions, 1 deletions
diff --git a/Changes b/Changes
index 30efc781f1..9e848a8179 100644
--- a/Changes
+++ b/Changes
@@ -3,6 +3,10 @@ OCaml 4.08 maintenance branch:
### Bug fixes:
+- #7887: ensure frame table is 8-aligned on ARM64 and PPC64
+ (Xavier Leroy, report by Mark Hayden, review by Mark Shinwell
+ and Gabriel Scherer)
+
- #8751: fix bug that could result in misaligned data section when compiling to
native-code on amd64. (observed with the mingw64 compiler)
(Nicolás Ojeda Bär, review by David Allsopp)
diff --git a/asmcomp/arm64/emit.mlp b/asmcomp/arm64/emit.mlp
index 8c855b8de8..5879266358 100644
--- a/asmcomp/arm64/emit.mlp
+++ b/asmcomp/arm64/emit.mlp
@@ -993,7 +993,8 @@ let end_assembly () =
` .quad 0\n`; (* PR#6329 *)
` .globl {emit_symbol lbl_end}\n`;
`{emit_symbol lbl_end}:\n`;
- ` .long 0\n`;
+ ` .quad 0\n`;
+ ` .align 3\n`; (* #7887 *)
let lbl = Compilenv.make_symbol (Some "frametable") in
` .globl {emit_symbol lbl}\n`;
`{emit_symbol lbl}:\n`;
diff --git a/asmcomp/power/emit.mlp b/asmcomp/power/emit.mlp
index f4147c492d..b489fa995f 100644
--- a/asmcomp/power/emit.mlp
+++ b/asmcomp/power/emit.mlp
@@ -1222,6 +1222,7 @@ let end_assembly() =
` {emit_string datag} 0\n`;
(* Emit the frame descriptors *)
emit_string data_space; (* not rodata_space because it contains relocations *)
+ if ppc64 then ` .align 3\n`; (* #7887 *)
let lbl = Compilenv.make_symbol (Some "frametable") in
declare_global_data lbl;
`{emit_symbol lbl}:\n`;