To accomplish exporting of symbols, there are two methods available:
For example, if you want to export exp_func from the dynamic executable, you can declare it in your source as follows:
__declspec(dllexport) int exp_func();
cl6x ... -z --dynamic=exe --export=exp_func ...
In general, to build a dynamic executable, you must specify --dynamic=exe or --dynamic on the linker command line or in a linker command file. Consider the build of the dl6x.6x file described in the Dynamic Loader wiki article at https://processors.wiki.ti.com/index.php/C6000_Dynamic_Loader as an example of how to build a dynamic executable or base image:
cl6x ... -z *.obj ... --dynamic --export=printf ...
In this example, the --dynamic option indicates that the result of the link is going to be a dynamic executable. The --export=printf indicates that the printf() run-time-support function is exported by the dynamic executable and, if imported by a dynamic library, can be called at run time by the functions defined in the dynamic library.