blob: 310a5c5053b1f00da5d11a822d450cead94f9c8c [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Daniel Schwierzeck848a7cc2016-05-26 15:28:38 +02002
Tom Rini2aaa27d2019-01-22 17:09:26 -05003MEMORY { .spl_mem : ORIGIN = IMAGE_TEXT_BASE, \
4 LENGTH = IMAGE_MAX_SIZE }
Daniel Schwierzeck848a7cc2016-05-26 15:28:38 +02005MEMORY { .bss_mem : ORIGIN = CONFIG_SPL_BSS_START_ADDR, \
6 LENGTH = CONFIG_SPL_BSS_MAX_SIZE }
7
8OUTPUT_ARCH(mips)
9ENTRY(_start)
10SECTIONS
11{
12 . = 0x00000000;
13
14 . = ALIGN(4);
15 .text : {
developer34106af2022-05-20 11:21:45 +080016 __text_start = .;
Daniel Schwierzeck848a7cc2016-05-26 15:28:38 +020017 *(.text*)
developer34106af2022-05-20 11:21:45 +080018 __text_end = .;
Daniel Schwierzeck848a7cc2016-05-26 15:28:38 +020019 } > .spl_mem
20
21 . = ALIGN(4);
22 .rodata : {
23 *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*)))
24 } > .spl_mem
25
26 . = ALIGN(4);
27 .data : {
28 *(SORT_BY_ALIGNMENT(.data*))
29 *(SORT_BY_ALIGNMENT(.sdata*))
30 } > .spl_mem
31
developer25678a02020-04-21 09:28:37 +020032#if defined(CONFIG_SPL_DM) || defined(CONFIG_SPL_LOADER_SUPPORT)
Daniel Schwierzeck848a7cc2016-05-26 15:28:38 +020033 . = ALIGN(4);
Andrew Scull5a9095c2022-05-30 10:00:04 +000034 __u_boot_list : {
35 KEEP(*(SORT(__u_boot_list*)));
Daniel Schwierzeck848a7cc2016-05-26 15:28:38 +020036 } > .spl_mem
37#endif
38
39 . = ALIGN(4);
40 __image_copy_end = .;
developer34106af2022-05-20 11:21:45 +080041 __image_copy_len = __image_copy_end - __text_start;
Daniel Schwierzeck848a7cc2016-05-26 15:28:38 +020042
developerfa8f3302020-04-21 09:28:36 +020043 _image_binary_end = .;
44
Daniel Schwierzeck848a7cc2016-05-26 15:28:38 +020045 .bss (NOLOAD) : {
46 __bss_start = .;
47 *(.bss*)
48 *(.sbss*)
49 *(COMMON)
50 . = ALIGN(4);
51 __bss_end = .;
52 } > .bss_mem
53
Daniel Schwierzeckce2b89e2019-01-06 20:42:43 +010054 /* These mark the ABI of U-Boot for debuggers. */
55 .mdebug.abi32 : {
56 KEEP(*(.mdebug.abi32))
Daniel Schwierzeck848a7cc2016-05-26 15:28:38 +020057 }
Daniel Schwierzeckce2b89e2019-01-06 20:42:43 +010058 .mdebug.abi64 : {
59 KEEP(*(.mdebug.abi64))
Daniel Schwierzeck848a7cc2016-05-26 15:28:38 +020060 }
61
Daniel Schwierzeckce2b89e2019-01-06 20:42:43 +010062 /* This is the MIPS specific mdebug section. */
63 .mdebug : { *(.mdebug) }
Daniel Schwierzeck848a7cc2016-05-26 15:28:38 +020064
Daniel Schwierzeckce2b89e2019-01-06 20:42:43 +010065 /* Stabs debugging sections. */
66 .stab 0 : { *(.stab) }
67 .stabstr 0 : { *(.stabstr) }
68 .stab.excl 0 : { *(.stab.excl) }
69 .stab.exclstr 0 : { *(.stab.exclstr) }
70 .stab.index 0 : { *(.stab.index) }
71 .stab.indexstr 0 : { *(.stab.indexstr) }
72 .comment 0 : { *(.comment) }
Daniel Schwierzeck848a7cc2016-05-26 15:28:38 +020073
Daniel Schwierzeckce2b89e2019-01-06 20:42:43 +010074 /*
75 * DWARF debug sections.
76 * Symbols in the DWARF debugging sections are relative to
77 * the beginning of the section so we begin them at 0.
78 */
79 /* DWARF 1 */
80 .debug 0 : { *(.debug) }
81 .line 0 : { *(.line) }
82 /* GNU DWARF 1 extensions */
83 .debug_srcinfo 0 : { *(.debug_srcinfo) }
84 .debug_sfnames 0 : { *(.debug_sfnames) }
85 /* DWARF 1.1 and DWARF 2 */
86 .debug_aranges 0 : { *(.debug_aranges) }
87 .debug_pubnames 0 : { *(.debug_pubnames) }
88 /* DWARF 2 */
89 .debug_info 0 : {
90 *(.debug_info
91 .gnu.linkonce.wi.*)
Daniel Schwierzeck848a7cc2016-05-26 15:28:38 +020092 }
Daniel Schwierzeckce2b89e2019-01-06 20:42:43 +010093 .debug_abbrev 0 : { *(.debug_abbrev) }
94 .debug_line 0 : { *(.debug_line) }
95 .debug_frame 0 : { *(.debug_frame) }
96 .debug_str 0 : { *(.debug_str) }
97 .debug_loc 0 : { *(.debug_loc) }
98 .debug_macinfo 0 : { *(.debug_macinfo) }
99 .debug_pubtypes 0 : { *(.debug_pubtypes) }
100 /* DWARF 3 */
101 .debug_ranges 0 : { *(.debug_ranges) }
102 /* SGI/MIPS DWARF 2 extensions */
103 .debug_weaknames 0 : { *(.debug_weaknames) }
104 .debug_funcnames 0 : { *(.debug_funcnames) }
105 .debug_typenames 0 : { *(.debug_typenames) }
106 .debug_varnames 0 : { *(.debug_varnames) }
107 /* GNU DWARF 2 extensions */
108 .debug_gnu_pubnames 0 : { *(.debug_gnu_pubnames) }
109 .debug_gnu_pubtypes 0 : { *(.debug_gnu_pubtypes) }
110 /* DWARF 4 */
111 .debug_types 0 : { *(.debug_types) }
112 /* DWARF 5 */
113 .debug_macro 0 : { *(.debug_macro) }
114 .debug_addr 0 : { *(.debug_addr) }
Daniel Schwierzeck848a7cc2016-05-26 15:28:38 +0200115
Daniel Schwierzeckce2b89e2019-01-06 20:42:43 +0100116 /DISCARD/ : {
117 /* ABI crap starts here */
118 *(.MIPS.abiflags)
119 *(.MIPS.options)
120 *(.options)
121 *(.pdr)
122 *(.reginfo)
123 *(.eh_frame)
Daniel Schwierzeck848a7cc2016-05-26 15:28:38 +0200124 }
125}