linker : iterator for running non shared libs

This commit is contained in:
georgemoralis 2023-12-13 14:28:04 +02:00
parent 88b790d846
commit ab04333ebd
3 changed files with 8 additions and 2 deletions

View File

@ -659,8 +659,11 @@ void Linker::Execute() {
p.argc = 1; p.argc = 1;
p.argv[0] = "eboot.bin"; //hmm should be ok? p.argv[0] = "eboot.bin"; //hmm should be ok?
const auto& module = m_modules.at(0); for (auto& m : m_modules) {
run_main_entry(module.elf.GetElfEntry() + module.base_virtual_addr, &p, ProgramExitFunc); if (!m.elf.IsSharedLib()) {
run_main_entry(m.elf.GetElfEntry() + m.base_virtual_addr, &p, ProgramExitFunc);
}
}
} }
} // namespace Core } // namespace Core

View File

@ -434,4 +434,6 @@ void Elf::LoadSegment(u64 virtual_addr, u64 file_offset, u64 size) {
BREAKPOINT(); // Hmm we didn't return something... BREAKPOINT(); // Hmm we didn't return something...
} }
bool Elf::IsSharedLib() { return m_elf_header.e_type == ET_SCE_DYNAMIC; }
} // namespace Core::Loader } // namespace Core::Loader

View File

@ -490,6 +490,7 @@ class Elf {
std::string ElfPheaderFlagsStr(u32 flags); std::string ElfPheaderFlagsStr(u32 flags);
void LoadSegment(u64 virtual_addr, u64 file_offset, u64 size); void LoadSegment(u64 virtual_addr, u64 file_offset, u64 size);
bool IsSharedLib();
private: private:
void Reset(); void Reset();