arm-elf:thumb and exception
Richard Earnshaw
rearnsha@arm.com
Fri Dec 19 10:34:00 GMT 2003
> Hello.
>
> I have a question. Does Arm's thumb instruction set support the
> exception of C++?
> The follwing sample code does not run correctly.
>
> The program counter does not reach to the tail of the main(), even on
> the simulator of the gdb.
> When all of the modules of the sample are compiled as arm instruction
> set, The sample runs OK.
Does the application work if you build all the code in Thumb? You
currently have a mix of ARM and Thumb code.
My suspicion is that you aren't picking up the interworking libraries
correctly. To get these you normally have to edit a source file in the
compiler to allow these to be built:
1) Unpack the gcc source tree.
2) Go to the gcc/config/arm subdirectory
3) Edit the file t-arm-elf
4) Uncomment the following 3 lines
MULTILIB_OPTIONS += mno-thumb-interwork/mthumb-interwork
MULTILIB_DIRNAMES += normal interwork
MULTILIB_EXCEPTIONS += *mapcs-26/*mthumb-interwork*
5) Rebuild and reinstall your compiler.
One final point. When you link your application, you must also use
-mthumb-interwork or gcc will pick the wrong libraries. You should also
use g++ for linking if your application has C++ code. Hence:
/work/linux/tool/Linux-i686/bin/arm-unknown-elf-g++ -mthumb-interwork -o
exp16bit
exp16bit.o expon32.o expon16.o misc.o
You can also choose between libraries containing ARM or Thumb code by
passing the option -mthumb when linking.
R.
------
Want more information? See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com
More information about the crossgcc
mailing list