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