arm binutils or gcc issue
Phil Blundell
philb@gnu.org
Thu Oct 1 18:57:00 GMT 2009
On Thu, 2009-10-01 at 12:45 -0500, Joel Sherrill wrote:
> Hi,
>
> As an experiment, I was trying to compile
> a simple hello world with -c with every
> ARM CPU model option documented in the GCC manual.
> Some give errors. Are these likely gcc or binutils
> issues?
I think these would be best classed as "user error", although perhaps
gcc should be doing more to warn you that you have selected an
incompatible set of options. Specifically:
> /users/joel/test-gcc/install-arm/bin/arm-eabi-gcc -c -mcpu=arm2 main.c
> /tmp/ccKAGvGJ.s: Assembler messages:
> /tmp/ccKAGvGJ.s:31: Error: selected processor does not support `bx lr'
Older CPUs (ARM2/3/7 families) don't support interworking which is
required by the EABI, and hence enabled by default if you are using an
eabi build of gcc. If you build with -mno-thumb-interwork, or select a
non-EABI configuration for gcc, it ought to work ok.
> /users/joel/test-gcc/install-arm/bin/arm-eabi-gcc -c -mcpu=cortex-m3 main.c
> main.c:1:0: error: target CPU does not support ARM mode
> /users/joel/test-gcc/install-arm/bin/arm-eabi-gcc -c -mcpu=cortex-m1 main.c
> main.c:1:0: error: target CPU does not support ARM mode
Those CPUs are Thumb-only and don't support ARM code at all. You need
to pass -mthumb, or use a gcc configuration that does this by default.
In any event, I think gas is behaving correctly in all the above cases.
p.
More information about the Binutils
mailing list