Blame SOURCES/0010-arm64-Align-code-and-data-to-8-bytes.patch

1280ab
From 30c30cdc0b2d0af7aa05048345f272de77aba6cb Mon Sep 17 00:00:00 2001
1280ab
From: "Richard W.M. Jones" <rjones@redhat.com>
1280ab
Date: Mon, 24 Mar 2014 05:50:28 -0500
f9602d
Subject: [PATCH 10/18] arm64: Align code and data to 8 bytes.
1280ab
1280ab
Insufficient alignment seems to be the cause of relocation errors when
1280ab
linking large native code OCaml programs:
1280ab
1280ab
 (.text+0xc): relocation truncated to fit: R_AARCH64_LDST64_ABS_LO12_NC against symbol `camlOdoc_type' defined in .data section in odoc_type.o
1280ab
../stdlib/stdlib.a(listLabels.o): In function `camlListLabels__entry':
1280ab
(.text+0x10): relocation truncated to fit: R_AARCH64_LDST64_ABS_LO12_NC against symbol `camlListLabels' defined in .data section in ../stdlib/stdlib.a(listLabels.o)
1280ab
1280ab
PR#6283 http://caml.inria.fr/mantis/view.php?id=6283
1280ab
---
1280ab
 asmcomp/arm64/emit.mlp | 3 ++-
1280ab
 1 file changed, 2 insertions(+), 1 deletion(-)
1280ab
1280ab
diff --git a/asmcomp/arm64/emit.mlp b/asmcomp/arm64/emit.mlp
1280ab
index fc9649c..4e7c4b0 100644
1280ab
--- a/asmcomp/arm64/emit.mlp
1280ab
+++ b/asmcomp/arm64/emit.mlp
1280ab
@@ -651,7 +651,7 @@ let fundecl fundecl =
1280ab
   call_gc_sites := [];
1280ab
   bound_error_sites := [];
1280ab
   `	.text\n`;
1280ab
-  `	.align	2\n`;
1280ab
+  `	.align	3\n`;
1280ab
   `	.globl	{emit_symbol fundecl.fun_name}\n`;
1280ab
   `	.type	{emit_symbol fundecl.fun_name}, %function\n`;
1280ab
   `{emit_symbol fundecl.fun_name}:\n`;
1280ab
@@ -692,6 +692,7 @@ let emit_item = function
1280ab
 
1280ab
 let data l =
1280ab
   `	.data\n`;
1280ab
+  `	.align 3\n`;
1280ab
   List.iter emit_item l
1280ab
 
1280ab
 (* Beginning / end of an assembly file *)
1280ab
-- 
f9602d
2.3.1
1280ab