mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-15 10:40:01 +01:00
Calculate the module info data/text/bss size.
This commit is contained in:
1 parent
1c7873e2f5
commit
4a94a30ba6
3 files changed
+34
-6
No files matched your search
@@ -966,10 +966,7 @@ Module *__KernelLoadELFFromPtr(const u8 *ptr, u32 loadAddress, std::string *erro
|
||||
module->textEnd = module->textStart + textSize;
|
||||
|
||||
module->nm.text_addr = module->textStart;
|
||||
// TODO: This value appears to be wrong. In one example, the PSP has a value > 0x1000 bigger.
|
||||
module->nm.text_size = textSize;
|
||||
// TODO: It seems like the data size excludes the text size, which kinda makes sense?
|
||||
module->nm.data_size -= textSize;
|
||||
module->nm.text_size = reader.GetTotalTextSize();
|
||||
|
||||
if (!module->isFake) {
|
||||
#if !defined(MOBILE_DEVICE)
|
||||
@@ -984,6 +981,14 @@ Module *__KernelLoadELFFromPtr(const u8 *ptr, u32 loadAddress, std::string *erro
|
||||
}
|
||||
}
|
||||
|
||||
SectionID bssSection = reader.GetSectionByName(".bss");
|
||||
if (bssSection != -1) {
|
||||
module->nm.bss_size = reader.GetSectionSize(bssSection);
|
||||
module->nm.data_size = reader.GetTotalDataSize() - module->nm.bss_size;
|
||||
} else {
|
||||
module->nm.data_size = reader.GetTotalDataSize();
|
||||
}
|
||||
|
||||
INFO_LOG(LOADER, "Module %s: %08x %08x %08x", modinfo->name, modinfo->gp, modinfo->libent, modinfo->libstub);
|
||||
|
||||
struct PspLibStubEntry {
|
||||
|
||||
Reference in new issue
Block a user