Problem with blx (immediate) on ARM M-class processor

Michael Edie
Wed Apr 1 19:10:14 GMT 2020

I have an issue where I am linking ARM R-class and M-class archives (partial linked) and declaring the final link cpu as M-class to gcc. But the final veneers for the M3 are coming out with BLX (immediate) instructions (not allowed by an M3).

I have -nostdlib as an option and removing that fixes my issue but I don't know why.

How does gcc pass on knowledge of the processor to the linker in order for it to know what assembler to use when constructing veneeers? Does it simply snoop the first file? My understanding is -nostdlib simply drops libgcc and libc and any start files. How would that change things? I beleive the stdlib directories remain.

I've been on this for a while and just can't get to the bottom of it. Any pointers appreciated.


More information about the Gcc-help mailing list