[rpcsx-os/linker] Fix ehframe setup

This commit is contained in:
DH 2023-06-29 13:30:24 +03:00
parent f6b73f6f29
commit 4ee7d2d54a
2 changed files with 5 additions and 5 deletions

View file

@ -403,8 +403,8 @@ Ref<orbis::Module> rx::linker::loadModule(std::span<std::byte> image, orbis::Pro
}
if (gnuEhFramePhdrIndex >= 0 && phdrs[gnuEhFramePhdrIndex].p_vaddr > 0) {
result->ehFrame = imageBase + phdrs[gnuEhFramePhdrIndex].p_vaddr;
result->ehFrameSize = phdrs[gnuEhFramePhdrIndex].p_memsz;
result->ehFrameHdr = imageBase + phdrs[gnuEhFramePhdrIndex].p_vaddr;
result->ehFrameHdrSize = phdrs[gnuEhFramePhdrIndex].p_memsz;
struct GnuExceptionInfo {
uint8_t version;
@ -458,8 +458,8 @@ Ref<orbis::Module> rx::linker::loadModule(std::span<std::byte> image, orbis::Pro
dataBufferIt += size;
}
result->ehFrameHdr = imageBase + phdrs[gnuEhFramePhdrIndex].p_vaddr + (dataBuffer - image.data() - phdrs[gnuEhFramePhdrIndex].p_offset);
result->ehFrameHdrSize = dataBufferIt - dataBuffer;
result->ehFrame = imageBase + phdrs[gnuEhFramePhdrIndex].p_vaddr + (dataBuffer - image.data() - phdrs[gnuEhFramePhdrIndex].p_offset);
result->ehFrameSize = dataBufferIt - dataBuffer;
}
for (auto &phdr : phdrs) {

View file

@ -512,7 +512,7 @@ SysResult processNeeded(Thread *thread) {
SysResult registerEhFrames(Thread *thread) {
for (auto [id, module] : thread->tproc->modulesMap) {
__register_frame(module->ehFrameHdr);
__register_frame(module->ehFrame);
}
return {};