Dynamic Linking

The Code Generation Tools (CGT) support dynamic linking. For details on dynamic linking, see the TMS320C6000 Assembly Language Tools User's Guide and https://processors.wiki.ti.com/index.php/C6000_Dynamic_Linking.

For more information about support for C6000 Linux ABI in the C6000 Code Generation Tools, see Section 15 of the C6000 Embedded Application Binary Interface Application Report (SPRAB89) . The Linux ABI is a set of conventions for addressing, dynamic linking, and program loading for C6000 Linux-based systems.

Table 3-31 and Table 3-32 provide a brief summary of the compiler and linker options that are related to support for the Dynamic Linking Model.

Table 3-31 Compiler Options For Dynamic Linking

Option Description
--dprel Specifies that all non-const data is addressed using DP-relative addressing. See Section 8.1.4.2.
--dsbt Generates addressing via Dynamic Segment Base Table.
--export_all_cpp_vtbl Exports C++ virtual tables by default.
--import_undef[=off|on] Specifies that all global symbol references that are not defined in a module are imported. Default is on.
--import_helper_functions Specifies that all compiler generated calls to run-time-support functions are treated as calls to imported functions.
--inline_plt[=off|on] Inlines the import function call stub. Default is on.
--linux Generates C6000 Linux ABI compliant code.
--pic Generates position independent code suitable for a dynamic shared object.
--visibility=={hidden|fhidden|
    default|protected}
Specifies a default visibility to be assumed for global symbols.
-wchar_t Generates 32-bit wchar_t type. By default the compiler generates 16-bit wchar_t.

Table 3-32 Linker Options For Dynamic Linking

Option Description
--dsbt_index=int Requests a specific Data Segment Base Table (DSBT) index to be associated with the current output file. If the DSBT model is being used, and you do not request a specific DSBT index for the output file, then a DSBT index is assigned to the module at load time.
--dsbt_size=int Specifies the size of the Data Segment Base Table (DSBT) for the current output file, in words. If the DSBT model is being used, this option can be used to override the default DSBT size (8 words).
--dynamic[=exe] Specifies that the result of a link will be a lightweight dynamic executable.
--dynamic=lib Specifies that the result of a link will be a dynamic library.
--export=symbol Specifies that symbol is exported by the ELF object that is generated for this link.
--fini=symbol Specifies the symbol name of the termination code for the output file currently being linked.
--import=symbol Specifies that symbol is imported by the ELF object that is generated for this link.
--init=symbol Specifies the symbol name of the initialization code for the output file currently being linked.
--rpath=dir Adds a directory to the beginning of the dynamic library search path.
--runpath=dir Adds a directory to the end of the dynamic library search path.
--shared Generates an ELF dynamic shared object (DSO)
--soname=string Specifies shared object name to be used to identify this ELF object to the any downstream ELF object consumers.
--sysv Generates SysV ELF dynamic object module.