/Gt - Use Common Global Data Area

This option enables global pointer (gp) relative addressing for efficiently accessing global variables.

/Gt number

The number field accepts an integer and specifies the maximum size of data items to consider. A value of four or greater will allow global signed or unsigned 4 byte integers to be placed in a special .sdata section and be accessed as an offset from a pointer to the beginning of the section.

The drawback of gp-relative addressing on SHx microprocessors is that you can access a maximum of 64 global pointers in this manner. If more than 64 global pointers are present in an EXE or DLL that uses this option, it will result in linker error 2004. When this occurs, the module will need to be recompiled without the /Gt option.

See Also

About Microprocessor Compilers | ARM Guide | Hitachi Guide | MIPS Guide

 Last updated on Thursday, April 08, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.