Fix RELRO load-segment congruence #3
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-blackbearreloaded/ps5-native-app-boilerplate!3
Loading…
Reference in a new issue
No description provided.
Delete branch "mpereiraesaa/fix/relro-load-congruence"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
.data.rel.roinstead of.gotp_offset % p_align == p_vaddr % p_alignfor generated load segmentsWhy
Additional relocations can place
.gotafter the beginning of.data.rel.ro. Using the.gotfile offset together with the.data.rel.rovirtual address produces an incongruent RELRO mapping for the PS5 loader's 16 KiB alignment requirement, causing the native title to fail beforemain().Validation
python3 -m unittest discover -s tests -p "test_*.py"main()and completed cleanlyNo proprietary SDK files, dumps, binaries, NIDs, or firmware-derived material are included.
Update: second commit
The first commit anchored RELRO at
.data.rel.rounconditionally. That breaks the Hello World template itself: it has no relocated read-only data, lld drops the empty.data.rel.rooutput section, and the converter aborted withlacks required section .data.rel.ro. The second commit anchors RELRO at the first RELRO section (.data.rel.rowhen lld keeps it, otherwise the GOT), keeps the 16 KiB load-congruence check, and addstests/test_executable_writer.py, which links both shapes with the host Clang/lld and converts them.make ffpfscon the template passes again with this branch.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.