I'm trying to compile and link with -ropi against a sample project. If I initialize the board (LPCxpresso 54102) in the bootloader and jump to the relocatable code everything is fine, but trying to link the necessary startup items (Board_SystemInit which eventually calls the power_library) fails miserably. I really don't understand why.
Specifically I'm just trying to make the following work:
AREA HANDLER, CODE, READONLY
IMPORT SystemInit ; this fails for unknown reasons
IMPORT __main ; this works fine
...
main_entry DCD __main + 2 - .
sys_entry DCD SystemInit + 6 - .
The Link Errors I'm getting because of the IMPORT SystemInit line are:
.\Objects\pic.axf: Error: L6248E: power_library.o(i.__set_voltage) in PI region 'ER_IROM1' cannot have address type relocation to [Anonymous Symbol] in PI region 'ER_IROM1'.
.\Objects\pic.axf: Error: L6285E: Non-relocatable Load region LR_IROM1 contains R-Type dynamic relocations. First R-Type dynamic relocation found in power_library.o(i.__set_voltage) at offset 0x1230.
And since the power library is closed source, it's difficult to figure out what I need to do. This should be possible, I just need more insight. Thanks.