Content originally posted in LPCWare by MarcVonWindscooting on Sat Sep 28 06:02:56 MST 2013
Hi,
I ran into big trouble. I installed GCC 4.8.1 yesterday.
When building a program that uses an integer divide operation, I end up with gcc linking in some code that contains ARM (32-bit) instructions.
These instructions crash the M0 of course, because that cannot be switched into ARM mode.
What command-line switch did I miss?
I link using gcc, not ld. I have to link using -lgcc because I supply -nostartfiles and -nostdlibs.
The ARM code comes out of thumb/libgcc.a
I does a mode switch by bx to an ARM integer divide function |(
The switches
-mthumb
-mcpu=cortex-m0plus
don't make a difference. Maybe they only apply to compiling, not to linking.