Build problems; Please help

Nick Clifton nickc@cygnus.com
Wed Jul 26 16:26:00 GMT 2000


Hi Jagat,

: Since the gcc does produce thumb code for -mthumb option AND the
: assembler 'gas' does not recognize the thumb code except being told 
: explicitely (through -mthumb option), I would think that there is a
: problem with the assembler was built and *not with the gcc*. Don't
: you think so ?

No.  The assembler is capable of recognising both ARM and Thumb
instructions, it just needs to be told which instructions it should be
recognising.  It defaults to recognising ARM instructions, so it only
really needs to be told when it is being given Thumb instructions.

There are two ways to tell the assembler that is being given Thumb
instructions - via a command line switch or via a pseudo op in the
assembly source code itself.  GAS supports both methods, but the
command line switch is less flexible, since it implies that the entire
source file only contains Thumb instructions, which would prohibit
mixing ARM and Thumb instructions in the same file.

Thus gcc prefers to use the pseudo op method.  What it should be doing
is placing a:

   .code 16

pseudo op at the start of the assembly code for every function that it
compiles.  This in turn should tell the assembler to expect Thumb
instructions and then everything should work.

It would appear that in your case that this ".code 16" directive is
not being emitted, and this is the real bug.  Can you check the
assembler output of gcc, so see what the function introduction looks
like ?

Cheers
	Nick


More information about the Gcc mailing list