3

I'm creating an application specifically for the Nintendo Wii using devKitPro. I wanted to make my application modular by offering the ability to load code passed though objcopy -O binary. My problem is, I want the modules to be able to use symbols from the main ELF that is loaded into memory. I have tried various things and I have not come up with any solutions.

  • I tried use -Map, as I thought that would let me use a linker map with it, but that idea failed.

  • I also tried compilation into a shared library, but that did not work for me, as the linker complained about "read-only segments with dynamic relocations".

I really need help with this, as I am in neither a Windows or Linux environment.

Flexo
  • 87,323
  • 22
  • 191
  • 272
  • The 'nm' utility on *nix can be used to list the symbols in an ELF file (along with their type). – Mahonri Moriancumer May 03 '14 at 02:55
  • Perhaps you should post the answer to this question? – Mahonri Moriancumer May 03 '14 at 04:39
  • As Mahonri said, you should post the answer to your question, preferably with a sample. It's not a bother for other people at all, there aren't a whole lot of questions about the Wii and maybe this could be useful to someone else trying to do the same thing as you. – zneak May 03 '14 at 05:07
  • Post your complete solutions an answer please - we'd love for you to share what you learned as an answer for others. – Flexo May 03 '14 at 08:45

1 Answers1

0

You may consider doing this using libdl which is made precisely to load symbols by name at runtime. Using libdl you can get handles to all of the functions you want to call as part of an initialization subroutine and then have them available to you when your program needs them. best of all, you dont need to have the library you are linking against at compile time so you can replace it with any elf that has those symbols defined without recompiling.