I'm doing some unusual linking in Scummvm to get dynamic plugins going. I borrowed the method from the Dreamcast Scummvm code, where this works fine. Essentially, I use a custom linker file to put all the shorts (.sbss, .sdata) in one area in my main executable, and then I ask ld to keep the relocation entries with the '-q' option, and to use the symbols from the main executable only. In ScummVM itself I relocate the things in memory.
Things were generally working fine in most games. However, looking into one of the games (Kyrandia), I found the following relocations:
Code: Select all
0000eb44 00000405 R_MIPS_HI16 000fcf60 .rodata
0000eb48 00000406 R_MIPS_LO16 000fcf60 .rodata
0000eb54 00106206 R_MIPS_LO16 08aecb54 _ZN4Kyra14KyraEngine_L
0000eb58 00223d06 R_MIPS_LO16 08aecb5c _ZN4Kyra14KyraEngine_L