source: mainline/kernel/arch/sparc64/_link.ld.in@ 2fff3c4

lfn serial ticket/834-toolchain-update topic/msim-upgrade topic/simplify-dev-export
Last change on this file since 2fff3c4 was cfdeedc, checked in by Jiří Zárevúcky <zarevucky.jiri@…>, 7 years ago

Keep kernel in ELF format

By keeping kernel in an ELF file (instead of converting it to
a flat binary), we can use the information it contains, like
symbol table and debug info.

We can also later implement more advanced functionality, like
loading kernel at multiple discontiguous blocks, or loading
a position-independent kernel at a randomized address.

Currently the functionality is quite restricted, to keep changes
to a minimum. Code in boot/generic/src/kernel.c validates that
the kernel image was built with the same addresses as the boot
loader uses, giving an extra level of sanity checking compared
to a flat binary.

  • Property mode set to 100644
File size: 809 bytes
Line 
1/** SPARC64 linker script
2 *
3 * It is ELF format, but its only section looks like this:
4 * kernel text
5 * kernel data
6 *
7 */
8
9#include <arch/boot/boot.h>
10
11ENTRY(kernel_image_start)
12
13SECTIONS {
14 kernel_load_address = VMA;
15
16 .image (VMA + SIZEOF_HEADERS): AT (LMA + SIZEOF_HEADERS) {
17 ktext_start = .;
18 *(K_TEXT_START)
19 *(.text .text.*);
20 ktext_end = .;
21
22 kdata_start = .;
23 *(K_DATA_START)
24 *(.rodata .rodata.*);
25 *(.data); /* initialized data */
26 *(.sdata);
27 *(.sdata2);
28 *(.sbss);
29 . = ALIGN(8);
30 *(.bss); /* uninitialized static variables */
31 *(COMMON); /* global variables */
32
33 . = ALIGN(8);
34 symbol_table = .;
35 *(symtab.*); /* Symbol table, must be LAST symbol!*/
36
37 kdata_end = .;
38 }
39
40 /DISCARD/ : {
41 *(*);
42 }
43
44}
Note: See TracBrowser for help on using the repository browser.