This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Relocatable SYS/BIOS SW images on C6678

Other Parts Discussed in Thread: SYSBIOS

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

  • Oyvind,

    I’ve asked others about this, and from what I’ve heard back so far, it seems that using position independent code with SYS/BIOS and XDC runtime is theoretically possible...  BUT we don’t know of anyone who has tried to do this.

    If you want to try this, yes, you’ll need to rebuild SYS/BIOS and the xdc.runtime using the –pic flag.  Currently the rtsc.eclipse.org website is having problems, but when this is resolved I’ll post a link to it that describes how to rebuild the xdc.runtime.  Also, to build your application’s configuration file (the <config>_pe66.c file) you’ll need to add “—pic” to the CCS Build->XDCtools->Advanced Options: Additional Compiler Options edit box.  Or, you can use the –compileOptions option for configuro.

    I hope this helps some…

    Scott

  • Thanks, Scott

    It confirms the hunch I had, I guess. I had not thought of the --compileOptions flag for configuro. I might retry my initial test with that one.

    A related question would then be, will all the TI provided libraries like PDK, NDK and so on eventually be converted to an RTSC/XDC based build system so that it is somewhat practical to rebuild them without having to use 10 different build systems?

    From what I have seen, many of these libraries only have RTSC wrappers that provides the "link" to some pre-built library files that are supplied. It would of course be convenient if those RTSC packages were true, rebuildable RTSC packages...

    As this seems to be beyond cutting edge technology, we will most likely try to manage without relocatable SYS/BIOS images for now, and possible come back to the problem when/if we are forced into doing it. Anyway, thank you for your help!

    Oyvind

  • Oyvind,

    OK, thanks.

    The link about rebuilding xdc.runtime is back up now: http://rtsc.eclipse.org/docs-tip/Working_with_xdc.runtime

    Also, some more feedback I received is that there will probably be some tweaks needed to a few assembly files to support PIC.

    Regarding conversion of the different build systems for the different libraries: I’m pretty sure there are no plans to do this.

    Regards,
    Scott