1OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm") 2OUTPUT_ARCH(arm) 3 4ENTRY(_start) 5SECTIONS 6{ 7 . = %KERNEL_BASE% + %KERNEL_LOAD_OFFSET%; 8 9 _start = .; 10 11 /* text/read-only data */ 12 /* set the load address to physical MEMBASE */ 13 .text : AT(%MEMBASE% + %KERNEL_LOAD_OFFSET%) { 14 KEEP(*(.text.boot.vectab1)) 15 KEEP(*(.text.boot.vectab2)) 16 KEEP(*(.text.boot)) 17 *(.text* .sram.text.glue_7* .gnu.linkonce.t.*) 18 } 19 20 .interp : { *(.interp) } 21 .hash : { *(.hash) } 22 .dynsym : { *(.dynsym) } 23 .dynstr : { *(.dynstr) } 24 .rel.text : { *(.rel.text) *(.rel.gnu.linkonce.t*) } 25 .rela.text : { *(.rela.text) *(.rela.gnu.linkonce.t*) } 26 .rel.data : { *(.rel.data) *(.rel.gnu.linkonce.d*) } 27 .rela.data : { *(.rela.data) *(.rela.gnu.linkonce.d*) } 28 .rel.rodata : { *(.rel.rodata) *(.rel.gnu.linkonce.r*) } 29 .rela.rodata : { *(.rela.rodata) *(.rela.gnu.linkonce.r*) } 30 .rel.got : { *(.rel.got) } 31 .rela.got : { *(.rela.got) } 32 .rel.ctors : { *(.rel.ctors) } 33 .rela.ctors : { *(.rela.ctors) } 34 .rel.dtors : { *(.rel.dtors) } 35 .rela.dtors : { *(.rela.dtors) } 36 .rel.init : { *(.rel.init) } 37 .rela.init : { *(.rela.init) } 38 .rel.fini : { *(.rel.fini) } 39 .rela.fini : { *(.rela.fini) } 40 .rel.bss : { *(.rel.bss) } 41 .rela.bss : { *(.rela.bss) } 42 .rel.plt : { *(.rel.plt) } 43 .rela.plt : { *(.rela.plt) } 44 .init : { *(.init) } =0x9090 45 .plt : { *(.plt) } 46 47 /* .ARM.exidx is sorted, so has to go in its own output section. */ 48 __exidx_start = .; 49 .ARM.exidx : { *(.ARM.exidx* .gnu.linkonce.armexidx.*) } 50 __exidx_end = .; 51 52 .rodata : ALIGN(4) { 53 __rodata_start = .; 54 __fault_handler_table_start = .; 55 KEEP(*(.rodata.fault_handler_table)) 56 __fault_handler_table_end = .; 57 *(.rodata .rodata.* .gnu.linkonce.r.*) 58 } 59 60 .ctors : ALIGN(4) { 61 __ctor_list = .; 62 KEEP(*(.ctors .init_array)) 63 __ctor_end = .; 64 } 65 .dtors : ALIGN(4) { 66 __dtor_list = .; 67 KEEP(*(.dtors .fini_array)) 68 __dtor_end = .; 69 } 70 71 /* 72 * .got and .dynamic need to follow .ctors and .dtors because the linker 73 * puts them all in the RELRO segment and wants them contiguous 74 */ 75 .dynamic : { *(.dynamic) } 76 .got : { *(.got.plt) *(.got) } 77 78 /* 79 * extra linker scripts tend to insert sections just after .rodata, 80 * so we want to make sure this symbol comes after anything inserted above, 81 * but not aligned to the next section necessarily. 82 */ 83 .fake_post_rodata : { 84 __rodata_end = .; 85 } 86 87 .data : ALIGN(4) { 88 /* writable data */ 89 __data_start_rom = .; 90 /* in one segment binaries, the rom data address is on top of the ram data address */ 91 __data_start = .; 92 *(.data .data.* .gnu.linkonce.d.*) 93 } 94 95 /* 96 * extra linker scripts tend to insert sections just after .data, 97 * so we want to make sure this symbol comes after anything inserted above, 98 * but not aligned to the next section necessarily. 99 */ 100 .fake_post_data : { 101 __data_end = .; 102 } 103 104 /* uninitialized data (in same segment as writable data) */ 105 .bss : ALIGN(4) { 106 KEEP(*(.bss.prebss.*)) 107 . = ALIGN(4); 108 __bss_start = .; 109 *(.bss .bss.*) 110 *(.gnu.linkonce.b.*) 111 *(COMMON) 112 . = ALIGN(4); 113 __bss_end = .; 114 } 115 116 _end = .; 117 118 . = %KERNEL_BASE% + %MEMSIZE%; 119 _end_of_ram = .; 120 121 /* Strip unnecessary stuff */ 122 /DISCARD/ : { *(.comment .note .eh_frame) } 123} 124