| |||
| Home > Interworking ARM and Thumb > C and C++ interworking and veneers > Basic rules for C and C++ interworking | |||
The following rules apply to interworking within an application:
You must use the --apcs
/interwork command-line option to compile any C or C++
modules that contain functions that might return to the other instruction
set.
You must use the --apcs /interwork command-line
option to compile any C or C++ modules that contain indirect or
virtual function calls that might be to functions in the other instruction
set.
Never make indirect calls, such as calls using function pointers, to non-interworking code from code in the other state.
If any input object contains Thumb code, the linker selects the Thumb runtime libraries. These are built for interworking.
If you specify one of your own libraries explicitly on the linker command line you must ensure that it is an appropriate interworking library.
If a C or C++ module contains functions marked with #pragma
arm or #pragma thumb, you must compile
the module with --apcs /interwork. This ensures
that the functions can be called successfully from the other (ARM
or Thumb) state.