This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Build problems; Please help
- To: jbrahma at riverdelta dot com
- Subject: Re: Build problems; Please help
- From: Nick Clifton <nickc at cygnus dot com>
- Date: Wed, 26 Jul 2000 16:26:41 -0700
- CC: gcc at gcc dot gnu dot org
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