-
Notifications
You must be signed in to change notification settings - Fork 2
/
bin.lds
98 lines (90 loc) · 2.96 KB
/
bin.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
/* Adapted from kvm-unit-tests' flat.lds script
* See http://www.linux-kvm.org/page/KVM-unit-tests for more details
*/
SECTIONS
{
/* place all the shared data in the next 1G region
* this is data that will be mapped and
* note that 0x4000000 is the bootloader itself which does not actually need to be mapped
* (since it is used before we install the pgtable) so we can consider 0x40000000 -> ... as one big
* code segment
*/
.text 0x00000000 : {
PROVIDE(__ld_begin_text = .);
/* ensure boot section from cpu_entry.S appears first */
*(.init.boot)
*(.init) *(.text) *(.text.*)
. = ALIGN(4k);
*(.exc_table)
. = ALIGN(4k);
PROVIDE(__ld_end_text = .);
}
/* relocations must be exactly marked
* so don't align any more than needed
*/
. = ALIGN(4k);
.rela.dyn : {
PROVIDE(__ld_begin_reloc = .);
*(.rela.dyn)
/* PROVIDE(__ld_end_reloc = .); */
}
/* TODO: this seems to need to go after the .rela.dyn section
* but it should be fine to put it after the *(.rela.dyn) above
* but it doesn't work ?
*/
PROVIDE(__ld_end_reloc = .);
. = ALIGN(4k);
PROVIDE(__ld_begin_data = .);
.dynsym : { *(.dynsym) }
.dynstr : { *(.dynstr) }
.hash : { *(.hash) }
.gnu.hash : { *(.gnu.hash) }
.got : { *(.got) *(.got.plt) }
.eh_frame : { *(.eh_frame) }
.rodata : { *(.rodata*) }
.data : { *(.data) }
.bss : {
PROVIDE(__ld_begin_bss = .);
*(.bss)
PROVIDE(__ld_end_bss = .);
}
. = ALIGN(4k);
PROVIDE(__ld_end_data = .);
/DISCARD/ : {
*(.note*)
*(.interp)
*(.comment)
*(.dynamic)
}
PROVIDE(__ld_end_sections = .);
/* from default linker script: `aarch64-none-elf-ld --verbose`
* DWARF debug sections.
* Symbols in the DWARF debugging sections are relative to the beginning
* of the section so we place them at 0
*/
/* DWARF 1 */
.debug 0 : { *(.debug) }
.line 0 : { *(.line) }
/* GNU DWARF 1 extensions */
.debug_srcinfo 0 : { *(.debug_srcinfo) }
.debug_sfnames 0 : { *(.debug_sfnames) }
/* DWARF 1.1 and DWARF 2 */
.debug_aranges 0 : { *(.debug_aranges) }
.debug_pubnames 0 : { *(.debug_pubnames) }
/* DWARF 2 */
.debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
.debug_abbrev 0 : { *(.debug_abbrev) }
.debug_line 0 : { *(.debug_line .debug_line.* .debug_line_end ) }
.debug_frame 0 : { *(.debug_frame) }
.debug_str 0 : { *(.debug_str) }
.debug_loc 0 : { *(.debug_loc) }
.debug_macinfo 0 : { *(.debug_macinfo) }
/* DWARF 3 */
.debug_pubtypes 0 : { *(.debug_pubtypes) }
.debug_ranges 0 : { *(.debug_ranges) }
/* DWARF Extension. */
.debug_macro 0 : { *(.debug_macro) }
.debug_addr 0 : { *(.debug_addr) }
/* end debug sections */
}
ENTRY(_start)