# Linker script

Source: [https://docs.qualcomm.com/doc/80-58740-1/topic/usage-of-linker-script.html](https://docs.qualcomm.com/doc/80-58740-1/topic/usage-of-linker-script.html)

The SDK uses the bsp/board/qcc743dk/qcc743\_flash.ld file as the
            linker script. It defines linker-related information, such as memory layout and symbol
            addresses.

- The `OUTPUT_ARCH ("riscv")` directive configures the target
                architecture as RISC-V, which is crucial information for the linker to determine the
                target system architecture.
- `ENTRY(__start)` specifies the entry point of the program as
                    `__start`. The entry point is the first function or code segment
                that starts executing when the program runs.
- It defines the stack size, minimum heap size, minimum PSRAM heap size, and other
                constants and variables.
- It defines memory regions, including starting addresses and lengths.
    - `fw_header_memory`: Region for storing firmware header
                        data.
    - `xip_memory`: Region for storing code (not modified during
                        execution).
    - `ram_psram`: Region for RAM and PSRAM.
    - `itcm_memory` and `dtcm_memory`: Tightly
                        Coupled Memory (TCM) region for storing instructions and data.
    - `nocache_ram_memory`: RAM region without caching.
    - `ram_memory`: Regular RAM region.
    - `ram_wifi`: RAM region for the Wi-Fi module.
- It defines the contents and placement addresses of  program sections.
    - `fw_header`: Firmware header.
    - `init`: Initialization code.
    - `rftlv.tool`: rftlv.
    - `RAM_DATA`: Data.
    - `text`: Application code.
    - `bss`: Uninitialized global variable.
    - `heap`: Heap.
- It defines the top of the stack, stack limits, and addresses of related symbols to
                identify the start and end positions of  memory regions for referencing and
                manipulating them in the program.
    - `__StackTop`: Top of the stack, indicating the end position
                        of the stack.
    - `_sp_main`: Main stack pointer.
    - `__freertos_irq_stack_top`: Top of the FreeRTOS interrupt
                        stack.
- It performs validity checks using ASSERT to ensure that the sizes of different
                memory regions do not exceed their allocated memory space. If the size of a memory
                region exceeds the limit, the linking process fails, allowing early detection of
                memory allocation issues.
- For Wi-Fi RAM, it defines the starting address, size, and other symbols for the
                Wi-Fi BSS segment and heap.

**Parent Topic:** [Application development](https://docs.qualcomm.com/doc/80-58740-1/topic/application_development.html)

Last Published: Feb 11, 2026

[Previous Topic
FreeRTOS](https://docs.qualcomm.com/bundle/publicresource/80-58740-1/topics/operating-system.md) [Next Topic
bugkiller](https://docs.qualcomm.com/bundle/publicresource/80-58740-1/topics/usage-of-bugkiller.md)