2018-08-30 12:17:20 -07:00
|
|
|
/* Simple linker script for the JOS kernel.
|
|
|
|
See the GNU ld 'info' manual ("info ld") to learn the syntax. */
|
|
|
|
|
|
|
|
OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
|
|
|
|
OUTPUT_ARCH(i386)
|
|
|
|
ENTRY(_start)
|
|
|
|
|
|
|
|
SECTIONS
|
|
|
|
{
|
|
|
|
/* Link the kernel at this address: "." means the current address */
|
|
|
|
. = 0xF0100000;
|
|
|
|
|
|
|
|
/* AT(...) gives the load address of this section, which tells
|
|
|
|
the boot loader where to load the kernel in physical memory */
|
|
|
|
.text : AT(0x100000) {
|
|
|
|
*(.text .stub .text.* .gnu.linkonce.t.*)
|
|
|
|
}
|
|
|
|
|
|
|
|
PROVIDE(etext = .); /* Define the 'etext' symbol to this value */
|
|
|
|
|
|
|
|
.rodata : {
|
|
|
|
*(.rodata .rodata.* .gnu.linkonce.r.*)
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Include debugging information in kernel memory */
|
|
|
|
.stab : {
|
|
|
|
PROVIDE(__STAB_BEGIN__ = .);
|
|
|
|
*(.stab);
|
|
|
|
PROVIDE(__STAB_END__ = .);
|
|
|
|
BYTE(0) /* Force the linker to allocate space
|
|
|
|
for this section */
|
|
|
|
}
|
|
|
|
|
|
|
|
.stabstr : {
|
|
|
|
PROVIDE(__STABSTR_BEGIN__ = .);
|
|
|
|
*(.stabstr);
|
|
|
|
PROVIDE(__STABSTR_END__ = .);
|
|
|
|
BYTE(0) /* Force the linker to allocate space
|
|
|
|
for this section */
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Adjust the address for the data segment to the next page */
|
|
|
|
. = ALIGN(0x1000);
|
|
|
|
|
|
|
|
/* The data segment */
|
|
|
|
.data : {
|
2018-10-06 06:52:47 -07:00
|
|
|
*(.data .data.*)
|
2018-08-30 12:17:20 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
.bss : {
|
2018-09-04 11:10:42 -07:00
|
|
|
PROVIDE(edata = .);
|
2018-10-06 06:52:47 -07:00
|
|
|
*(.dynbss)
|
|
|
|
*(.bss .bss.*)
|
|
|
|
*(COMMON)
|
2018-09-04 11:10:42 -07:00
|
|
|
PROVIDE(end = .);
|
2018-08-30 12:17:20 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/DISCARD/ : {
|
2018-10-06 06:52:47 -07:00
|
|
|
*(.eh_frame .note.GNU-stack .comment .note)
|
2018-08-30 12:17:20 -07:00
|
|
|
}
|
|
|
|
}
|