-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathscript.lds
More file actions
87 lines (78 loc) · 1.69 KB
/
script.lds
File metadata and controls
87 lines (78 loc) · 1.69 KB
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
82
83
84
85
86
87
SECTIONS {
/* bzImage prefix */
.prefix : AT ( 0 ) {
_prefix = .;
*(.prefix)
*(.prefix.*)
_eprefix = .;
}
_prefix_len = ABSOLUTE ( _eprefix ) - ABSOLUTE ( _prefix );
/* Payload code executes at 0x20000 */
. = 0x20000;
_start = .;
/* Real-mode uninitialised data section */
.bss16 ( NOLOAD ) : {
_bss16 = .;
*(.stack16)
*(.stack16.*)
*(.bss16)
*(.bss16.*)
_ebss16 = .;
}
_bss16_len = ABSOLUTE ( _ebss16 ) - ABSOLUTE ( _bss16 );
/* Payload section */
.payload : AT ( _prefix_len ) {
_payload = .;
/* Portions that must be accessible in 16-bit modes */
*(.text16)
*(.text16.*)
*(.rodata16)
*(.rodata16.*)
*(.data16)
*(.data16.*)
/* Portions that need not be accessible in 16-bit modes */
*(.text)
*(.text.*)
*(.rodata)
*(.rodata.*)
*(.data)
*(.data.*)
_epayload = .;
}
_payload_len = ABSOLUTE ( _epayload ) - ABSOLUTE ( _payload );
/* bootmgr.exe hardcodes the address 0x30000 for use as a
* buffer accessible by real-mode code. We can't fit our
* .text, .data, and .bss below this region, so explicitly
* place the .bss higher in memory.
*/
_forbidden_start = 0x30000;
_forbidden_end = 0x40000;
/* Uninitialised data section */
.bss ( NOLOAD ) : {
_bss = .;
ASSERT ( ABSOLUTE ( . ) <= ABSOLUTE ( _forbidden_start ),
"Binary is too large" );
. = ABSOLUTE ( _forbidden_end );
*(.bss)
*(.bss.*)
*(COMMON)
*(.stack)
*(.stack.*)
_ebss = .;
}
_bss_len = ABSOLUTE ( _ebss ) - ABSOLUTE ( _bss );
_end = .;
/* Symbols required by i386.x86_64 objects */
__i386__start = _start;
__i386__end = _end;
/DISCARD/ : {
*(.comment)
*(.comment.*)
*(.note)
*(.note.*)
*(.eh_frame)
*(.eh_frame.*)
*(.rel)
*(.rel.*)
}
}