Page 1 of 1

dynamic loading without dlopen?

Posted: Thu Mar 07, 2019 2:59 pm
by badda
I would like to dynamically load executable code at runtime but I understand there is no dlopen() in devkitARM. Is there another way to do this? I've seen this done for example in NTR CFW, which has a plugin system that loads plugin-files dynamically depending on the current title... though I cannot figure out how NTR actually does that ...

Re: dynamic loading without dlopen?

Posted: Sat Mar 09, 2019 1:51 am
by WinterMute
The short answer to this is you don't and you shouldn't dynamically load executable code at runtime in this environment. Everything is statically compiled so there's no easy way to make it work and you just end up with brittle code that tends to fail when the tools are updated.

A plugin architecture is much easier to maintain and use if it's based on an interpreted scripting language rather than attempting to load compiled code at runtime. It kind of depends on what you want to do but you should bear in mind that despite our efforts to make a lot of linux based code compile OOB with devkitARM/libctru we're not running on a full blown OS and some things really won't work that well in this environment.