X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/92f6e64a6da763c45ff9f4ab5eafcab3d8766dcb..b60166b327a9108b07e3069fa6568a451529ffd9:/lunaix-os/link/linker.ld?ds=sidebyside diff --git a/lunaix-os/link/linker.ld b/lunaix-os/link/linker.ld index 3941b36..a409542 100644 --- a/lunaix-os/link/linker.ld +++ b/lunaix-os/link/linker.ld @@ -4,24 +4,29 @@ SECTIONS { . = 0x100000; /* 这里是我们的高半核初始化代码段和数据段 */ - .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); @@ -33,24 +38,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 +78,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)); @@ -158,7 +179,8 @@ SECTIONS { } - .bss BLOCK(4K) : AT ( ADDR(.bss) - 0xC0000000 ) { + .bss BLOCK(4K) : AT ( ADDR(.bss) - 0xC0000000 ) + { *(.bss) }