| |||
| Home > Interworking ARM and Thumb > About interworking | |||
You can mix ARM and Thumb code as you wish, provided that the code conforms to the requirements of the ARM/Thumb Procedure Call Standard. The ARM compilers always create code that conforms to this standard. If you are writing ARM assembly language modules you must ensure that your code conforms.
The ARM linker detects when an ARM function is being called from Thumb state, or a Thumb function is being called from ARM state. The ARM linker alters call and return instructions, or inserts small code sections called veneers, to change processor state as necessary.
ARM architecture v5T provides methods of changing processor state without using any extra instructions. There is normally no cost associated with interworking on ARM architecture v5T processors.
If you are linking several source files together, all your files must use compatible ATPCS options. If incompatible options are detected, the linker will produce an error message.