diff --git a/sys/amd64/kernel.lds b/sys/amd64/kernel.lds index 717030b..5a71f5f 100644 --- a/sys/amd64/kernel.lds +++ b/sys/amd64/kernel.lds @@ -10,6 +10,30 @@ SECTIONS PROVIDE (__executable_start = SEGMENT_START("text-segment", 0xFFFF800000400000)); . = SEGMENT_START("text-segment", 0xFFFF800000400000) + SIZEOF_HEADERS; + .text : + { + *(.text .stub .text.* .gnu.linkonce.t.*) + *(.text.unlikely .text.*_unlikely .text.unlikely.*) + *(.text.exit .text.exit.*) + *(.text.startup .text.startup.*) + *(.text.hot .text.hot.*) + /* .gnu.warning sections are handled specially by elf32.em. */ + *(.gnu.warning) + } + .plt : { *(.plt) *(.iplt) } + .init : + { + KEEP (*(.init)) + } + .fini : + { + KEEP (*(.fini)) + } + PROVIDE (__etext = .); + PROVIDE (_etext = .); + PROVIDE (etext = .); + .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) } + .rodata1 : { *(.rodata1) } .interp : { *(.interp) } .note.gnu.build-id : { *(.note.gnu.build-id) } .hash : { *(.hash) } @@ -42,30 +66,6 @@ SECTIONS *(.rela.iplt) PROVIDE_HIDDEN (__rela_iplt_end = .); } - .init : - { - KEEP (*(.init)) - } - .plt : { *(.plt) *(.iplt) } - .text : - { - *(.text .stub .text.* .gnu.linkonce.t.*) - *(.text.unlikely .text.*_unlikely .text.unlikely.*) - *(.text.exit .text.exit.*) - *(.text.startup .text.startup.*) - *(.text.hot .text.hot.*) - /* .gnu.warning sections are handled specially by elf32.em. */ - *(.gnu.warning) - } - .fini : - { - KEEP (*(.fini)) - } - PROVIDE (__etext = .); - PROVIDE (_etext = .); - PROVIDE (etext = .); - .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) } - .rodata1 : { *(.rodata1) } .eh_frame_hdr : { *(.eh_frame_hdr) } .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) } .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table