From 4925303d4f8c011fbb40157cbf44e51a68f7aa2d Mon Sep 17 00:00:00 2001 From: Xavier Leroy Date: Sat, 26 Dec 2020 18:54:14 +0100 Subject: AArch64 / macOS: use __DATA,__CONST section instead of .const (temporary fix) The .const section cannot contain absolute references to symbols, as these may need relocation and therefore must be writable. This should be fixed more generally by distinguishing between initialization data that contains absolute references to symbols and initialization data that does not. --- aarch64/TargetPrinter.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'aarch64') diff --git a/aarch64/TargetPrinter.ml b/aarch64/TargetPrinter.ml index 1c1ff018..6e7b3fba 100644 --- a/aarch64/TargetPrinter.ml +++ b/aarch64/TargetPrinter.ml @@ -226,7 +226,7 @@ module MacOS_System : SYSTEM = | Section_data i | Section_small_data i -> if i || (not !Clflags.option_fcommon) then ".data" else "COMM" | Section_const i | Section_small_const i -> - if i || (not !Clflags.option_fcommon) then ".const" else "COMM" + if i || (not !Clflags.option_fcommon) then ".section __DATA,__CONST" else "COMM" | Section_string -> ".const" | Section_literal -> ".const" | Section_jumptable -> ".text" -- cgit