From d1d8f1f49cfd29eb89ea6914facb45e0c9238426 Mon Sep 17 00:00:00 2001 From: Xavier Leroy Date: Fri, 10 Feb 2017 14:15:13 +0100 Subject: OS X: emit jumptables in .text segment, not .const segment In 64-bit mode jumptables contain differences of labels Lx-Ly. The OS X assembler and linker have problems with those differences if the labels are from a given section (here, .text) and the difference is to be put in another section (previously, .const). Putting the jumptables in .text fixes this issue, and is consistent with what is done for ELF. --- x86/TargetPrinter.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'x86') diff --git a/x86/TargetPrinter.ml b/x86/TargetPrinter.ml index 5fb8ae0c..4a576df3 100644 --- a/x86/TargetPrinter.ml +++ b/x86/TargetPrinter.ml @@ -168,7 +168,7 @@ module MacOS_System : SYSTEM = if i then ".const" else "COMM" | Section_string -> ".const" | Section_literal -> ".literal8" - | Section_jumptable -> ".const" + | Section_jumptable -> ".text" (* needed in 64 bits, not a problem in 32 bits *) | Section_user(s, wr, ex) -> sprintf ".section \"%s\", %s, %s" (if wr then "__DATA" else "__TEXT") s -- cgit