PDC produces pdx with broken binary for any example in C_API/Examples/. It can not be run on my hardware - getting error "CAPI Handler function not found..." for each example.
PDC in SDK 1.13.7 work OK, produces normal binaries that works fine on the device.
We know OS 1.x won't launch 2.0 builds, but it should say "Updated Needed" (indicating a correct 2.0 build that 1.x knows not to launch) rather than "CAPI Handler function not found" which indicates an incorrect build.
Hm, I'm not having any luck reproducing that here. Can you check the pdxversion field in the pdxinfo file inside the .pdx game folder. (Whew, that's a lot of pdxes..) It should be 20000 indicating that it was compiled by a 2.0 SDK. That tells the launcher that it can't run the game on a 1.x OS. If the game was somehow build and packaged by (say) the 1.13.x version of pdc, then that field will be 11300 and the launch will think it can run it even though the pdex.bin file is incompatible.
Anyway, how I can test validity of my elf to ensure that it will loaded normally with new loader with relocations?
Also, what relocation model is preferred? PIC or ROPI-RWPI? (llvm reloc-models for example)
You shouldn't need to change compilation options, no need for -fPIC or such. We decided not to use the elf relocation format after all, didn't want to force you to include symbolic information in your game that you might not want to have public. pdc adds a relocation table in a custom format, and the loader is much simpler.
If pdc is now using a custom relocation format, does that mean there's no longer going to be a pdex.elf file, per this page? So the necessary recompilation will update the pdxversion and a relocation table inside the pdc-created binary, but no other changes? That seems simpler, and nice. I'm curious because we're having trouble getting 2.0 to work with Rust, and it seems like we shouldn't need any changes on our side if that's true; @fzzr is our expert, but has been stuck on this issue.
Oh! I didn't realize the build system had changed, but of course it did--we have to use the relocation table from the elf file to generate our own stripped down version. (My first hacky version of this just compiled it twice with two different target addresses then diffed them to see where it needed to fix up. Using the elf is much cleaner. ) So that page is correct. On 1.0 our build script compiled an elf file then generated Source/pdex.bin via objcopy, and pdc would copy that to the output folder. On 2.0 pdc does the elf->bin conversion, so the elf file has to be copied to the Source folder first.