Skip to content

Commit

Permalink
Merge pull request #497 from PSI-Rockin/poketto_monsutaa
Browse files Browse the repository at this point in the history
[CRO] Fix faulty data relocations
  • Loading branch information
wheremyfoodat authored Apr 22, 2024
2 parents 1af7664 + b797c92 commit 000dc09
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,4 @@ fb.bat
*.smdh

config.toml
CMakeSettings.json
2 changes: 1 addition & 1 deletion src/core/services/ldr_ro.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ class CRO {
const u32 segmentID = mem.read32(segmentTable.offset + 12 * segment + SegmentTable::ID);
switch (segmentID) {
case SegmentTable::SegmentID::DATA:
*oldDataVaddr = segmentOffset + dataVaddr; oldDataSegmentOffset = segmentOffset; segmentOffset = dataVaddr; break;
*oldDataVaddr = segmentOffset + croPointer; oldDataSegmentOffset = segmentOffset; segmentOffset = dataVaddr; break;
case SegmentTable::SegmentID::BSS: segmentOffset = bssVaddr; break;
case SegmentTable::SegmentID::TEXT:
case SegmentTable::SegmentID::RODATA:
Expand Down

0 comments on commit 000dc09

Please sign in to comment.