fix(relinker): prevent crash by returning 0 after --to-intel conversion #6

Closed
aashath0317 wants to merge 1 commit from upstream-pr/6 into main
aashath0317 commented 2026-09-26 06:33:22 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by aashath0317 on 2026-09-26T06:33:22Z.


No description provided.

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4645470595 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6). Originally posted by [aashath0317](https://github.com/aashath0317) on 2026-09-26T06:33:22Z. --- _No description provided._
boykopovar commented 2026-09-26 07:41:42 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by boykopovar on 2026-09-26T07:41:42Z.


In the case of -=to-intel flag, we should perform instruction substitution and then proceed to the main relinker pipeline.

auto codeSegments = elfReader.ReadCodeSegments();
auto result = converter->Convert(std::move(sourceBytes), codeSegments);
sourceBytes = std::move(result.Bytes);

The behavior in the current main branch for this flag is indeed incorrect.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:5844338984 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6#issuecomment-5844338984). Originally posted by [boykopovar](https://github.com/boykopovar) on 2026-09-26T07:41:42Z. --- In the case of `-=to-intel` flag, we should perform instruction substitution and then proceed to the main relinker pipeline. ```c++ auto codeSegments = elfReader.ReadCodeSegments(); auto result = converter->Convert(std::move(sourceBytes), codeSegments); sourceBytes = std::move(result.Bytes); ``` The behavior in the current main branch for this flag is indeed incorrect.
boykopovar commented 2026-09-26 09:51:41 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by boykopovar on 2026-09-26T09:51:41Z.


I've now added the lines I mentioned (without return 0) in the previous message. Thank you for noticing this, this correction is important for #5

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:5845232829 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6#issuecomment-5845232829). Originally posted by [boykopovar](https://github.com/boykopovar) on 2026-09-26T09:51:41Z. --- I've now added the lines I mentioned (without `return 0`) in the previous message. Thank you for noticing this, this correction is important for #5

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!6
No description provided.