[Linker Issue] Incorrect Address Linking for Thumb Function

Hi,

The tool chain we are using is "arm-gnu-toolchain-13.2.rel1-mingw-w64-i686-arm-none-eabi".

We have defined our own printf function, located at address 0x63066d7d, and it works correctly in the main application.
However, we also built a separate library containing a function named function_a, which calls the external printf function.

After integrating the library into the main project and performing compilation and linking,
we observed that calling function_a results in a crash at the printf call.
Upon inspecting the assembly code, we found that the instruction used is blx 0x63066d7c, instead of the expected blx 0x63066d7d.
It appears that the linker is generating a call to the ARM address rather than the Thumb address for printf.
This seems to indicate that the Thumb bit was not properly set during linking.

Our compiler options for both the main application and the library are as follows:
-mfpu=neon-vfpv4 -mfloat-abi=hard -mcpu=cortex-a7 -mthumb -mno-unaligned-access

Could you please advise why the linker is referencing the ARM address instead of the Thumb address for printf?
Is there something misconfigured in our build process?


Samuel

0