This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: arm-elf:thumb and exception


> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]