SPRU513Y August 2001 – June 2022 SM320F28335-EP
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 rts2800_ml.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 rts2800_ml.lib for the member that defines symtab and to link in the member.
cl2000 --run_linker --undef_sym=symtab file1.c.obj file2.c.obj rts2800_ml.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.