ARM VERSION 1.2 Guide de l'utilisateur Page 28

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 133
  • Table des matières
  • DEPANNAGE
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 27
To compile and link these modules:
1. Type tcc -c -apcs /interwork -o thumbmain.o thumbmain.c at the system prompt to compile the
Thumb code for interworking.
2. Type armcc -c -apcs /interwork -o armsub.o armsub.c to compile the ARM code for interworking.
3. Type armlink -o hello armsub.o thumbmain.o to link the object files.
Alternatively, type armlink -info veneers armsub.o thumbmain.o to view the size of the interworking
veneers (Example 3-4).
Example 3-4
Adding veneers to the image
Adding AT veneer (12 bytes) for call to '_printf' from armsub.o(.text).
Adding TA veneer (12 bytes) for call to 'arm_function' from thumbmain.o(.text).
Adding AT veneer (12 bytes) for call to '__rt_lib_init' from kernel.o(x$codeseg).
Adding AT veneer (12 bytes) for call to '__rt_lib_shutdown' from kernel.o(x$codeseg).
Adding AT veneer (12 bytes) for call to '_sys_exit' from kernel.o(x$codeseg).
Adding AT veneer (12 bytes) for call to '__raise' from rt_raise.o(x$codeseg).
Adding AT veneer (12 bytes) for call to '_no_fp_display' from printf2.o(x$codeseg).
7 Veneer(s) (total 84 bytes) added to the image.
3.3.2 Basic rules for 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.
3.3.3 Using two copies of the same function
You can have two functions with the same name, one compiled for ARM and the other for Thumb. However, we do
not recommend this practice. In almost all cases there is no significant performance increase over having a single
version of the function.
Note
Both versions of the function must be compiled with the /interwork option as it is not guaranteed that the Thumb
version will only be called from Thumb state and the ARM version will only be called from ARM state.
The linker allows duplicate definitions provided that one definition defines a Thumb routine and the other defines an
ARM routine.
Interworking ARM and Thumb
Copyright ?1999 2001 ARM Limited 3-7
Vue de la page 27
1 2 ... 23 24 25 26 27 28 29 30 31 32 33 ... 132 133

Commentaires sur ces manuels

Pas de commentaire