C/C++ Programmer's Guide (G06.27+, H06.08+, J06.03+)

Example
Assume the header file defh contains:
struct worddef {
#ifdef MACHINE_WORDLEN_32
int intvar1;
int intvar2;
#else
long intvar;
#endif };
Further, assume that module1c includes the header file defh and that the structure worddef
contains members intvar1 and intvar2. Also assume that module2c includes the header file
defh and contains a single member intvar. If the LARGESYM pragma is not used, the compiler
creates a single data block that contains only one of the declarations for the structure worddef.
When you try to display a variable of type worddef in the Inspect debugger, the debugger might
display the wrong information.
LD(arg)
The LD pragma specifies arguments to be passed to the ld utility, the TNS/R linker for PIC
(Position-Independent Code).
LD(arg)
arg is any argument accepted by the ld utility.
For more details on valid syntax and semantics, see the ld Manual.
The pragma default settings are:
SYSTYPE OSSSYSTYPE GUARDIAN
N.A.N.A.TNS C compiler
N.A.N.A.G-series TNS c89 utility
Not setNot setTNS/R native C and C++ compilers
Not setNot setNative c89 utility
N.A.N.A.c99 utility
N.A.N.A.TNS/E native C and C++ compilers
Usage Guidelines
On Guardian environment, the LD pragma must be entered on the compiler RUN command
line for TNS/R native C/C++. On OSS environment, specify the LD pragma by using the
-Wld=arg option with the c89 utility.
If you are linking non-PIC files, you must use the NLD(arg) pragma, which specifies arguments
to the TNS/R native non-PIC linker, the nld utility.
The LD pragma does not actually invoke the ld linker. To invoke ld, you must include other
pragmas such as RUNNABLE, SHARED or LINKFILE. If ld is not invoked, this pragma is
ignored.
When you specify the LD pragma, you cannot also specify NLD(arg) or NON_SHARED.
This TNS/R native C command example shows the LD pragma. Note that if you specify
SHARED, you would not need to also include RUNNABLE:
nmc /in prog1/ prog1o;ld(-set highpin off -set highrequester
off),call_shared, runnable
212 Compiler Pragmas