 | L166 User's Guide |  |
|
|
| Compared with CTGROUPS at the L166 Linker level are similar to blocks at the C-source level. That is, TGROUPS provide a block structure for PUBLIC symbols, sections, and groups on the linker/locator level. For example: | C Program | L166 Linker Command Line |
|---|
func1 () {
int i;
for (i = 1; i < 100; i++);
}
main () {
int i;
for (i = 1; i < 100; i++) func ();
}
|
L166 { file1.obj }, { file2.obj }
| | In this C program, the variable i in func has a different location than the variable i in main. The scope of automatic variables is limited to the function containing the variable definition. | In this linker command line we assume that file1.obj and file2.obj each has a PUBLIC symbol named i. Specifying each module in a separate TGROUP isolates the PUBLIC symbols from each other. That is, the PUBLIC symbol i from file1.obj cannot be accessed from file2.obj and vice-versa. The scope of PUBLIC symbols, sections, and groups is limited to the TGROUP containing the definitions. |
|
|