mirror of
https://github.com/wiiu-env/wut.git
synced 2025-02-02 22:52:34 +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;
|
||||
|
||||
// All symbols pointing to this section require fixing
|
||||
|
||||
if (auto section = getSectionByName(file, ".fexports")) {
|
||||
for (auto §ion : file.sections) {
|
||||
if (section->header.type == elf::SHT_RPL_EXPORTS) {
|
||||
relocateSection(file, *section,
|
||||
align_up(addr, section->header.addralign));
|
||||
addr += section->data.size();
|
||||
}
|
||||
|
||||
if (auto section = getSectionByName(file, ".dexports")) {
|
||||
relocateSection(file, *section,
|
||||
align_up(addr, section->header.addralign));
|
||||
addr += section->data.size();
|
||||
}
|
||||
|
||||
if (auto section = getSectionByName(file, ".symtab")) {
|
||||
for (auto §ion : file.sections) {
|
||||
if (section->header.type == elf::SHT_SYMTAB ||
|
||||
section->header.type == elf::SHT_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, ".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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user