SPRUI03E June   2015  – January 2023

 

  1.   Read This First
    1.     About This Manual
    2.     How to Use This Manual
    3.     Notational Conventions
    4.     Related Documentation From Texas Instruments
    5.     Trademarks
  2. Introduction to the Software Development Tools
    1. 1.1 Software Development Tools Overview
    2. 1.2 Tools Descriptions
  3. Introduction to Object Modules
    1. 2.1 Object File Format Specifications
    2. 2.2 Executable Object Files
    3. 2.3 Introduction to Sections
      1. 2.3.1 Special Section Names
    4. 2.4 How the Assembler Handles Sections
      1. 2.4.1 Uninitialized Sections
      2. 2.4.2 Initialized Sections
      3. 2.4.3 User-Named Sections
      4. 2.4.4 Current Section
      5. 2.4.5 Section Program Counters
      6. 2.4.6 Subsections
      7. 2.4.7 Using Sections Directives
    5. 2.5 How the Linker Handles Sections
      1. 2.5.1 Combining Input Sections
      2. 2.5.2 Placing Sections
    6. 2.6 Symbols
      1. 2.6.1 Global (External) Symbols
      2. 2.6.2 Local Symbols
      3. 2.6.3 Weak Symbols
      4. 2.6.4 The Symbol Table
    7. 2.7 Symbolic Relocations
    8. 2.8 Loading a Program
  4. Program Loading and Running
    1. 3.1 Loading
      1. 3.1.1 Load and Run Addresses
      2. 3.1.2 Bootstrap Loading
        1. 3.1.2.1 Boot, Load, and Run Addresses
        2. 3.1.2.2 Primary Bootloader
    2. 3.2 Entry Point
    3. 3.3 Run-Time Initialization
      1. 3.3.1 The _c_int00 Function
      2. 3.3.2 RAM Model vs. ROM Model
        1. 3.3.2.1 Autoinitializing Variables at Run Time (--rom_model)
        2. 3.3.2.2 Initializing Variables at Load Time (--ram_model)
        3. 3.3.2.3 The --rom_model and --ram_model Linker Options
      3. 3.3.3 About Linker-Generated Copy Tables
        1. 3.3.3.1 BINIT
        2. 3.3.3.2 CINIT
    4. 3.4 Arguments to main
    5. 3.5 Run-Time Relocation
    6. 3.6 Additional Information
  5. Assembler Description
    1. 4.1  Assembler Overview
    2. 4.2  The Assembler's Role in the Software Development Flow
    3. 4.3  Invoking the Assembler
    4. 4.4  The Application Binary Interface
    5. 4.5  Naming Alternate Directories for Assembler Input
      1. 4.5.1 Using the --include_path Assembler Option
      2. 4.5.2 Using the C6X_A_DIR Environment Variable
    6. 4.6  Source Statement Format
      1. 4.6.1 Label Field
      2. 4.6.2 Mnemonic Field
      3. 4.6.3 Unit Specifier Field
      4. 4.6.4 Operand Field
      5. 4.6.5 Comment Field
    7. 4.7  Literal Constants
      1. 4.7.1 Integer Literals
        1. 4.7.1.1 Binary Integer Literals
        2. 4.7.1.2 Octal Integer Literals
        3. 4.7.1.3 Decimal Integer Literals
        4. 4.7.1.4 Hexadecimal Integer Literals
        5. 4.7.1.5 Character Literals
      2. 4.7.2 Character String Literals
      3. 4.7.3 Floating-Point Literals
    8. 4.8  Assembler Symbols
      1. 4.8.1  Identifiers
      2. 4.8.2  Labels
      3. 4.8.3  Local Labels
        1. 4.8.3.1 Local Labels of the Form $n
        2.       80
        3. 4.8.3.2 Local Labels of the Form name?
        4.       82
      4. 4.8.4  Symbolic Constants
      5. 4.8.5  Defining Symbolic Constants (--asm_define Option)
      6. 4.8.6  Predefined Symbolic Constants
      7. 4.8.7  Registers
      8. 4.8.8  Register Pairs
      9. 4.8.9  Register Quads (C6600 Only)
      10. 4.8.10 Substitution Symbols
    9. 4.9  Expressions
      1. 4.9.1 Mathematical and Logical Operators
      2. 4.9.2 Relational Operators and Conditional Expressions
      3. 4.9.3 Well-Defined Expressions
      4. 4.9.4 Legal Expressions
      5. 4.9.5 Expression Examples
    10. 4.10 Built-in Functions and Operators
      1. 4.10.1 Built-In Math and Trigonometric Functions
      2. 4.10.2 C6x Built-In ELF Relocation Generating Operators
        1. 4.10.2.1 $DPR_BYTE(sym) / $DPR_HWORD(sym) / $DPR_WORD(sym)
        2. 4.10.2.2 $LABEL_DIFF(x,y) Operator
    11. 4.11 Source Listings
    12. 4.12 Debugging Assembly Source
    13. 4.13 Cross-Reference Listings
  6. Assembler Directives
    1. 5.1  Directives Summary
    2. 5.2  Directives that Define Sections
    3. 5.3  Directives that Initialize Values
    4. 5.4  Directives that Perform Alignment and Reserve Space
    5. 5.5  Directives that Format the Output Listings
    6. 5.6  Directives that Reference Other Files
    7. 5.7  Directives that Enable Conditional Assembly
    8. 5.8  Directives that Define Union or Structure Types
    9. 5.9  Directives that Define Enumerated Types
    10. 5.10 Directives that Define Symbols at Assembly Time
    11. 5.11 Miscellaneous Directives
    12. 5.12 Directives Reference
      1.      .align
      2.      .asg/.define/.eval
      3.      .asmfunc/.endasmfunc
      4.      .bits
      5.      .bss
      6.      .byte/.ubyte/.char/.uchar
      7.      .cdecls
      8.      .common
      9.      .copy/.include
      10.      .cstruct/.cunion/.endstruct/.endunion/.tag
      11.      .data
      12.      .double
      13.      .drlist/.drnolist
      14.      .elfsym
      15.      .emsg/.mmsg/.wmsg
      16.      .end
      17.      .farcommon/.nearcommon
      18.      .fclist/.fcnolist
      19.      .field
      20.      .float
      21.      .global/.def/.ref
      22.      .group/.gmember/.endgroup
      23.      .half/.short/.uhalf/.ushort
      24.      .if/.elseif/.else/.endif
      25.      .int/.unint/.long/.ulong/.word/.uword
      26.      .label
      27.      .length/.width
      28.      .list/.nolist
      29.      .loop/.endloop/.break
      30.      .macro/.endm
      31.      .map/.clearmap
      32.      .mlib
      33.      .mlist/.mnolist
      34.      .newblock
      35.      .nocmp
      36.      .noremark/.remark
      37.      .option
      38.      .page
      39.      .retain / .retainrefs
      40.      .sect
      41.      .set/.equ
      42.      .space/.bes
      43.      .sslist/.ssnolist
      44.      .string/.cstring
      45.      .struct/.endstruct/.tag
      46.      .symdepend
      47.      .tab
      48.      .text
      49.      .title
      50.      .unasg/.undefine
      51.      .union/.endunion/.tag
      52.      .usect
      53.      .var
      54.      .weak
  7. Macro Language Description
    1. 6.1  Using Macros
    2. 6.2  Defining Macros
    3. 6.3  Macro Parameters/Substitution Symbols
      1. 6.3.1 Directives That Define Substitution Symbols
      2. 6.3.2 Built-In Substitution Symbol Functions
      3. 6.3.3 Recursive Substitution Symbols
      4. 6.3.4 Forced Substitution
      5. 6.3.5 Accessing Individual Characters of Subscripted Substitution Symbols
      6. 6.3.6 Substitution Symbols as Local Variables in Macros
    4. 6.4  Macro Libraries
    5. 6.5  Using Conditional Assembly in Macros
    6. 6.6  Using Labels in Macros
    7. 6.7  Producing Messages in Macros
    8. 6.8  Using Directives to Format the Output Listing
    9. 6.9  Using Recursive and Nested Macros
    10. 6.10 Macro Directives Summary
  8. Archiver Description
    1. 7.1 Archiver Overview
    2. 7.2 The Archiver's Role in the Software Development Flow
    3. 7.3 Invoking the Archiver
    4. 7.4 Archiver Examples
    5. 7.5 Library Information Archiver Description
      1. 7.5.1 Invoking the Library Information Archiver
      2. 7.5.2 Library Information Archiver Example
      3. 7.5.3 Listing the Contents of an Index Library
      4. 7.5.4 Requirements
  9. Linker Description
    1. 8.1  Linker Overview
    2. 8.2  The Linker's Role in the Software Development Flow
    3. 8.3  Invoking the Linker
    4. 8.4  Linker Options
      1. 8.4.1  Wildcards in File, Section, and Symbol Patterns
      2. 8.4.2  Specifying C/C++ Symbols with Linker Options
      3. 8.4.3  Relocation Capabilities (--absolute_exe and --relocatable Options)
        1. 8.4.3.1 Producing an Absolute Output Module (--absolute_exe option)
        2. 8.4.3.2 Producing a Relocatable Output Module (--relocatable option)
      4. 8.4.4  Allocate Memory for Use by the Loader to Pass Arguments (--arg_size Option)
      5. 8.4.5  Compression (--cinit_compression and --copy_compression Option)
      6. 8.4.6  Compress DWARF Information (--compress_dwarf Option)
      7. 8.4.7  Control Linker Diagnostics
      8. 8.4.8  Automatic Library Selection (--disable_auto_rts and --multithread Options)
      9. 8.4.9  Do Not Remove Unused Sections (--unused_section_elimination Option)
      10. 8.4.10 Linker Command File Preprocessing (--disable_pp, --define and --undefine Options)
      11. 8.4.11 Error Correcting Code Testing (--ecc Options)
      12. 8.4.12 Define an Entry Point (--entry_point Option)
      13. 8.4.13 Set Default Fill Value (--fill_value Option)
      14. 8.4.14 Define Heap Size (--heap_size Option)
      15. 8.4.15 Hiding Symbols
      16. 8.4.16 Alter the Library Search Algorithm (--library, --search_path, and C6X_C_DIR )
        1. 8.4.16.1 Name an Alternate Library Directory (--search_path Option)
        2. 8.4.16.2 Name an Alternate Library Directory (C6X_C_DIR Environment Variable)
        3. 8.4.16.3 Exhaustively Read and Search Libraries (--reread_libs and --priority Options)
      17. 8.4.17 Change Symbol Localization
        1. 8.4.17.1 Make All Global Symbols Static (--make_static Option)
      18. 8.4.18 Create a Map File (--map_file Option)
      19. 8.4.19 Managing Map File Contents (--mapfile_contents Option)
      20. 8.4.20 Disable Name Demangling (--no_demangle)
      21. 8.4.21 Merging of Symbolic Debugging Information
      22. 8.4.22 Strip Symbolic Information (--no_symtable Option)
      23. 8.4.23 Name an Output Module (--output_file Option)
      24. 8.4.24 Prioritizing Function Placement (--preferred_order Option)
      25. 8.4.25 C Language Options (--ram_model and --rom_model Options)
      26. 8.4.26 Retain Discarded Sections (--retain Option)
      27. 8.4.27 Scan All Libraries for Duplicate Symbol Definitions (--scan_libraries)
      28. 8.4.28 Define Stack Size (--stack_size Option)
      29. 8.4.29 Mapping of Symbols (--symbol_map Option)
      30. 8.4.30 Generate Far Call Trampolines (--trampolines Option)
        1. 8.4.30.1 Advantages and Disadvantages of Using Trampolines
        2. 8.4.30.2 Minimizing the Number of Trampolines Required (--minimize_trampolines Option)
        3. 8.4.30.3 Making Trampoline Reservations Adjacent (--trampoline_min_spacing Option)
        4. 8.4.30.4 Carrying Trampolines From Load Space to Run Space
      31. 8.4.31 Introduce an Unresolved Symbol (--undef_sym Option)
      32. 8.4.32 Display a Message When an Undefined Output Section Is Created (--warn_sections)
      33. 8.4.33 Generate XML Link Information File (--xml_link_info Option)
      34. 8.4.34 Zero Initialization (--zero_init Option)
    5. 8.5  Linker Command Files
      1. 8.5.1  Reserved Names in Linker Command Files
      2. 8.5.2  Constants in Linker Command Files
      3. 8.5.3  Accessing Files and Libraries from a Linker Command File
      4. 8.5.4  The MEMORY Directive
        1. 8.5.4.1 Default Memory Model
        2. 8.5.4.2 MEMORY Directive Syntax
        3. 8.5.4.3 Expressions and Address Operators
      5. 8.5.5  The SECTIONS Directive
        1. 8.5.5.1 SECTIONS Directive Syntax
        2. 8.5.5.2 Section Allocation and Placement
          1. 8.5.5.2.1 Binding
          2. 8.5.5.2.2 Named Memory
          3. 8.5.5.2.3 Controlling Placement Using The HIGH Location Specifier
            1. 8.5.5.2.3.1 Linker Placement With the HIGH Specifier
            2.         262
            3. 8.5.5.2.3.2 Linker Placement Without HIGH Specifier
          4. 8.5.5.2.4 Alignment and Blocking
          5. 8.5.5.2.5 Alignment With Padding
        3. 8.5.5.3 Specifying Input Sections
          1. 8.5.5.3.1 The Most Common Method of Specifying Section Contents
          2.        268
        4. 8.5.5.4 Using Multi-Level Subsections
        5. 8.5.5.5 Specifying Library or Archive Members as Input to Output Sections
          1. 8.5.5.5.1 Archive Members to Output Sections
          2.        272
        6. 8.5.5.6 Allocation Using Multiple Memory Ranges
        7. 8.5.5.7 Automatic Splitting of Output Sections Among Non-Contiguous Memory Ranges
      6. 8.5.6  Placing a Section at Different Load and Run Addresses
        1. 8.5.6.1 Specifying Load and Run Addresses
        2.       277
        3. 8.5.6.2 Referring to the Load Address by Using the .label Directive
      7. 8.5.7  Using GROUP and UNION Statements
        1. 8.5.7.1 Grouping Output Sections Together
        2. 8.5.7.2 Overlaying Sections With the UNION Statement
        3. 8.5.7.3 Using Memory for Multiple Purposes
        4. 8.5.7.4 Nesting UNIONs and GROUPs
        5. 8.5.7.5 Checking the Consistency of Allocators
        6. 8.5.7.6 Naming UNIONs and GROUPs
      8. 8.5.8  Special Section Types (DSECT, COPY, NOLOAD, and NOINIT)
      9. 8.5.9  Configuring Error Correcting Code (ECC) with the Linker
        1. 8.5.9.1 Using the ECC Specifier in the Memory Map
        2. 8.5.9.2 Using the ECC Directive
        3. 8.5.9.3 Using the VFILL Specifier in the Memory Map
      10. 8.5.10 Assigning Symbols at Link Time
        1. 8.5.10.1 Syntax of Assignment Statements
        2. 8.5.10.2 Assigning the SPC to a Symbol
        3. 8.5.10.3 Assignment Expressions
        4. 8.5.10.4 Symbols Automatically Defined by the Linker
        5. 8.5.10.5 Assigning Exact Start, End, and Size Values of a Section to a Symbol
        6. 8.5.10.6 Why the Dot Operator Does Not Always Work
        7. 8.5.10.7 Address and Dimension Operators
          1. 8.5.10.7.1 Input Items
          2. 8.5.10.7.2 Output Section
          3. 8.5.10.7.3 GROUPs
          4. 8.5.10.7.4 UNIONs
      11. 8.5.11 Creating and Filling Holes
        1. 8.5.11.1 Initialized and Uninitialized Sections
        2. 8.5.11.2 Creating Holes
        3. 8.5.11.3 Filling Holes
        4. 8.5.11.4 Explicit Initialization of Uninitialized Sections
    6. 8.6  Linker Symbols
      1. 8.6.1 Using Linker Symbols in C/C++ Applications
      2. 8.6.2 Declaring Weak Symbols
      3. 8.6.3 Resolving Symbols with Object Libraries
    7. 8.7  Default Placement Algorithm
      1. 8.7.1 How the Allocation Algorithm Creates Output Sections
      2. 8.7.2 Reducing Memory Fragmentation
    8. 8.8  Using Linker-Generated Copy Tables
      1. 8.8.1 Using Copy Tables for Boot Loading
      2. 8.8.2 Using Built-in Link Operators in Copy Tables
      3. 8.8.3 Overlay Management Example
      4. 8.8.4 Generating Copy Tables With the table() Operator
        1. 8.8.4.1 The table() Operator
        2. 8.8.4.2 Boot-Time Copy Tables
        3. 8.8.4.3 Using the table() Operator to Manage Object Components
        4. 8.8.4.4 Linker-Generated Copy Table Sections and Symbols
        5. 8.8.4.5 Splitting Object Components and Overlay Management
      5. 8.8.5 Compression
        1. 8.8.5.1 Compressed Copy Table Format
        2. 8.8.5.2 Compressed Section Representation in the Object File
        3. 8.8.5.3 Compressed Data Layout
        4. 8.8.5.4 Run-Time Decompression
        5. 8.8.5.5 Compression Algorithms
        6.       331
      6. 8.8.6 Copy Table Contents
      7. 8.8.7 General Purpose Copy Routine
    9. 8.9  Partial (Incremental) Linking
    10. 8.10 Linking C/C++ Code
      1. 8.10.1 Run-Time Initialization
      2. 8.10.2 Object Libraries and Run-Time Support
      3. 8.10.3 Setting the Size of the Stack and Heap Sections
      4. 8.10.4 Initializing and AutoInitialzing Variables at Run Time
    11. 8.11 Linker Example
  10. Object File Utilities
    1. 9.1 Invoking the Object File Display Utility
    2. 9.2 Invoking the Disassembler
    3. 9.3 Invoking the Name Utility
    4. 9.4 Invoking the Strip Utility
  11. 10Hex Conversion Utility Description
    1. 10.1  The Hex Conversion Utility's Role in the Software Development Flow
    2. 10.2  Invoking the Hex Conversion Utility
      1. 10.2.1 Invoking the Hex Conversion Utility From the Command Line
      2. 10.2.2 Invoking the Hex Conversion Utility With a Command File
    3. 10.3  Understanding Memory Widths
      1. 10.3.1 Target Width
      2. 10.3.2 Specifying the Memory Width
      3. 10.3.3 Partitioning Data Into Output Files
      4. 10.3.4 Specifying Word Order for Output Words
    4. 10.4  The ROMS Directive
      1. 10.4.1 When to Use the ROMS Directive
      2. 10.4.2 An Example of the ROMS Directive
    5. 10.5  The SECTIONS Directive
    6. 10.6  The Load Image Format (--load_image Option)
      1. 10.6.1 Load Image Section Formation
      2. 10.6.2 Load Image Characteristics
    7. 10.7  Excluding a Specified Section
    8. 10.8  Assigning Output Filenames
    9. 10.9  Image Mode and the --fill Option
      1. 10.9.1 Generating a Memory Image
      2. 10.9.2 Specifying a Fill Value
      3. 10.9.3 Steps to Follow in Using Image Mode
    10. 10.10 Array Output Format
    11. 10.11 Controlling the ROM Device Address
    12. 10.12 Control Hex Conversion Utility Diagnostics
    13. 10.13 Description of the Object Formats
      1. 10.13.1 ASCII-Hex Object Format (--ascii Option)
      2. 10.13.2 Intel MCS-86 Object Format (--intel Option)
      3. 10.13.3 Motorola Exorciser Object Format (--motorola Option)
      4. 10.13.4 Extended Tektronix Object Format (--tektronix Option)
      5. 10.13.5 Texas Instruments SDSMAC (TI-Tagged) Object Format (--ti_tagged Option)
      6. 10.13.6 TI-TXT Hex Format (--ti_txt Option)
        1. 10.13.6.1 TI-TXT Object Format
  12. 11Sharing C/C++ Header Files With Assembly Source
    1. 11.1 Overview of the .cdecls Directive
    2. 11.2 Notes on C/C++ Conversions
      1. 11.2.1  Comments
      2. 11.2.2  Conditional Compilation (#if/#else/#ifdef/etc.)
      3. 11.2.3  Pragmas
      4. 11.2.4  The #error and #warning Directives
      5. 11.2.5  Predefined symbol __ASM_HEADER__
      6. 11.2.6  Usage Within C/C++ asm( ) Statements
      7. 11.2.7  The #include Directive
      8. 11.2.8  Conversion of #define Macros
      9. 11.2.9  The #undef Directive
      10. 11.2.10 Enumerations
      11. 11.2.11 C Strings
      12. 11.2.12 C/C++ Built-In Functions
      13. 11.2.13 Structures and Unions
      14. 11.2.14 Function/Variable Prototypes
      15. 11.2.15 C Constant Suffixes
      16. 11.2.16 Basic C/C++ Types
    3. 11.3 Notes on C++ Specific Conversions
      1. 11.3.1 Name Mangling
      2. 11.3.2 Derived Classes
      3. 11.3.3 Templates
      4. 11.3.4 Virtual Functions
    4. 11.4 Special Assembler Support
      1. 11.4.1 Enumerations (.enum/.emember/.endenum)
      2. 11.4.2 The .define Directive
      3. 11.4.3 The .undefine/.unasg Directives
      4. 11.4.4 The $defined( ) Built-In Function
      5. 11.4.5 The $sizeof Built-In Function
      6. 11.4.6 Structure/Union Alignment and $alignof( )
      7. 11.4.7 The .cstring Directive
  13.   A Symbolic Debugging Directives
    1.     A.1 DWARF Debugging Format
    2.     A.2 Debug Directive Syntax
  14.   B XML Link Information File Description
    1.     B.1 XML Information File Element Types
    2.     B.2 Document Elements
      1.      B.2.1 Header Elements
      2.      B.2.2 Input File List
      3.      B.2.3 Object Component List
      4.      B.2.4 Logical Group List
      5.      B.2.5 Placement Map
      6.      B.2.6 Far Call Trampoline List
      7.      B.2.7 Symbol Table
  15.   C Glossary
    1.     C.1 Terminology
  16.   D Revision History
  17.   428
  18.   D Earlier Revisions

Linker Example

This example links three object files named demo.c.obj, filter.c.obj, tables.c.obj, and lex.c.obj and creates a program called demo.out.

Assume that target memory has the following program memory configuration:

Address Range Contents
0x0080 to 0x7000 On-chip RAM_PG
0xC000 to 0xFF80 On-chip ROM
Address Range Contents
0x0080 to 0x0FFF RAM block ONCHIP
0x0060 to 0xFFFF Mapped external addresses EXT
Address Range Contents
0x00000020 to 0x00210000 PMEM
0x00400000 to 0x01400000 EXT0
0x01400000 to 0x01800000 EXT1
0x02000000 to 0x03000000 EXT2
0x03000000 to 0x04000000 EXT3
0x80000000 to 0x82000000 BMEM

The output sections are constructed in the following manner:

  • Executable code, contained in the .text sections of demo.c.obj, filters.c.obj, and lex.c.obj, as well as executable code from the RTS library, are linked into program memory PMEM.
  • Two data objects are defined in tables.c.obj. Each is placed in its own output section: .tableA and .tableB. When the program is loaded, both the .tableA and .tableB output sections are linked into separate locations in the BMEM area. However, run-time access to these tables refers to the run-time location indicated by the symbol "filter_matrix", which is defined as the start address of the UNION containing both .tableA and .tableB. This location is linked into the EXT1 memory area. At run-time, the application is responsible for copying either .tableA or .tableB from its load location in BMEM to its run location in EXT1 before attempting to access data from the table that was copied. The linker supports the copy table mechanisms described in Section 9.9 to help facilitate this action.
  • For architectures that support and use DP-relative addressing, all data objects that are accessed using DP-relative addressing are collected into a group consisting of the .neardata, .rodata, and .bss output sections. This group is linked into the BMEM memory area.
  • Since the demo.out program uses command line arguments that must be specified when demo.out is loaded and run, the application must reserve space for passing command-line arguments to the program in the .args section. The amount of space allocated for the .args section is indicated in the '--args 0x1000' option near the top of the linker command file. The .args output section is then linked into the BMEM memory area. Support for processing command-line arguments is provided in the boot routine contained in the RTS library that will be linked into the demo.out program.
  • The size of the software stack is indicated by the "--stack 0x6000" option near the top of the linker command file. Likewise, the size of the heap, from which memory can be dynamically allocated at run-time, is indicated via the "--heap 0x3000" option near the top of the linker command file. Both the .stack and .sysmem (which contains the heap) output sections are linked into the BMEM memory area.

Linker Command File, mylnk.cmd shows the linker command file for this example. Output Map File, demo.map shows the map file.

Linker Command File, mylnk.cmd

/****************************************************************************/
/*** Specify Linker Options                                               ***/
/****************************************************************************/
-c
--heap  0x3000
--stack 0x6000
--args  0x1000
--output_file=demo.out                    /* Name the output file           */
--map_file=demo.map                       /* Create an output map file      */
-u filter_table_A
-u filter_table_B
/****************************************************************************/
/*** Specify the Input Files                                              ***/
/****************************************************************************/
demo.c.obj
tables.c.obj
filter.c.obj
lex.c.obj
/****************************************************************************/
/*** Specify Runtime Support Library to be linked in                      ***/
/****************************************************************************/
-l libc.a
/****************************************************************************/
/*** Specify the Memory Configuration                                     ***/
/****************************************************************************/
MEMORY
{
  PMEM:   o = 00000020h   l = 0020ffe0h
  EXT0:   o = 00400000h   l = 01000000h
  EXT1:   o = 01400000h   l = 00400000h
  EXT2:   o = 02000000h   l = 01000000h
  EXT3:   o = 03000000h   l = 01000000h
  BMEM:   o = 80000000h   l = 02000000h
}
/****************************************************************************/
/* Specify the Output Sections ***/
/****************************************************************************/
SECTIONS
{
  .text :       > PMEM
  UNION
  {
     .tableA: { tables.c.obj(.tableA) } load > BMEM, table(tableA_cpy)
     .tableB: { tables.c.obj(.tableB) } load > BMEM, table(tableB_cpy)
  } RUN = EXT1, RUN_START(filter_matrix)
  GROUP
  {
    .neardata:
    .rodata:
    .bss:
  } > EXT2
  .stack:       > BMEM
  .args :       > BMEM
  .cinit:       > BMEM
  .cio:         > BMEM
  .const:       > BMEM
  .data:        > BMEM
  .switch:      > BMEM
  .sysmem:      > BMEM
  .far:         > BMEM
  .fardata:     > BMEM
  .ppinfo:      > BMEM
}
/****************************************************************************/
/*** End of Command File ***/
/****************************************************************************/

Invoke the linker by entering the following command:

cl6x --run_linker mylnk.cmd

This creates the map file shown in Output Map File, demo.map and an output file called demo.out that can be run on a TMS320C6000.

Output Map File, demo.map

OUTPUT FILE NAME:   <demo.out>
EENTRY POINT SYMBOL: "_c_int00"  address: 00007a00
MEMORY CONFIGURATION
         name            origin    length      used     unused   attr    fill
----------------------  --------  ---------  --------  --------  ----  --------
  PMEM                  00000020   0020ffe0  00008080  00207f60  RWIX
  EXT0                  00400000   01000000  00000000  01000000  RWIX
  EXT1                  01400000   00400000  00000030  003fffd0  RWIX
  EXT2                  02000000   01000000  0000001c  00ffffe4  RWIX
  EXT3                  03000000   01000000  00000000  01000000  RWIX
  BMEM                  80000000   02000000  0000a9d4  01ff562c  RWIX
SEGMENT ALLOCATION MAP
run origin  load origin   length   init length attrs members
----------  ----------- ---------- ----------- ----- -------
00000020    00000020    00008080   00008080    r-x
  00000020    00000020    00008060   00008060    r-x .text
  00008080    00008080    00000020   00000020    r-- .ovly
01400000    8000a8c0    00000030   00000030    rw-
  01400000    8000a8c0    00000030   00000030    rw- .tableA
01400000    8000a8f0    00000030   00000030    rw-
  01400000    8000a8f0    00000030   00000030    rw- .tableB
02000000    02000000    0000001c   00000000    rw-
  02000000    02000000    0000001c   00000000    rw- .neardata
80000000    80000000    00009000   00000000    rw-
  80000000    80000000    00006000   00000000    rw- .stack
  80006000    80006000    00003000   00000000    rw- .sysmem
80009000    80009000    00001398   00001000    rw-
  80009000    80009000    00001000   00001000    rw- .args
  8000a000    8000a000    00000398   00000000    rw- .fardata
8000a398    8000a398    00000288   00000288    r--
  8000a398    8000a398    00000288   00000288    r-- .const
8000a620    8000a620    00000268   00000000    rw-
  8000a620    8000a620    00000148   00000000    rw- .far
  8000a768    8000a768    00000120   00000000    rw- .cio
8000a888    8000a888    00000038   00000038    r--
  8000a888    8000a888    00000038   00000038    r-- .switch
8000a920    8000a920    000000b4   000000b4    r--
  8000a920    8000a920    000000b4   000000b4    r-- .cinit
SECTION ALLOCATION MAP
 output                                attributes/
section   page    origin      length     input sections
--------  ----  ----------  ---------- ----------------
.text      0    00000020    00008060     
                  00000020    000005c0   rts6740_elf.lib : divd.c.obj (.text:__c6xabi_divd)
                  000005e0    000005c0                   : _printfi.c.obj (.text:_getarg_diouxp)
                  00000ba0    000005a0                   : _printfi.c.obj (.text:_setfield)
                  00001140    00000460                   : _printfi.c.obj (.text:__TI_printfi)
                  000015a0    00000380                   : fputs.c.obj (.text:fputs)
...
.neardata 
*          0    02000000    0000001c     UNINITIALIZED
                  02000000    0000001c     lex.c.obj (.neardata)
.rodata    0    0200001c    00000000     UNINITIALIZED
.bss       0    0200001c    00000000     UNINITIALIZED
.stack     0    80000000    00006000     UNINITIALIZED
                  80000000    00000008     rts6740_elf.lib : boot.c.obj (.stack)
                  80000008    00005ff8     --HOLE--
.sysmem    0    80006000    00003000     UNINITIALIZED
                  80006000    00000008     rts6740_elf.lib : memory.c.obj (.sysmem)
                  80006008    00002ff8     --HOLE--
.args      0    80009000    00001000     
                  80009000    00001000     --HOLE-- [fill = 0]
...
.tableA    0    8000a8c0    00000030     RUN ADDR = 01400000
                  8000a8c0    00000030     tables.c.obj (.tableA)
.tableB    0    8000a8f0    00000030     RUN ADDR = 01400000
                  8000a8f0    00000030     tables.c.obj (.tableB)
...
LINKER GENERATED COPY TABLES
tableA_cpy @ 00008080 records: 1, size/record: 12, table size: 16
.tableA: load addr=8000a8c0, load size=00000030, run addr=01400000, 
     run size=00000030, compression=none
tableB_cpy @ 00008090 records: 1, size/record: 12, table size: 16
.tableB: load addr=8000a8f0, load size=00000030, run addr=01400000, 
     run size=00000030, compression=none
__TI_cinit_table @ 8000a9bc records: 3, size/record: 8, table size: 24
.fardata: load addr=8000a920, load size=00000072 bytes, run addr=8000a000, 
     run size=00000398 bytes, compression=rle
.neardata: load addr=8000a994, load size=00000014 bytes, run addr=02000000, 
     run size=0000001c bytes, compression=rle
.far: load addr=8000a9b4, load size=00000008 bytes, run addr=8000a620, 
     run size=00000148 bytes, compression=zero_init
LINKER GENERATED HANDLER TABLE
__TI_handler_table @ 8000a9a8 records: 3, size/record: 4, table size: 12
index: 0, handler: __TI_decompress_rle24
index: 1, handler: __TI_decompress_none
index: 2, handler: __TI_zero_init
GLOBAL SYMBOLS: SORTED ALPHABETICALLY BY Name 
address   name                           
-------   ----                           
00007fc0  C$$EXIT                        
00007700  C$$IO$$                        
000071c0  HOSTclose                      
00005d20  HOSTlseek                      
...
00008080  __TI_table_tableA_cpy          
00008090  __TI_table_tableB_cpy          
...
[121 symbols]