I see that in the latest version of objcopy (GNU objcopy (GNU Binutils) 18.104.22.16871006), I get an error saying "objcopy: architecture ARM unknown"This is working only with the version GNU objcopy (GNU Binutils) 2.21Can you please confirm what are the supported BFD architectures for the -B option in the latest objcopy version.
Working cmd:objcopy.exe -I binary -B ARM -O elf32-littlearm --set-section-flags .data=alloc,readonly,code example.bin example.o
On using the objcopy without -B option, the armlink says its not able to recognise the fileformat. Hence, the usage of -B option is needed.
That looks like you're using an x86 version of objcopy that was built without Arm support. Have you tried using the one provided by our GNU toolchain releases?
I downloaded from gnutoolchains.com/.../ for arm toolchain, and -B ARM is working fine now.GNU objcopy (GNU Tools for Arm Embedded Processors 9-2019-q4-major) 22.214.171.12491025
Thanks for the quick tip.
View all questions in Arm Compilers forum