mirror of https://github.com/Nonannet/copapy.git
small changes
This commit is contained in:
parent
6af960bd46
commit
60aa550ec7
|
|
@ -356,6 +356,9 @@ def compile_to_instruction_list(node_list: Iterable[Node], sdb: stencil_database
|
|||
|
||||
object_list, data_section_lengths = variable_mem_layout(variable_list)
|
||||
|
||||
# Deallocate old allocated memory (if existing)
|
||||
dw.write_com(binw.Command.FREE_MEMORY)
|
||||
|
||||
# Write data
|
||||
dw.write_com(binw.Command.ALLOCATE_DATA)
|
||||
dw.write_int(data_section_lengths)
|
||||
|
|
|
|||
|
|
@ -100,8 +100,8 @@ int parse_commands(uint8_t *bytes) {
|
|||
offs = *(uint32_t*)bytes; bytes += 4;
|
||||
reloc_type = *(uint32_t*)bytes; bytes += 4;
|
||||
value = *(int32_t*)bytes; bytes += 4;
|
||||
printf("PATCH_OBJECT patch_offs=%i reloc_type=%i value=%i data_offs=%i\n",
|
||||
offs, reloc_type, value, data_offs);
|
||||
printf("PATCH_OBJECT patch_offs=%i reloc_type=%i value=%i\n",
|
||||
offs, reloc_type, value);
|
||||
patch(executable_memory + offs, reloc_type, value + data_offs);
|
||||
break;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue