SPRUI03E June 2015 – January 2023
The --undef_sym option introduces the linkname for an unresolved symbol into the linker's symbol table. This forces the linker to search a library and include the member that defines the symbol. The linker must encounter the --undef_sym option before it links in the member that defines the symbol. The syntax for the --undef_sym option is:
--undef_sym= symbol
For example, suppose a library named rts6600_elf.lib contains a member that defines the symbol symtab; none of the object files being linked reference symtab. However, suppose you plan to relink the output module and you want to include the library member that defines symtab in this link. Using the --undef_sym option as shown below forces the linker to search rts6600_elf.lib for the member that defines symtab and to link in the member.
cl6x --run_linker --undef_sym=symtab file1.c.obj file2.c.obj rts6600_elf.lib
If you do not use --undef_sym, this member is not included, because there is no explicit reference to it in file1.c.obj or file2.c.obj.