From 217794afce69f6e17a78c10553d2357860cfe6e1 Mon Sep 17 00:00:00 2001 From: pommicket Date: Fri, 28 Jan 2022 15:07:23 -0500 Subject: start top level decls - also oops forgot about sizeless arrays --- 05/main.b | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to '05/main.b') diff --git a/05/main.b b/05/main.b index d988ee3..6d14ed1 100644 --- a/05/main.b +++ b/05/main.b @@ -36,7 +36,11 @@ global structures global structures_bytes_used ; file offset/runtime address to write next piece of read-only data; initialized in main global rodata_end_addr +; file offset/runtime address to write next piece of read-write data; initialized in main +global rwdata_end_addr global output_file_data +; ident list of addresses of global variables. +global global_variables #include util.b #include idents.b @@ -157,6 +161,7 @@ function main typedefs = ident_list_create(100000) enumerators = ident_list_create(4000000) structures = ident_list_create(4000000) + global_variables = ident_list_create(4000000) dat_banned_objmacros = 255 dat_banned_fmacros = 255 @@ -178,6 +183,7 @@ function main :have_filenames output_fd = open_rw(output_filename, 493) rodata_end_addr = RODATA_ADDR + rwdata_end_addr = RWDATA_ADDR ftruncate(output_fd, RWDATA_END) output_file_data = mmap(0, RWDATA_END, PROT_READ_WRITE, MAP_SHARED, output_fd, 0) @@ -206,6 +212,8 @@ function main munmap(output_file_data, RWDATA_END) close(output_fd) + ident_list_printx32(global_variables) + exit(0) :mmap_output_fd_failed -- cgit v1.2.3