Closed fjtrujy closed 4 months ago
Wouldn't it be possible to run ctr0 or rename the module_start? I'd expect more prx files to run into this issue.
Wouldn't it be possible to run ctr0 or rename the module_start? I'd expect more prx files to run into this issue.
We shouldn’t suffer this issue that “often”. Usually when creating PRX there 2 approaches, either you create it without any additional change (as you do it when you want to debug in pspslinkusb
), or you generate super tiny PRXs that don’t use any additional custom library (as all the remaining PRXs we have inside of “psplinusb”).
However, with this PRX we aren’t doing none of them, and this is actually dangerous as we may face unexpected issues, it uses newlib functions (this is why termínate
is being used) without the proper libcglue init steps, it works just by chance.
Said that I still think that we should keep _exit where it is, you as a user will face this “strange” compilation issue as a kind of warning, saying something strange is going on… Additionally, to move it to a different place will force you to have it in one the standards files/libs. Previously it was part of “libcglue” which IMO is also wrong
Description
This PR is required after improving
exit
flow inpspsdk
https://github.com/pspdev/pspsdk/pull/222The reason why now is this required is because
_exit
definition has been moved tocrt0
andcrt0_prx
files. In theory, this is totally right, however, thebootstrap
module being used here, is quite messy. When generating aprx
if you define the functionmodule_start
the wholectr0_prx
will be skipped, then the boostrap module uses some functions fromnewlib
, and these functions from newlib ends needing_exit
, which wasn't included becausecrt0_prx
was skipped.I'm not sure if we should move
_end
out of thecrt0
andcrt0_prx
, I don't think so, however, I'm pretty sure that the issue we are suffering is an edge case, so I think we shouldn't worry that much for now...Cheers.