lfn
serial
ticket/834-toolchain-update
topic/msim-upgrade
topic/simplify-dev-export
Last change
on this file since c477c80 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:
928 bytes
|
Line | |
---|
1 | /** PPC32 linker script
|
---|
2 | *
|
---|
3 | * umapped section:
|
---|
4 | * kernel text
|
---|
5 | * kernel data
|
---|
6 | * mapped section:
|
---|
7 | * kernel text
|
---|
8 | * kernel data
|
---|
9 | *
|
---|
10 | */
|
---|
11 |
|
---|
12 | #include <arch/boot/boot.h>
|
---|
13 | #include <arch/mm/page.h>
|
---|
14 |
|
---|
15 | ENTRY(kernel_image_start)
|
---|
16 | OUTPUT_FORMAT("elf32-powerpc")
|
---|
17 | OUTPUT_ARCH("powerpc:common")
|
---|
18 |
|
---|
19 | SECTIONS {
|
---|
20 | kernel_load_address = PA2KA(0);
|
---|
21 |
|
---|
22 | .unmapped (SIZEOF_HEADERS): AT (SIZEOF_HEADERS) {
|
---|
23 | . = ALIGN(0x100);
|
---|
24 | *(K_UNMAPPED_TEXT_START);
|
---|
25 | }
|
---|
26 |
|
---|
27 | .mapped PA2KA(BOOT_OFFSET): AT (BOOT_OFFSET) {
|
---|
28 | ktext_start = .;
|
---|
29 | *(K_TEXT_START);
|
---|
30 | *(.text);
|
---|
31 | ktext_end = .;
|
---|
32 |
|
---|
33 | kdata_start = .;
|
---|
34 | *(K_DATA_START);
|
---|
35 | *(.rodata .rodata.*);
|
---|
36 | *(.data); /* initialized data */
|
---|
37 | *(.sdata);
|
---|
38 | *(.sdata2);
|
---|
39 | *(.sbss);
|
---|
40 | *(.bss); /* uninitialized static variables */
|
---|
41 | *(COMMON); /* global variables */
|
---|
42 |
|
---|
43 | . = ALIGN(8);
|
---|
44 | symbol_table = .;
|
---|
45 | *(symtab.*); /* Symbol table, must be LAST symbol!*/
|
---|
46 |
|
---|
47 | kdata_end = .;
|
---|
48 | }
|
---|
49 |
|
---|
50 | /DISCARD/ : {
|
---|
51 | *(*);
|
---|
52 | }
|
---|
53 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.