2012-01-11 04:42:46 +04:00
|
|
|
/* vim: tabstop=4 shiftwidth=4 noexpandtab
|
2011-03-05 03:18:14 +03:00
|
|
|
* Kernel linker script for x86
|
|
|
|
*/
|
2011-01-18 02:04:12 +03:00
|
|
|
OUTPUT_FORMAT(elf32-i386)
|
2011-01-16 04:01:19 +03:00
|
|
|
ENTRY(start)
|
|
|
|
phys = 0x00100000;
|
|
|
|
SECTIONS
|
|
|
|
{
|
2011-03-05 03:18:14 +03:00
|
|
|
/*
|
|
|
|
* Actual code
|
|
|
|
*/
|
2011-01-16 04:01:19 +03:00
|
|
|
.text phys : AT(phys) {
|
|
|
|
code = .;
|
2014-03-10 06:36:28 +04:00
|
|
|
*(.multiboot*)
|
|
|
|
*(.text*)
|
|
|
|
*(.rodata*)
|
2011-01-16 04:01:19 +03:00
|
|
|
. = ALIGN(4096);
|
|
|
|
}
|
2011-03-05 03:18:14 +03:00
|
|
|
/*
|
|
|
|
* Kernel data
|
|
|
|
*/
|
2011-01-16 04:01:19 +03:00
|
|
|
.data : AT(phys + (data - code))
|
|
|
|
{
|
|
|
|
data = .;
|
2014-03-10 06:36:28 +04:00
|
|
|
*(.data*)
|
|
|
|
PROVIDE(kernel_symbols_start = .);
|
|
|
|
PROVIDE(kernel_symbols_end = .);
|
2011-01-16 04:01:19 +03:00
|
|
|
. = ALIGN(4096);
|
|
|
|
}
|
2011-03-05 03:18:14 +03:00
|
|
|
/*
|
|
|
|
* Statically defined, uninitialized values
|
|
|
|
*/
|
2011-01-16 04:01:19 +03:00
|
|
|
.bss : AT(phys + (bss - code))
|
|
|
|
{
|
|
|
|
bss = .;
|
2014-03-10 06:36:28 +04:00
|
|
|
*(.bss*)
|
2011-01-16 04:01:19 +03:00
|
|
|
. = ALIGN(4096);
|
|
|
|
}
|
2011-03-05 03:18:14 +03:00
|
|
|
/*
|
|
|
|
* End of kernel.
|
|
|
|
*/
|
2011-01-16 04:01:19 +03:00
|
|
|
end = .;
|
2011-03-05 03:18:14 +03:00
|
|
|
/*
|
|
|
|
* Get rid of unnecessary GCC bits.
|
|
|
|
*/
|
2011-01-18 02:04:12 +03:00
|
|
|
/DISCARD/ :
|
|
|
|
{
|
|
|
|
*(.comment)
|
|
|
|
*(.eh_frame)
|
|
|
|
*(.note.gnu.build-id)
|
|
|
|
}
|
2011-01-16 04:01:19 +03:00
|
|
|
}
|