SPRUIG8J January 2018 – March 2024
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 rts7100_le.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 rts7100_le.lib for the member that defines symtab and to link in the member.
cl7x --run_linker --undef_sym=symtab file1.c.obj file2.c.obj rts7100_le.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.