Referencing Far Global Objects Defined In Other Files - Texas Instruments TMS320C6000 Programmer's Manual

Hide thumbs Also See for TMS320C6000:
Table of Contents

Advertisement

How to Use Linker Error Messages
Example 4–1. Referencing Far Global Objects Defined in Other Files
<file1.c>
/* Define ary to be a global variable not accessible via the data page */
/* pointer.
far int ary;...
<file2.c>
/* In order for the code in file2.c to access ary correctly, it must be */
/* defined as 'extern far'.
/* defined in some other file.
/* accessible via the data page pointer.
/* missing, then the compiler will incorrectly assume that ary is in
/* .bss and can be accessed via the data page pointer.
extern far in ary;
...
= ary;
...
4.1.1.3 The MVKL Mnemonic
4-4
'extern' informs the compiler that ary is
'far' informs the compiler that ary is
If the MVK instruction is just a simple load of an address:
123 000000a4 0200002A!
Then the linker warning message is telling you that sym is greater than 32767,
and you will end up with something other than the value of sym in B4. In most
cases, this instruction is accompanied by:
124 000000a8 0200006A!
When this is the case, the solution is to change the MVK to MVKL.
On any other MVK problem, it usually helps to look up the value of the sym-
bol(s) involved in the linker map file.
If the 'far' keyword is
MVK
MVKH
*/
*/
*/
*/
*/
*/
sym,B4
sym,B4

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents