1/* 2 * Copyright (c) 2006-2023, RT-Thread Development Team 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 * 6 * Change Logs: 7 * Date Author Notes 8 * 2010-05-17 swkyer first version 9 * 2010-09-04 bernard move the beginning entry to 0x80200000 10 * 2018-05-12 zhuangwei use -Ttext 11 * 2019-12-04 Jiaxun Yang Adapt new memory layout 12 */ 13 14OUTPUT_ARCH(mips) 15GROUP(-lgcc -lc) 16 17ENTRY(_start) 18SECTIONS 19{ 20 . = ALIGN(4); 21 .text : 22 { 23 start = ABSOLUTE(.); 24 *(.selfboot); 25 *(.selfboot_data); 26 . = ALIGN(4); 27 __selfboot_end = .; 28 . = ALIGN(0x1000); 29 __ebase_entry = .; 30 KEEP(*(.exc_vectors)) 31 __ebase_end = .; 32 *(.start); 33 *(.text) 34 *(.text.*) 35 *(.rodata) 36 *(.rodata.*) 37 *(.rodata1) 38 *(.rodata1.*) 39 40 /* section information for finsh shell */ 41 . = ALIGN(4); 42 __fsymtab_start = .; 43 KEEP(*(FSymTab)) 44 __fsymtab_end = .; 45 . = ALIGN(4); 46 __vsymtab_start = .; 47 KEEP(*(VSymTab)) 48 __vsymtab_end = .; 49 . = ALIGN(4); 50 51 . = ALIGN(4); 52 __rt_init_start = .; 53 KEEP(*(SORT(.rti_fn*))) 54 __rt_init_end = .; 55 . = ALIGN(4); 56 } 57 58 .eh_frame_hdr : 59 { 60 *(.eh_frame_hdr) 61 *(.eh_frame_entry) 62 } 63 .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) } 64 65 . = ALIGN(4); 66 .data : 67 { 68 *(.data) 69 *(.data.*) 70 71 *(.data1) 72 *(.data1.*) 73 74 . = ALIGN(8); 75 _gp = ABSOLUTE(.); /* Base of small data */ 76 77 *(.sdata) 78 *(.sdata.*) 79 } 80 _edata = .; 81 82 .stack : 83 { 84 . = ALIGN(8); 85 _system_stack_start = .; 86 . = . + 0x400; /* 1kb system stack */ 87 _system_stack = .; 88 } 89 90 .sbss : 91 { 92 __bss_start = .; 93 *(.sbss) 94 *(.sbss.*) 95 *(.dynsbss) 96 *(.scommon) 97 } 98 99 .bss : 100 { 101 *(.bss) 102 *(.bss.*) 103 *(.dynbss) 104 *(COMMON) 105 __bss_end = .; 106 } 107 _end = .; 108 109 /* Stabs debugging sections. */ 110 .stab 0 : { *(.stab) } 111 .stabstr 0 : { *(.stabstr) } 112 .stab.excl 0 : { *(.stab.excl) } 113 .stab.exclstr 0 : { *(.stab.exclstr) } 114 .stab.index 0 : { *(.stab.index) } 115 .stab.indexstr 0 : { *(.stab.indexstr) } 116 .comment 0 : { *(.comment) } 117 /* DWARF debug sections. 118 * Symbols in the DWARF debugging sections are relative to the beginning 119 * of the section so we begin them at 0. */ 120 /* DWARF 1 */ 121 .debug 0 : { *(.debug) } 122 .line 0 : { *(.line) } 123 /* GNU DWARF 1 extensions */ 124 .debug_srcinfo 0 : { *(.debug_srcinfo) } 125 .debug_sfnames 0 : { *(.debug_sfnames) } 126 /* DWARF 1.1 and DWARF 2 */ 127 .debug_aranges 0 : { *(.debug_aranges) } 128 .debug_pubnames 0 : { *(.debug_pubnames) } 129 /* DWARF 2 */ 130 .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) } 131 .debug_abbrev 0 : { *(.debug_abbrev) } 132 .debug_line 0 : { *(.debug_line) } 133 .debug_frame 0 : { *(.debug_frame) } 134 .debug_str 0 : { *(.debug_str) } 135 .debug_loc 0 : { *(.debug_loc) } 136 .debug_macinfo 0 : { *(.debug_macinfo) } 137 /* SGI/MIPS DWARF 2 extensions */ 138 .debug_weaknames 0 : { *(.debug_weaknames) } 139 .debug_funcnames 0 : { *(.debug_funcnames) } 140 .debug_typenames 0 : { *(.debug_typenames) } 141 .debug_varnames 0 : { *(.debug_varnames) } 142} 143