Late binding of module imports - module import flags

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
mrbrown
Site Admin
Posts: 1537
Joined: Sat Jan 17, 2004 11:24 am

Late binding of module imports - module import flags

Post by mrbrown »

Came across something interesting and don't know if anyone else has noticed this:

I was trying to see if the sceNet library was already loaded when my app is loaded from the memory stick. I used the STUB_START macro from nem's hello world source to create a dummy sceNet import and imported sceNetTerm.

When I went to run the app, it loaded, then kicked me back out to the XMB with the "The game could not be started" message, with 80000001 as the error code. I then took another look at Wipeout, and noticed it was using 0x90000 as it's module import flags for sceNet, where nem's macro uses 0x40010000. I changed it to 0x90000, and lo and behold my test app loaded and ran to completion.

So the 0x90000 flag tells the program loader to delay the binding of module imports until the module is physically loaded and started.

Another bit that's interesting is that instead of the "syscall 0x20xx" that you normally see resolved for stubs, the function I called from sceNet had "syscall 0x15" resolved. If I call this function directly nothing happens. The "syscall 0x15" must be a placeholder until the real pspnet.prx is loaded.
Post Reply