kern/kernel/kernel.ld

75 lines
1.2 KiB
Text
Raw Normal View History

2025-03-25 17:36:52 -04:00
/*
** Simple linker script for the 20245 kernel.
*/
OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
OUTPUT_ARCH(i386)
ENTRY(_start)
SECTIONS
{
/* Link the kernel at this address. */
/* Must match what is defined in vm.h! */
. = 0x80010000;
.text : AT(0x10000) {
*(.text .stub .text.* .gnu.linkonce.t.*)
}
/* standard symbols */
PROVIDE(etext = .);
PROVIDE(_etext = .);
/* put read-only data next */
.rodata : {
*(.rodata .rodata.* .gnu.linkonce.r.*)
}
2025-03-27 14:26:56 -04:00
/* Could put STABs here */
2025-03-31 12:41:04 -04:00
/*
2025-03-27 14:26:56 -04:00
.stab : {
PROVIDE(__STAB_BEGIN__ = .);
*(.stab);
PROVIDE(__STAB_END__ = .);
}
.stabstr : {
PROVIDE(__STABSTR_BEGIN__ = .);
*(.stabstr);
PROVIDE(__STABSTR_END__ = .);
}
2025-03-31 12:41:04 -04:00
*/
2025-03-27 14:26:56 -04:00
2025-03-25 17:36:52 -04:00
/* Align the data segment at the next page boundary */
2025-03-27 14:26:56 -04:00
. = ALIGN(0x1000);
2025-03-25 17:36:52 -04:00
PROVIDE(data = .);
PROVIDE(_data = .);
/* The data segment */
.data : {
2025-03-27 14:26:56 -04:00
*(.data .data.*)
2025-03-25 17:36:52 -04:00
}
PROVIDE(edata = .);
PROVIDE(_edata = .);
/* page-align the BSS */
. = ALIGN(0x1000);
PROVIDE(__bss_start = .);
.bss : {
2025-03-27 14:26:56 -04:00
*(.bss .bss.*)
*(COMMON)
2025-03-25 17:36:52 -04:00
}
PROVIDE(end = .);
PROVIDE(_end = .);
/DISCARD/ : {
2025-03-31 12:41:04 -04:00
*(.stab .stab_info .stabstr)
*(.eh_frame .eh_frame_hdr)
*(.note.GNU-stack .note.gnu.property .comment)
2025-03-25 17:36:52 -04:00
}
}