mirror of
https://github.com/wiiu-env/wut.git
synced 2025-02-09 06:13:22 +01:00
elf2rpl: Change fixLoaderVirtualAddress to use section type instead of name.
This commit is contained in:
parent
a1072fc729
commit
11adfb8f07
@ -698,39 +698,22 @@ fixLoaderVirtualAddresses(ElfFile &file)
|
|||||||
{
|
{
|
||||||
auto addr = LoadBaseAddress;
|
auto addr = LoadBaseAddress;
|
||||||
|
|
||||||
// All symbols pointing to this section require fixing
|
for (auto §ion : file.sections) {
|
||||||
|
if (section->header.type == elf::SHT_RPL_EXPORTS) {
|
||||||
if (auto section = getSectionByName(file, ".fexports")) {
|
relocateSection(file, *section,
|
||||||
relocateSection(file, *section,
|
align_up(addr, section->header.addralign));
|
||||||
align_up(addr, section->header.addralign));
|
addr += section->data.size();
|
||||||
addr += section->data.size();
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (auto section = getSectionByName(file, ".dexports")) {
|
for (auto §ion : file.sections) {
|
||||||
relocateSection(file, *section,
|
if (section->header.type == elf::SHT_SYMTAB ||
|
||||||
align_up(addr, section->header.addralign));
|
section->header.type == elf::SHT_STRTAB) {
|
||||||
addr += section->data.size();
|
relocateSection(file, *section,
|
||||||
}
|
align_up(addr, section->header.addralign));
|
||||||
|
section->header.flags |= elf::SHF_ALLOC;
|
||||||
if (auto section = getSectionByName(file, ".symtab")) {
|
addr += section->data.size();
|
||||||
relocateSection(file, *section,
|
}
|
||||||
align_up(addr, section->header.addralign));
|
|
||||||
section->header.flags |= elf::SHF_ALLOC;
|
|
||||||
addr += section->data.size();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (auto section = getSectionByName(file, ".strtab")) {
|
|
||||||
relocateSection(file, *section,
|
|
||||||
align_up(addr, section->header.addralign));
|
|
||||||
section->header.flags |= elf::SHF_ALLOC;
|
|
||||||
addr += section->data.size();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (auto section = getSectionByName(file, ".shstrtab")) {
|
|
||||||
relocateSection(file, *section,
|
|
||||||
align_up(addr, section->header.addralign));
|
|
||||||
section->header.flags |= elf::SHF_ALLOC;
|
|
||||||
addr += section->data.size();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto §ion : file.sections) {
|
for (auto §ion : file.sections) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user