We have an issue reported by our customer saying that the library generated by TI compiler on cortex-M3 is not EABI compliant and because of it once they use a non-TI compiler (gcc) for linking the library they find that the generated executable is not properly following ELF format. Because of this, ELF loader is not properly able to load the image on target processor.
Below is the statement from customer
We required hacking our loader. The relocation R_ARM_THM_JUMP24 needed a patch that hard-substitutes the target address (including odd thumb-mode address) into the relocated instruction rather than using regular relocation. This mode is used in the TI library files but appears not to be used by our compiler, so this patch was ‘safe’ for me to do
We have tried creating a smaller project to see the issue and we also observed that below generated executable if loaded in CCSV4 – the loaded image are inconsistent - sometimes there appear correct but some time incorrect.
Generated Executable is part of zip file @ sampleTest\app\simpleapp_command.out
TI cortex-M3 compiler version number: 4.9.3
codesourcery compiler version number: 4.5.2
Source and make file for library project: part of zip file @ sampleTest\lib
Source and build script for application project part of zip file @ sampleTest\app
Please look at the assembly code after loading in CCS for doMath function – it will have unexpected assembly. If you do reset of processor and then load, you will see mostly code being loaded as incorrect for this fucntion
Can you please help to conclude that whether it is an issue with TI tool chain (library) or codesourcery compiler (application) or loader?
Thanks,
With Regards,
Pramod