We are planning on running SYS/BIOS images across core 1-7, with Linux on core 0, on the C6678 and we would like to dynamically allocate cores for different SYS/BIOS SW images without having to recompile the images specifically for each core.
This means that the images need to support relocation, and thus be compiled with Position Independent Code generation and linked as a dynamic executable. Also, the Linux multicore loader needs to support dynamic ELF files/relocation (which it does not seem to do in the current version, but this can be fixed).
Is this supported/how can building with support for relocation be done in the SYS/BIOS RTSC build system?
Also, I guess all other RTSC package libraries that are included in the SW would need to be recompiled with the correct compiler options, which also might be a problem here, as not all packages are (unfortunately) rebuildable using XDC?
I have performed initial tests trying to build a sysbios package with the "--pic" flag set using the following config code:
var BIOS = xdc.useModule('ti.sysbios.BIOS');
BIOS.libType = BIOS.LibType_Custom;
BIOS.customCCOpts += " --pic";
My "main" file is also compiled with the "--pic" flag.
When linking the executable, I use the "--dynamic=exe" linker flag. The linker then outputs the following error message:
fatal error: object files have incompatible DSBT addressing
(<my_sysbios_config>_pe66.oe66" = "DSBT addressing not used", "<my_main>.cpp.obj" = "DSBT addressing used")
As I modify the linker.cmd file, I find that this error message actually applies to all the RTSC provided libraries, confirming what I indicated above about needing to rebuild all involved packages with the "--pic" flag.
I am using the following tools and packages:
compiler:c6000_7.3.4
xdctools_3_23_03_53
bios_6_33_05_46
Have anyone done something similar before, is it something that will be supported in the future, or should we put down our plans about doing relocation of SYS/BIOS images?
Thanks in advance!
See these articles for reference:
http://processors.wiki.ti.com/index.php/C6000_Dynamic_Linking#Lightweight_.28Bare_Metal.29_Dynamic_Linking_Model
http://processors.wiki.ti.com/index.php/C6000_Dynamic_Loader
Regards,
Oyvind