TI Arm Clang Compiler Tools User's Guide
v3.2
  • Getting Started Guide
  • Migration Guide
  • Compiler Tools User Manual
    • 1. Using the C/C++ Compiler
    • 2. C/C++ Language Implementation
    • 3. Run-Time Environment
    • 4. Using Run-Time-Support Functions and Building Libraries
    • 5. Processing Assembly Source Code
    • 6. Cortex-M Security Extensions (CMSE)
    • 7. Introduction to Object Modules
    • 8. Program Loading and Running
    • 9. Archiver Description
    • 10. Linker Description
      • 10.1. Linker Overview
      • 10.2. The Linker’s Role in the Software Development Flow
      • 10.3. Invoking the Linker
      • 10.4. Linker Options
      • 10.5. Linker Command Files
      • 10.6. Linker Symbols
      • 10.7. Default Placement Algorithm
      • 10.8. Using Linker-Generated Copy Tables
        • 10.8.1. Using Copy Tables for Boot Loading
        • 10.8.2. Using Built-in Link Operators in Copy Tables
        • 10.8.3. Overlay Management Example
        • 10.8.4. Generating Copy Tables With the table() Operator
        • 10.8.5. Compression
        • 10.8.6. Copy Table Contents
        • 10.8.7. General-Purpose Copy Routine
      • 10.9. Linker-Generated CRC Tables and CRC Over Memory Ranges
      • 10.10. Partial (Incremental) Linking
      • 10.11. Linking C/C++ Code
      • 10.12. Linker Example
    • 11. Link Time Optimization - LTO
    • 12. Code Coverage
    • 13. Name and C++ Name Demangler Utilities
    • 14. Object File Utilities
    • 15. Hex Conversion Utility Description
    • 16. Smart Function and Data Placement
  • GNU-Syntax Arm Assembly Language Reference Guide
  • Note on Linux Installations
  • Additional Material
  • Support
  • Important Notice
TI Arm Clang Compiler Tools User's Guide
  • »
  • tiarmclang Compiler User Manual »
  • 10. Linker Description »
  • 10.8. Using Linker-Generated Copy Tables »
  • 10.8.2. Using Built-in Link Operators in Copy Tables

10.8.2. Using Built-in Link Operators in Copy Tables¶

You can avoid some of this maintenance burden by using the LOAD_START(), RUN_START(), and SIZE() operators that are already part of the linker command file syntax . For example, instead of building the application to generate a .map file, the linker command file can be annotated:

SECTIONS
{
    .flashcode: { app_tasks.c.o(.text) }
        load = FLASH, run = PMEM,
        LOAD_START(_flash_code_ld_start),
        RUN_START(_flash_code_rn_start),
        SIZE(_flash_code_size)
    ...
}

In this example, the LOAD_START(), RUN_START(), and SIZE() operators instruct the linker to create three symbols:

Symbol

Description

_flash_code_ld_start

Load address of .flashcode section

_flash_code_rn_start

Run address of .flashcode section

_flash_code_size

Size of .flashcode section

These symbols can then be referenced from the copy table. The actual data in the copy table will be updated automatically each time the application is linked. This approach removes step 1 of the process described in Using Copy Tables for Boot Loading.

While maintenance of the copy table is reduced markedly, you must still carry the burden of keeping the copy table contents in sync with the symbols that are defined in the linker command file. Ideally, the linker would generate the boot copy table automatically. This would avoid having to build the application twice and free you from having to explicitly manage the contents of the boot copy table.

For more information on the LOAD_START(), RUN_START(), and SIZE() operators, see Address and Dimension Operators.

Previous Next

© Copyright 2023, Texas Instruments Incorporated. Last updated on Jan 16, 2024.