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.

Code Sourcery c6x-uclinux-gcc link issue

Expert 3585 points

Hello,

A customer face a blocking issue at link time using c6x-uclinux-gcc for building their application.

The way they work is similar to below:

1- They compile the source file that calls into the library to be partially linked in:

c6x-uclinux-gcc -fPIC -pipe -Wall -march=c674x -mlong-calls -msdata=none -fvisibility=hidden -Wextra -ffunction-sections -fdata-sections  -o static\filename.o -c \
filename.c

 2- They partially link some 3rd party libraries to the object file built in step #1 (the resulting object file is later used to link either the shared object or build the archive file in case they're building a static library):
c6x-uclinux-ld -r static/filename.o static/filename2.o libname.a -o static\filename3.o 

3- They remove the temporary object file created in step 1: rm -f -f static/filename.o

At link time, customer gets errors: "relocation truncated to fit" on many code locations.
Adding -mlong-calls compilation flag did not solve the problem.
Link options: c6x-uclinux-gcc -L"lib/tic674x-uclinux-gcc45" -march=c674x -mlong-calls -msdata=none -Wl,--gc-sections -Wl,-Map=mapfile datacode.o -Wl,-Bstatic -llib_static -Wl,-Bdynamic -ldl -lm -lpthread -o datacode

I am trying to obtain the code so as to reproduce the issue.
In the mean time, do you have suggestions / areas to clarify with the customer?

Thank you.