mirror of
https://github.com/N64Recomp/N64ModernRuntime.git
synced 2025-10-30 08:02:29 +00:00
Fix native exports not getting cleared and bss sometimes not getting zero'd (#110)
Some checks are pending
validate / ubuntu (arm64, Debug) (push) Waiting to run
validate / ubuntu (arm64, Release) (push) Waiting to run
validate / ubuntu (x64, Debug) (push) Waiting to run
validate / ubuntu (x64, Release) (push) Waiting to run
validate / windows (x64, Debug) (push) Waiting to run
validate / windows (x64, Release) (push) Waiting to run
validate / macos (arm64, Debug) (push) Waiting to run
validate / macos (arm64, Release) (push) Waiting to run
validate / macos (x64, Debug) (push) Waiting to run
validate / macos (x64, Release) (push) Waiting to run
Some checks are pending
validate / ubuntu (arm64, Debug) (push) Waiting to run
validate / ubuntu (arm64, Release) (push) Waiting to run
validate / ubuntu (x64, Debug) (push) Waiting to run
validate / ubuntu (x64, Release) (push) Waiting to run
validate / windows (x64, Debug) (push) Waiting to run
validate / windows (x64, Release) (push) Waiting to run
validate / macos (arm64, Debug) (push) Waiting to run
validate / macos (arm64, Release) (push) Waiting to run
validate / macos (x64, Debug) (push) Waiting to run
validate / macos (x64, Release) (push) Waiting to run
This commit is contained in:
parent
0aa75b98ba
commit
327c34db2d
1 changed files with 9 additions and 2 deletions
|
|
@ -327,6 +327,7 @@ recomp::mods::CodeModLoadError recomp::mods::ModHandle::load_native_library(cons
|
|||
return api_error;
|
||||
}
|
||||
|
||||
native_library_exports.clear();
|
||||
for (const std::string& export_name : lib_manifest.exports) {
|
||||
recomp_func_t* cur_func;
|
||||
if (native_library_exports.contains(export_name)) {
|
||||
|
|
@ -2097,8 +2098,14 @@ recomp::mods::CodeModLoadError recomp::mods::ModContext::init_mod_code(uint8_t*
|
|||
MEM_B(i, (gpr)cur_section_addr) = binary_data[section.rom_addr + i];
|
||||
}
|
||||
mod.section_load_addresses[section_index] = cur_section_addr;
|
||||
// Calculate the next section's address based on the size of this section and its bss.
|
||||
cur_section_addr += section.size + section.bss_size;
|
||||
// Calculate the bss section's address based on the size of this section.
|
||||
cur_section_addr += section.size;
|
||||
// Zero the bss section.
|
||||
for (size_t i = 0; i < section.bss_size; i++) {
|
||||
MEM_B(i, (gpr)cur_section_addr) = 0;
|
||||
}
|
||||
// Calculate the next section's address based on the size of the bss section.
|
||||
cur_section_addr += section.bss_size;
|
||||
// Align the next section's address to 16 bytes.
|
||||
cur_section_addr = (cur_section_addr + 15) & ~15;
|
||||
// Add some empty space between mods to act as a buffer for misbehaving mods that have out of bounds accesses.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue