X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/f044ca812256b421e793c4335ce1ffed74710a70..32b9a6d76790c73d3d2d36d9081a2581cc65d184:/lunaix-os/link/linker.ld diff --git a/lunaix-os/link/linker.ld b/lunaix-os/link/linker.ld index 1cc64bb..c3d57da 100644 --- a/lunaix-os/link/linker.ld +++ b/lunaix-os/link/linker.ld @@ -2,29 +2,35 @@ ENTRY(start_) SECTIONS { . = 0x100000; + __kboot_start = .; /* 这里是我们的高半核初始化代码段和数据段 */ - .boot.text BLOCK(4K) : { + .boot.text BLOCK(4K) : + { *(.multiboot) *(.boot.text) } - .boot.bss BLOCK(4K) : { + .boot.bss BLOCK(4K) : + { *(.boot.bss) } - .boot.data BLOCK(4K) : { + .boot.data BLOCK(4K) : + { *(.boot.data) } - .boot.rodata BLOCK(4K) : { + .boot.rodata BLOCK(4K) : + { *(.boot.rodata) } - .boot.bss BLOCK(4K) : { + .boot.bss BLOCK(4K) : + { *(.boot.rodata) } - __kexec_boot_end = ALIGN(4K); + __kboot_end = ALIGN(4K); /* ---- boot end ---- */ @@ -33,24 +39,39 @@ SECTIONS { . += 0xC0000000; /* 好了,我们的内核…… */ - .text BLOCK(4K) : AT ( ADDR(.text) - 0xC0000000 ) { + + PROVIDE(__kexec_text_start = ALIGN(4K)); + + .text BLOCK(4K) : AT ( ADDR(.text) - 0xC0000000 ) + { __kexec_start = .; - PROVIDE(__kexec_text_start = .); *(.text) + } + + .kf.preempt BLOCK(4K) : AT ( ADDR(.kf.preempt) - 0xC0000000 ) + { + PROVIDE(__kf_preempt_start = .); + + KEEP(*(.kf.preempt)); - PROVIDE(__kexec_text_end = .); + PROVIDE(__kf_preempt_end = .); } - .data BLOCK(4K) : AT ( ADDR(.data) - 0xC0000000 ) { + PROVIDE(__kexec_text_end = .); + + .data BLOCK(4K) : AT ( ADDR(.data) - 0xC0000000 ) + { *(.data) } - .rodata BLOCK(4K) : AT ( ADDR(.rodata) - 0xC0000000 ) { + .rodata BLOCK(4K) : AT ( ADDR(.rodata) - 0xC0000000 ) + { *(.rodata) } - .kpg BLOCK(4K) : AT ( ADDR(.kpg) - 0xC0000000 ) { + .kpg BLOCK(4K) : AT ( ADDR(.kpg) - 0xC0000000 ) + { *(.kpg) } @@ -58,7 +79,8 @@ SECTIONS { /* for generated array, we align to address line size */ - .lga BLOCK(4K) : AT ( ADDR(.lga) - 0xC0000000 ) { + .lga BLOCK(4K) : AT ( ADDR(.lga) - 0xC0000000 ) + { PROVIDE(__lga_twiplugin_inits_start = .); KEEP(*(.lga.twiplugin_inits)); @@ -80,21 +102,31 @@ SECTIONS { . = ALIGN(8); - PROVIDE(__lga_dev_ld_early_start = .); + PROVIDE(__lga_dev_ld_kboot_start = .); - KEEP(*(.lga.devdefs.ld_early)); + KEEP(*(.lga.devdefs.ld_kboot)); - PROVIDE(__lga_dev_ld_early_end = .); + PROVIDE(__lga_dev_ld_kboot_end = .); /* ---- */ . = ALIGN(8); - PROVIDE(__lga_dev_ld_aftertimer_start = .); + PROVIDE(__lga_dev_ld_sysconf_start = .); - KEEP(*(.lga.devdefs.ld_aftertimer)); + KEEP(*(.lga.devdefs.ld_sysconf)); - PROVIDE(__lga_dev_ld_aftertimer_end = .); + PROVIDE(__lga_dev_ld_sysconf_end = .); + + /* ---- */ + + . = ALIGN(8); + + PROVIDE(__lga_dev_ld_timedev_start = .); + + KEEP(*(.lga.devdefs.ld_timedev)); + + PROVIDE(__lga_dev_ld_timedev_end = .); /* ---- */ @@ -116,11 +148,56 @@ SECTIONS { PROVIDE(__lga_fs_end = .); + /* ---- */ + + . = ALIGN(8); + + PROVIDE(__lga_lunainit_on_earlyboot_start = .); + + KEEP(*(.lga.lunainit.c_earlyboot)); + + PROVIDE(__lga_lunainit_on_earlyboot_end = .); + + /* ---- */ + + . = ALIGN(8); + + PROVIDE(__lga_lunainit_on_boot_start = .); + + KEEP(*(.lga.lunainit.c_boot)); + + PROVIDE(__lga_lunainit_on_boot_end = .); + + /* ---- */ + + . = ALIGN(8); + + PROVIDE(__lga_lunainit_on_postboot_start = .); + + KEEP(*(.lga.lunainit.c_postboot)); + + PROVIDE(__lga_lunainit_on_postboot_end = .); + + } + + .ksymtable BLOCK(4K) : AT ( ADDR(.ksymtable) - 0xC0000000 ) + { + *(.ksymtable) } - .bss BLOCK(4K) : AT ( ADDR(.bss) - 0xC0000000 ) { + .bss BLOCK(4K) : AT ( ADDR(.bss) - 0xC0000000 ) + { *(.bss) } + .bss.kstack BLOCK(4K) : AT ( ADDR(.bss.kstack) - 0xC0000000) + { + PROVIDE(__bsskstack_start = .); + + *(.bss.kstack) + + PROVIDE(__bsskstack_end = .); + } + __kexec_end = ALIGN(4K); } \ No newline at end of file