Optimize check for .bss/.sbss section

This commit is contained in:
Maschell 2022-05-13 16:17:40 +02:00
parent bf7db1c4eb
commit 790394a72d

View File

@ -128,10 +128,7 @@ ModuleDataFactory::load(const std::string &path, uint32_t destination_address_en
} }
//nextAddress = ROUNDUP(destination + sectionSize, 0x100); //nextAddress = ROUNDUP(destination + sectionSize, 0x100);
if (psec->get_name() == ".bss") { if (psec->get_name() == ".bss" || psec->get_name() == ".sbss") {
DEBUG_FUNCTION_LINE("memset %s section. Location: %08X size: %08X", psec->get_name().c_str(), destination, sectionSize);
memset(reinterpret_cast<void *>(destination), 0, sectionSize);
} else if (psec->get_name() == ".sbss") {
DEBUG_FUNCTION_LINE("memset %s section. Location: %08X size: %08X", psec->get_name().c_str(), destination, sectionSize); DEBUG_FUNCTION_LINE("memset %s section. Location: %08X size: %08X", psec->get_name().c_str(), destination, sectionSize);
memset(reinterpret_cast<void *>(destination), 0, sectionSize); memset(reinterpret_cast<void *>(destination), 0, sectionSize);
} }