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.

How do I manually link in __aeabi_uidivmod?

Other Parts Discussed in Thread: AM3359

I'm currently writing a "bare-metal" application using CCSv5 and TI's cl470 compiler for the AM3359 Sitara processor.  I doing my own runtime initialization, and thus not calling _c_int00 on boot.  I'm now trying to use the unsigned integer modulus operator (%) in my code, and the linker can't find the symbol __aeabi_uidivmod.  I'm guessing that this symbol is generally a part of the c-runtime library that normally is automatically linked in, and the Compiler Manual (SPNU151) mentions that these symbols are in source files rtsc.src, rtscpp.src, which I can't seem to find.

Here is my link command

"/opt/ti/ccsv5/tools/compiler/tms470/bin/cl470" -mv7A8 -g --gcc --define=am3359 --diag_warning=225 --display_error_number -me --abi=eabi --code_state=32 -z -m"uart_test.map" --stack_size=0 --heap_size=0 --warn_sections -i"/opt/ti/ccsv5/tools/compiler/tms470/lib" -i"/opt/ti/ccsv5/tools/compiler/tms470/include" --reread_libs -o "uart_test.out"  "./bsp/arch/sitara/src/sitara-uart.obj" "./bsp/arch/sitara/src/sitara-exceptions.obj" "./bsp/arch/sitara/src/sitara-debug.obj" "./start.obj" "./main.obj" "./exceptions.obj" "../sitara_lnk.cmd"

The TI Assembler/Linker manual (SPNU118) mentions a boot.obj file, which might also contain these symbols, yet I can't seem to find this file either.

Any suggestions as to how to link the __aeabi_uidivmod into my application would be greatly appreciated.

  • Vijay Pradeep said:
    I'm guessing that this symbol is generally a part of the c-runtime library that normally is automatically linked in, and the Compiler Manual (SPNU151) mentions that these symbols are in source files rtsc.src, rtscpp.src, which I can't seem to find.

    Yes, that symbol should be resolved by linking in the C runtime library included with the compiler tools. If you are building in CCS, the runtime library should be automatically pulled in during the link. It will be seen on the command line as -l libc.a. 

    But I don't see it in your command line. Are you building via command line outside of CCS? If so, you can add "-l libc.a" manually to your command line.

  • Just call __aeabi_uidivmod like any other function.  Then add "-l libc.a" to the end of your link command.  That tells the linker to automatically choose the best compiler RTS library.  That library is searched and the module which defines the function __aeabi_uidivmod is added to your build.

    Thanks and regards,

    -George