You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When linking an application, it seems that unresolved references are silently ignored, resulting in an incomplete binary.
For example, look at the autofill demo in the official SDK. If you remove the libkmc link argument (i.e. delete -lkmc), the resulting objects link together via Spicy without complaint, but __osInitialize_common which contains a reference to the __udivdi3 function gets a zero instead of erroring out. From the resulting fill.out ELF:
80004ccc: 00862021 addu a0,a0,a2
80004cd0: 24060000 li a2,0
80004cd4: 0c000000 jal 80000000 <_zbufferSegmentBssSize+0x7ff8f800> !!!!!!!! 0 !!!!!!!
80004cd8: 24070004 li a3,4
80004cdc: 3c048000 lui a0,0x8000
compared to with -lkmc:
80004ccc: 00862021 addu a0,a0,a2
80004cd0: 24060000 li a2,0
80004cd4: 0c001b14 jal 80006c50 <__udivdi3>
80004cd8: 24070004 li a3,4
80004cdc: 3c048000 lui a0,0x8000
The original archive, libgultra_rom.a does contain the appropriate relocation information. The build process is:
I've verified that codesegment.o still contains the correct relocation information:
Disassembly: 4874: 0c000000 jal 0 <InitDisplayLists>
Relocation Info: 00004874 R_MIPS_26 __udivdi3
Which is expected, as it does link correctly when I give it the correct objects. Again, my problem is that there is no error or warning when the symbol is unresolved. This appears to be similar behavior to --unresolved-symbols=ignore-all, but a cursory look though Spicy didn't reveal that argument being passed to ld.
The text was updated successfully, but these errors were encountered:
The noinhibit-exec flag causes many errors to be ignored, including unresolved symbols and overlapping sections. It also appears the overlapping section flag had no effect as a result as they were always ignored. I can make a PR if this looks like good solution. Sometimes it's helpful to get a broken binary rather than nothing at all, but that can be a dangerous default.
When linking an application, it seems that unresolved references are silently ignored, resulting in an incomplete binary.
For example, look at the autofill demo in the official SDK. If you remove the libkmc link argument (i.e. delete
-lkmc
), the resulting objects link together via Spicy without complaint, but__osInitialize_common
which contains a reference to the__udivdi3
function gets a zero instead of erroring out. From the resulting fill.out ELF:compared to with
-lkmc
:The original archive,
libgultra_rom.a
does contain the appropriate relocation information. The build process is:I've verified that
codesegment.o
still contains the correct relocation information:Disassembly:
4874: 0c000000 jal 0 <InitDisplayLists>
Relocation Info:
00004874 R_MIPS_26 __udivdi3
Which is expected, as it does link correctly when I give it the correct objects. Again, my problem is that there is no error or warning when the symbol is unresolved. This appears to be similar behavior to
--unresolved-symbols=ignore-all
, but a cursory look though Spicy didn't reveal that argument being passed to ld.The text was updated successfully, but these errors were encountered: