Using wild match init_array* to include global array init ctor Before: 10 .ctors 00000040 ffff0000001e6b80 00000000401e6b80 DATA 11 .dtors 00000000 ffff0000001e6bc0 00000000401e6bc0 DATA 12 .got 00000060 ffff0000001e6bc0 00000000401e6bc0 DATA 13 .init_array.1 00000470 ffff0000001e6c20 00000000401e6c20 14 .fini_array.1 00000470 ffff0000001e7090 00000000401e7090 15 .dummy_post_data 00000000 ffff0000001e7500 00000000401e7500 DATA 16 .bss 00009460 ffff0000001e8000 00000000401e8000 BSS After: 10 .ctors 000004b0 ffff0000001e6b80 00000000401e6b80 DATA 11 .dtors 00000470 ffff0000001e7030 00000000401e7030 12 .got 00000060 ffff0000001e74a0 00000000401e74a0 DATA 13 .dummy_post_data 00000000 ffff0000001e7500 00000000401e7500 DATA 14 .bss 00009460 ffff0000001e8000 00000000401e8000 BSS Signed-off-by: Lei Wen <leiwen@asrmicro.com>
119 lines
3.4 KiB
Plaintext
119 lines
3.4 KiB
Plaintext
OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
|
|
OUTPUT_ARCH(arm)
|
|
|
|
ENTRY(_start)
|
|
SECTIONS
|
|
{
|
|
. = %KERNEL_BASE% + %KERNEL_LOAD_OFFSET%;
|
|
|
|
_start = .;
|
|
|
|
/* text/read-only data */
|
|
/* set the load address to physical MEMBASE */
|
|
.text : AT(%MEMBASE% + %KERNEL_LOAD_OFFSET%) {
|
|
KEEP(*(.text.boot.vectab1))
|
|
KEEP(*(.text.boot.vectab2))
|
|
KEEP(*(.text.boot))
|
|
*(.text* .sram.text.glue_7* .gnu.linkonce.t.*)
|
|
}
|
|
|
|
.interp : { *(.interp) }
|
|
.hash : { *(.hash) }
|
|
.dynsym : { *(.dynsym) }
|
|
.dynstr : { *(.dynstr) }
|
|
.rel.text : { *(.rel.text) *(.rel.gnu.linkonce.t*) }
|
|
.rela.text : { *(.rela.text) *(.rela.gnu.linkonce.t*) }
|
|
.rel.data : { *(.rel.data) *(.rel.gnu.linkonce.d*) }
|
|
.rela.data : { *(.rela.data) *(.rela.gnu.linkonce.d*) }
|
|
.rel.rodata : { *(.rel.rodata) *(.rel.gnu.linkonce.r*) }
|
|
.rela.rodata : { *(.rela.rodata) *(.rela.gnu.linkonce.r*) }
|
|
.rel.got : { *(.rel.got) }
|
|
.rela.got : { *(.rela.got) }
|
|
.rel.ctors : { *(.rel.ctors) }
|
|
.rela.ctors : { *(.rela.ctors) }
|
|
.rel.dtors : { *(.rel.dtors) }
|
|
.rela.dtors : { *(.rela.dtors) }
|
|
.rel.init : { *(.rel.init) }
|
|
.rela.init : { *(.rela.init) }
|
|
.rel.fini : { *(.rel.fini) }
|
|
.rela.fini : { *(.rela.fini) }
|
|
.rel.bss : { *(.rel.bss) }
|
|
.rela.bss : { *(.rela.bss) }
|
|
.rel.plt : { *(.rel.plt) }
|
|
.rela.plt : { *(.rela.plt) }
|
|
.init : { *(.init) } =0x9090
|
|
.plt : { *(.plt) }
|
|
|
|
/* .ARM.exidx is sorted, so has to go in its own output section. */
|
|
__exidx_start = .;
|
|
.ARM.exidx : { *(.ARM.exidx* .gnu.linkonce.armexidx.*) }
|
|
__exidx_end = .;
|
|
|
|
.rodata : ALIGN(4) {
|
|
__rodata_start = .;
|
|
__fault_handler_table_start = .;
|
|
KEEP(*(.rodata.fault_handler_table))
|
|
__fault_handler_table_end = .;
|
|
*(.rodata .rodata.* .gnu.linkonce.r.*)
|
|
}
|
|
|
|
/*
|
|
* extra linker scripts tend to insert sections just after .rodata,
|
|
* so we want to make sure this symbol comes after anything inserted above,
|
|
* but not aligned to the next section necessarily.
|
|
*/
|
|
.dummy_post_rodata : {
|
|
__rodata_end = .;
|
|
}
|
|
|
|
.data : ALIGN(4) {
|
|
/* writable data */
|
|
__data_start_rom = .;
|
|
/* in one segment binaries, the rom data address is on top of the ram data address */
|
|
__data_start = .;
|
|
*(.data .data.* .gnu.linkonce.d.*)
|
|
}
|
|
|
|
.ctors : ALIGN(4) {
|
|
__ctor_list = .;
|
|
KEEP(*(.ctors .init_array*))
|
|
__ctor_end = .;
|
|
}
|
|
.dtors : ALIGN(4) {
|
|
__dtor_list = .;
|
|
KEEP(*(.dtors .fini_array*))
|
|
__dtor_end = .;
|
|
}
|
|
.got : { *(.got.plt) *(.got) }
|
|
.dynamic : { *(.dynamic) }
|
|
|
|
/*
|
|
* extra linker scripts tend to insert sections just after .data,
|
|
* so we want to make sure this symbol comes after anything inserted above,
|
|
* but not aligned to the next section necessarily.
|
|
*/
|
|
.dummy_post_data : {
|
|
__data_end = .;
|
|
}
|
|
|
|
/* uninitialized data (in same segment as writable data) */
|
|
.bss : ALIGN(4) {
|
|
KEEP(*(.bss.prebss.*))
|
|
. = ALIGN(4);
|
|
__bss_start = .;
|
|
*(.bss .bss.*)
|
|
*(.gnu.linkonce.b.*)
|
|
*(COMMON)
|
|
. = ALIGN(4);
|
|
__bss_end = .;
|
|
}
|
|
|
|
_end = .;
|
|
|
|
. = %KERNEL_BASE% + %MEMSIZE%;
|
|
_end_of_ram = .;
|
|
|
|
/* Strip unnecessary stuff */
|
|
/DISCARD/ : { *(.comment .note .eh_frame) }
|
|
}
|