mirror of
https://github.com/ProgramSnail/Lama.git
synced 2025-12-06 06:48:48 +00:00
fix sections; remove __gc_start and __gc_end labels
This commit is contained in:
parent
711c8d2f12
commit
f5526507a1
2 changed files with 6 additions and 9 deletions
|
|
@ -790,7 +790,7 @@ extern int Lwrite (int n) {
|
|||
|
||||
/* GC starts here */
|
||||
|
||||
extern const size_t __gc_data_end, __gc_data_start;
|
||||
extern const size_t __start_custom_data, __stop_custom_data;
|
||||
|
||||
# ifdef __ENABLE_GC__
|
||||
|
||||
|
|
@ -1004,8 +1004,8 @@ extern void gc_test_and_copy_root (size_t ** root) {
|
|||
}
|
||||
|
||||
extern void gc_root_scan_data (void) {
|
||||
size_t * p = &__gc_data_start;
|
||||
while (p != &__gc_data_end) {
|
||||
size_t * p = &__start_custom_data;
|
||||
while (p != &__stop_custom_data) {
|
||||
gc_test_and_copy_root (p);
|
||||
p++;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -659,15 +659,12 @@ class env prg =
|
|||
let genasm cmd prog =
|
||||
let sm = SM.compile cmd prog in
|
||||
let env, code = compile cmd (new env sm) sm in
|
||||
let gc_start, gc_end = "__gc_data_start", "__gc_data_end" in
|
||||
let globals =
|
||||
List.map (fun s -> Meta (Printf.sprintf "\t.globl\t%s" s)) ([gc_start; gc_end] @ env#publics)
|
||||
List.map (fun s -> Meta (Printf.sprintf "\t.globl\t%s" s)) env#publics
|
||||
in
|
||||
let data = [Meta "\t.data";
|
||||
Meta (Printf.sprintf "filler:\t.fill\t%d, 4, 1" env#max_locals_size);
|
||||
Meta (Printf.sprintf "%s:" gc_start)] @
|
||||
let data = [Meta "\t.section custom_data,\"aw\",@progbits";
|
||||
Meta (Printf.sprintf "filler:\t.fill\t%d, 4, 1" env#max_locals_size)] @
|
||||
(List.map (fun s -> Meta (Printf.sprintf "%s:\t.int\t1" s)) env#globals) @
|
||||
[Meta (Printf.sprintf "%s:" gc_end)] @
|
||||
(List.map (fun (s, v) -> Meta (Printf.sprintf "%s:\t.string\t\"%s\"" v s)) env#strings)
|
||||
in
|
||||
let asm = Buffer.create 1024 in
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue