SLAU131V October 2004 – February 2020
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 rts430.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 rts430.lib for the member that defines symtab and to link in the member.
cl430 --run_linker --undef_sym=symtab file1.c.obj file2.c.obj rts430.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.