Hello,
I am having trouble overriding RTS functions when compiling under EABI using C674x MATHLIB_RTS version 3.1.0.0. At first I was trying to build the MATHLIB_RTS library myself, but eventually I used the pre-built library that comes in the installation with the same result (C:\ti\mathlib_rts_c674x_3_1_0_0\packages\ti\mathlib\lib\mathlib_rts.lib). Here are the steps to reproduce the problem:
1. Create a new CCS project (I'm using v6 with all the latest updates).
Target: C674x Floating-point DSP - TMS320C6742
Compiler version: TI v7.4.11
Output format: eabi (ELF)
Template: Empty Project (with main.c)
2. Use the following main.c:
#include <math.h>
int main(void)
{
double a = 1, b = 1, c, d;
c = atan2(a, b);
d = a / b;
return 0;
}
3. Build the project. The assembly output shows the following calls:
CALLP .S2 atan2,B3
CALLP .S2 __c6xabi_divd,B3
We have not linked the MATHLIB yet, so looking at the MAP file shows that ".text:atan2" and ".text:__c6xabi_divd" are coming from rts6740_elf.lib.
4. Now add MATHLIB_RTS to the TOP of the linker's "File Search Path" list of included library files. The list will then look like this:
"C:\ti\mathlib_rts_c674x_3_1_0_0\packages\ti\mathlib\lib\mathlib_rts.lib"
"libc.a"
5. Rebuild the project. The assembly output shows the same two calls as before.
- Looking at the map file shows that ".text:atan2" no longer exists, and the locations of the symbols "atan2" and "atan2dp" are the same. This means that "atan2" is properly being overridden by MATHLIB_RTS.
- However, the map file shows that ".text:__c6xabi_divd" still exists and is coming from rts6740_elf.lib. Furthermore, the locations of "__c6xabi_divd" and "divdp" are not the same. This means that "__c6xabi_divd" is not being overridden by MATHLIB_RTS.
Thank you in advance for your assistance!
Best regards,
Dave