LINKER_SCRIPT

Constant LINKER_SCRIPT 

Source
const LINKER_SCRIPT: &str = "OUTPUT_FORMAT(\"elf32-littlearm\")\nENTRY(_boot)\n\n/*\n * PROVIDE() is used here so that users can override default values.\n * This is intended to give developers the option to use this Rust\n * target even if the default values in this linker script aren\'t\n * suitable for their needs.\n *\n * For example: `-C link-arg=--defsym=__stack_length=8M` could\n * be used to increase the stack size above the value set in this\n * file.\n */\n\nPROVIDE(__vcodesig_magic = 0x35585658);     /* XVX5                 */\nPROVIDE(__vcodesig_type = 0);               /* V5_SIG_TYPE_USER     */\nPROVIDE(__vcodesig_owner = 2);              /* V5_SIG_OWNER_PARTNER */\nPROVIDE(__vcodesig_options = 0);            /* none (0)             */\n\n__user_ram_start = 0x03800000;\n__user_ram_end   = 0x08000000;\n/* (0x48 =) 72 MiB length */\n__user_ram_length = __user_ram_start - __user_ram_end;\n\n/*\n * VEXos provides a method for pre-loading a \"linked file\" at a specified\n * address in User RAM, conventionally near the end, after the primary\n * program binary. We need to be sure not to place any data in that location,\n * so we allow the user of this linker script to inform the start address of\n * this blob.\n */\nPROVIDE(__linked_file_length = 0);\nPROVIDE(__linked_file_end = __user_ram_end);\nPROVIDE(__linked_file_start = __linked_file_end - __linked_file_length);\n\nPROVIDE(__stack_length = 4M);\nPROVIDE(__stack_top = __linked_file_start);\nPROVIDE(__stack_bottom = __linked_file_start - __stack_length);\n\nMEMORY {\n    USER_RAM (RWX) : ORIGIN = __user_ram_start, LENGTH = __user_ram_length\n}\n\nSECTIONS {\n    /*\n     * VEXos expects program binaries to have a 32-byte header called a \"code signature\"\n     * at their start which tells the OS that we are a valid program and configures some\n     * miscellaneous startup behavior.\n     */\n    .code_signature : {\n        LONG(__vcodesig_magic)\n        LONG(__vcodesig_type)\n        LONG(__vcodesig_owner)\n        LONG(__vcodesig_options)\n\n        FILL(0)\n        . = __user_ram_start + 0x20;\n    } > USER_RAM\n\n    /*\n     * Executable program instructions.\n     */\n    .text : {\n        /* _boot routine (entry point from VEXos, must be at 0x03800020) */\n        *(.boot)\n\n        /* The rest of the program. */\n        *(.text .text.*)\n    } > USER_RAM\n\n    /*\n     * Global/uninitialized/static/constant data sections.\n     */\n    .rodata : {\n        *(.rodata .rodata1 .rodata.*)\n        *(.srodata .srodata.*)\n    } > USER_RAM\n\n    /*\n     * ARM Stack Unwinding Sections\n     *\n     * These sections are added by the compiler in some cases to facilitate stack unwinding.\n     * __eh_frame_start and similar symbols are used by libunwind.\n     */\n\n    .except_ordered : {\n        PROVIDE(__extab_start = .);\n        *(.gcc_except_table *.gcc_except_table.*)\n        *(.ARM.extab*)\n        PROVIDE(__extab_end = .);\n    } > USER_RAM\n\n    .eh_frame_hdr : {\n        /* see https://github.com/llvm/llvm-project/blob/main/libunwind/src/AddressSpace.hpp#L78 */\n        PROVIDE(__eh_frame_hdr_start = .);\n        KEEP(*(.eh_frame_hdr))\n        PROVIDE(__eh_frame_hdr_end = .);\n    } > USER_RAM\n\n    .eh_frame : {\n        PROVIDE(__eh_frame_start = .);\n        KEEP(*(.eh_frame))\n        PROVIDE(__eh_frame_end = .);\n    } > USER_RAM\n\n    .except_unordered : {\n        PROVIDE(__exidx_start = .);\n        *(.ARM.exidx*)\n        PROVIDE(__exidx_end = .);\n    } > USER_RAM\n\n    /* -- Data intended to be mutable at runtime begins here. -- */\n\n    .data : {\n        *(.data .data1 .data.*)\n        *(.sdata .sdata.* .sdata2.*)\n    } > USER_RAM\n\n    /* -- End of loadable sections - anything beyond this point shouldn\'t go in the binary uploaded to the device. -- */\n\n    .bss (NOLOAD) : {\n        __bss_start = .;\n        *(.sbss*)\n        *(.bss .bss.*)\n\n        /* Align the heap */\n        . = ALIGN(8);\n        __bss_end = .;\n    } > USER_RAM\n\n    /*\n     * Active memory sections for the stack/heap.\n     *\n     * Because these are (NOLOAD), they will not influence the final size of the binary.\n     */\n    .heap (NOLOAD) : {\n        __heap_start = .;\n        . = __stack_bottom;\n        __heap_end = .;\n    } > USER_RAM\n\n    .stack (NOLOAD) : ALIGN(8) {\n        __stack_bottom = .;\n        . += __stack_length;\n        __stack_top = .;\n    } > USER_RAM\n\n    /*\n     * `.ARM.attributes` contains arch metadata for compatibility purposes, but we\n     * only target one hardware configuration, meaning it\'d just take up space.\n     */\n    /DISCARD/ : {\n        *(.ARM.attributes*)\n    }\n}\n";