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.

Get rid of rts libraries



Hi all,

I'm developing a SW for avionics under DO-178B certification using a F28335 and CCS 5.5.

Since the certification requires that every piece of code you use is certified I'm trying quite hard to avoid including any library (e.g. I could not avoid using the FLASH api library and so I and my team required the source codes of the library in order to test them, but it is an unpleasant job).

My problem now is that it seems I can't get rid of the RTS libraries, I mean, I can't find where I tell the linker to link them in, but nevertheless I find them in the .map file. For example:


 output                                  attributes/
section   page    origin      length       input sections
--------  ----  ----------  ----------   ----------------
.text 0 00318000 000027c9 00318000 00002553 <mycode> 0031a553 00000078 rts2800.lib : fs_add.obj (.text) 0031a5cb 0000005a : fs_mpy.obj (.text) 0031a625 0000004e <mycode> 0031a673 00000044 rts2800.lib : boot.obj (.text) 0031a6b7 00000025 : fs_toi.obj (.text) 0031a6dc 00000040 <mycode> 0031a71c 0000001d rts2800.lib : fs_tou.obj (.text) 0031a739 0000001a : i_tofs.obj (.text) 0031a753 00000017 : fs_cmp.obj (.text) 0031a76a 00000016 : exit.obj (.text) 0031a780 00000014 : args_main.obj (.text) 0031a794 00000013 : ul_tofs.obj (.text) 0031a7a7 00000010 : u_tofs.obj (.text) 0031a7b7 00000007 : _lock.obj (.text) 0031a7be 00000006 <mycode> 0031a7c4 00000005 rts2800.lib : fs_neg.obj (.text)

So, my questions are:
1) Is it possible to create a working binary without linking these libraries? How?
2) If they must be included, what is their purpose? which .obj are necessary and when are they executed? how can I test them?

Thanks for the support!

Filippo
  • I wrote the final part of my question in the code syntax highlighter, so I copy it here for clarity:

    "So, my questions are:
    1) Is it possible to create a working binary without linking these libraries? How?
    2) If they must be included, what is their purpose? which .obj are necessary and when are they executed? how can I test them?
    Thanks for the support!
    Filippo"
  • Most of these functions are integer to floating-point conversions, and floating-point arithmetic. I believe the F28335 has a 32-bit FPU, so I'm not sure why you're getting calls to the floating-point add and multiply instructions. Make sure the device you are using has FPU32, and then use the --float_support=fpu32 option. If I'm wrong about F28335, then the only way to get rid of these functions is to eliminate floating-point math from your application.

    The linker only pulls in RTS functions that are needed, so there is some function in your program which calls these functions directly or indirectly.

    As for boot.obj, args_main.obj, and exit.obj, these are the default functions for startup and shutdown for your program. If you want to get rid of them, you will need to write your own version of the functions _c_int00 and exit
  • Hello Flilippo,

    Try setting Runtime Support Library to none as shown below.

    Stephen

  • Hi and thank you both for the support

    I tried following both your pieces of advice as you can see in the following figures:

    Now in my map file I find some obj from rts2800_fpu32.lib, in particular args_main.obj, boot.obj, exit.obj and _lock.obj.

    So how should I get rid of the _lock.obj?

    For the rest I guess I'll have to figure out which one is better: rewriting the _c_int00 and exit or try to qualify the objects I'm linkin... Or do you see an alternative?

    Thanks again,

    Filippo

  • You must have startup code, so there isn't much choice here.
  • Here is another approach to consider ...

    The source code to the RTS library is included with the compiler.  It is located in a directory similar to ...

    C:\ti\ccsv6\tools\compiler\ti-cgt-c2000_6.4.6\lib\src

    The general idea is copy the few source files needed from the RTS into your project.  Get the project to build and run as before.  No RTS will be needed.  Then you can comb through those files and remove the parts you don't need.  If this is less work then verifying the RTS library, then you come out ahead.

    The files you will need are: boot.asm, boot28.inc, args_main.c, exit.c, _lock.c .  I don't think I missed anything, but I might have.

    Thanks and regards,

    -George

  • Thank you very much for the support guys!