SLAU131V October 2004 – February 2020
The memory address at which a program begins executing is called the entry point. When a loader loads a program into target memory, the program counter (PC) must be initialized to the entry point; the PC then points to the beginning of the program.
The linker can assign one of four values to the entry point. These values are listed below in the order in which the linker tries to use them. If you use one of the first three values, it must be an external symbol in the symbol table.
--entry_point=global_symbol
where global_symbol defines the entry point and must be defined as an external symbol of the input files. The external symbol name of C or C++ objects may be different than the name as declared in the source language; refer to the MSP430 Optimizing C/C++ Compiler User's Guide.
This example links file1.c.obj and file2.c.obj. The symbol begin is the entry point; begin must be defined as external in file1 or file2.
cl430 --run_linker --entry_point=begin file1.c.obj file2.c.obj
See Section 8.6.1 for information about referring to linker symbols in C/C++ code.