Load modules and resolve functions in crt0#7
Conversation
|
Hi and thanks! Because some of the concerns could help myself, could you clarify them a bit? Why do you want to reload modules?
Whats the primary rational of using loadModule over sceKernelLoadStartModule?
Concerning the ELF PIE: For poking the kernel it doesn't seem necessary, right now. For later I think its definitively the target. Either the official out off-process or our small in-process loader can handle it. It is implemented but not used (needed) right now. I like your loading approach, it is certainly an improvement over doing it manually. I did the same a while back, but instead of resolving all functions I use a lazy loading (trampoline) approach which just loads the functions as needed (https://github.com/ps4dev/libps4-boilerplate#resolution-process-and-overhead).
I like to thank you for your Makefile approach to Stub generation (!). I think I will apply the idea to my code. Kind regards and thanks again, |
I mean, an example for
Because it's very easy to implement if it loads all modules only with a function. That's all. I'll fix it right now.
If the kernel can resolve GOT, it's easy to add the feature later. |
Use sceKernelLoadStartModule for loading modules except libkernel.
|
24dfd9f allows to use sceKernelLoadStartModule. |
NOTE:
This is just a concept and I have not tested yet.
This breaks some compatibility.
You no longer have to write initializing functions at the beginning of
_main. The new crt0 resolves only functions we need. So it's easier to use and doesn't waste memory.This change also removes redundant code (+163, -465) in old resolving code and allow you to add functions with less code.
Please note that I have not tested because I don't have a PS4. I have some concerns:
I found a code to reload libScePad module in an example. I applied the trick to all codes to keep the code simple. I know the overhead is very small, but it may cause a problem.
loadModuleAll modules will be loaded with
loadModulealthough some of the current initializers usesceKernelLoadStartModule.This change is incompatible with position independent code. It's possible to support position independent code, but you have to resolve the GOT.