We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
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.
printf
0x63066d7d
function_a
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.
blx 0x63066d7c
blx 0x63066d7d
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
-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