-e 's|%%MODEL%%|$(MODEL)|' \
-e 's|%%SYSTEM%%|$(SYSTEM)|' \
-e 's|%%EXT_OBJ%%|.o|' \
-e 's|%%EXT_ASM%%|.s|' \
-e 's|%%EXT_ASM%%|.S|' \
-e 's|%%EXT_LIB%%|.a|' \
-e 's|%%EXT_DLL%%|.so|' \
-e 's|%%SYSTHREAD_SUPPORT%%|$(SYSTHREAD_SUPPORT)|' \
.word -1 /* negative frame size => use callback link */
.word 0 /* no roots here */
.align 3
#ifdef __ELF__
.section .note.GNU-stack,,%progbits
#endif
.align 16
caml_absf_mask:
.quad 0x7FFFFFFFFFFFFFFF, 0xFFFFFFFFFFFFFFFF
.short -1 /* negative frame size => use callback link */
.short 0 /* no roots */
.align 2
.long L104 + 3 /* return address into callback */
.section .note.GNU-stack,"",%progbits
.common caml_saved_bsp#, 8, 8
.common caml_saved_rnat#, 8, 8
.long L107 | return address into callback
.word -1 | negative frame size => use callback link
.word 0 | no roots here
.csect caml_callback3_exn[DS]
caml_callback3_exn:
.long .caml_callback3_exn, TOC[tc0], 0
.short -1 /* negative size count => use callback link */
.short 0 /* no roots here */
.type Caml_raise_exception, #function
.type Caml_system__frametable, #object
` .data\n`;
List.iter emit_item l
(* Set the stack as non-executable *)
let nx_stack() =
`#ifdef __ELF__\n`;
`.section .note.GNU-stack,\"\",%progbits\n`;
`#endif\n`
(* Beginning / end of an assembly file *)
let begin_assembly() =
`{emit_symbol lbl_begin}:\n`
let end_assembly () =
nx_stack();
let lbl_end = Compilenv.make_symbol (Some "code_end") in
` .text\n`;
` .global {emit_symbol lbl_end}\n`;
let end_assembly() =
` .globl {emit_symbol lbl_end}\n`;
` .align 8\n`;
emit_define_symbol (Compilenv.make_symbol (Some "code_begin"))
emit_define_symbol (Compilenv.make_symbol (Some "data_end"));
` .code\n`;
declare_global lbl_end;
` .end {emit_symbol lbl_begin}\n`
emit_string data_space;
(* Emit the jump table *)
if !num_jumptbl_entries > 0 then begin
emit_string code_space;
let lbl_begin = Compilenv.make_symbol (Some "data_begin") in
` .global {emit_symbol lbl_begin}\n`;