forked from TrenchBoot/secure-kernel-loader
-
Notifications
You must be signed in to change notification settings - Fork 0
/
link.lds
81 lines (72 loc) · 1.88 KB
/
link.lds
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
/*
* link.lds
*
* Linker script for the i386 SKL setup code
*
* Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
ENTRY(_entry)
SECTIONS
{
. = 0;
_start = .;
.text : {
*(.headers)
*(.text*)
}
. = ALIGN(64);
.rodata : {
*(SORT_BY_ALIGNMENT(.rodata*))
}
.data : {
*(SORT_BY_ALIGNMENT(.data*))
}
.bss : {
*(SORT_BY_ALIGNMENT(.bss*))
}
/*
* Due to the 64k total size constraint, we link all page size/aligned
* data together in a single section, to avoid wasting space in the
* individual data/bss sections.
*/
.page_data : {
*(.page_data)
}
.skl_info : {
*(.skl_info)
}
. = ALIGN(8);
/*
* Bootloader must pass non-constant data (e.g. address of zeropage). Keep
* it in separate section, outside of measured part of SL. This must be
* done in order to keep hashes constant, it also allows us to measure SL
* offline.
*/
.bootloader_data : {
*(.bootloader_data)
}
/* This section is expected to be empty. */
.got : {
*(.got)
}
_end = .;
/DISCARD/ : {
*(.eh_frame*)
}
}
ASSERT(_end <= 0x10000, "Landing Zone exceeds 64k");
ASSERT(SIZEOF(.got) == 0, ".got section not empty - non-hidden symbols used?");