I am writing a boot script for an ARM-Cortex M3 based device. If I compile the assembler loading the script and the application code C, and then combine the object files and transfer them to my device, everything will work.
However, if I use ar to create the archive (libboot.a) and combine this archive with the C application, the problem arises:
I installed the download code in the section:
.section .boot, "ax" .global _start _start: .word 0x10000800 .word start .word nmi_handler .word hard_fault_handler ... etc ...
I found that ld removes this from the final binary (the download section is not available). This is quite natural, since there is no dependence on it that ld knows about, but this leads to improper device boot.
So my question is: what is the best way to include this code?
arm gas linker embedded ld
Jonatan
source share