lfn
serial
ticket/834-toolchain-update
topic/msim-upgrade
topic/simplify-dev-export
Last change
on this file since 4484c16 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:
1.0 KB
|
Line | |
---|
1 | /*
|
---|
2 | * ARM linker script
|
---|
3 | *
|
---|
4 | * kernel text
|
---|
5 | * kernel data
|
---|
6 | *
|
---|
7 | */
|
---|
8 |
|
---|
9 | #ifdef MACHINE_gta02
|
---|
10 | #define KERNEL_LOAD_ADDRESS 0xb0a08000
|
---|
11 | #elif defined MACHINE_beagleboardxm
|
---|
12 | #define KERNEL_LOAD_ADDRESS 0x80a00000
|
---|
13 | #elif defined MACHINE_beaglebone
|
---|
14 | #define KERNEL_LOAD_ADDRESS 0x80a00000
|
---|
15 | #elif defined MACHINE_raspberrypi
|
---|
16 | #define KERNEL_LOAD_ADDRESS 0x80a08000
|
---|
17 | #else
|
---|
18 | #define KERNEL_LOAD_ADDRESS 0x80a00000
|
---|
19 | #endif
|
---|
20 |
|
---|
21 | OUTPUT_ARCH(arm)
|
---|
22 | ENTRY(kernel_image_start)
|
---|
23 |
|
---|
24 | SECTIONS {
|
---|
25 | . = KERNEL_LOAD_ADDRESS;
|
---|
26 | kernel_load_address = .;
|
---|
27 | . = . + SIZEOF_HEADERS;
|
---|
28 | .text : {
|
---|
29 | ktext_start = .;
|
---|
30 | *(.text);
|
---|
31 | ktext_end = .;
|
---|
32 | }
|
---|
33 | .data : {
|
---|
34 | kdata_start = .;
|
---|
35 | *(.data); /* initialized data */
|
---|
36 | *(.bss); /* uninitialized static variables */
|
---|
37 | *(COMMON); /* global variables */
|
---|
38 |
|
---|
39 | *(.rodata*);
|
---|
40 | *(.sdata);
|
---|
41 | *(.reginfo);
|
---|
42 | . = ALIGN(8);
|
---|
43 | symbol_table = .;
|
---|
44 | *(symtab.*);
|
---|
45 | }
|
---|
46 | .sbss : {
|
---|
47 | *(.sbss);
|
---|
48 | *(.scommon);
|
---|
49 | }
|
---|
50 |
|
---|
51 | kdata_end = .;
|
---|
52 |
|
---|
53 | /DISCARD/ : {
|
---|
54 | *(.mdebug*);
|
---|
55 | *(.pdr);
|
---|
56 | *(.comment);
|
---|
57 | *(.note);
|
---|
58 | }
|
---|
59 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.