• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/* -*- sh -*- */
2
3/*
4 * Linker script for EFI images
5 *
6 */
7
8ENTRY ( _start )
9
10SECTIONS {
11
12    /* The file starts at a virtual address of zero, and sections are
13     * contiguous.  Each section is aligned to at least _max_align,
14     * which defaults to 32.  Load addresses are equal to virtual
15     * addresses.
16     */
17
18    _max_align = 32;
19
20    /* Allow plenty of space for file headers */
21    . = 0x1000;
22
23    /*
24     * The text section
25     *
26     */
27
28    . = ALIGN ( _max_align );
29    .text : {
30	_text = .;
31	*(.text)
32	*(.text.*)
33	_etext = .;
34    }
35
36    /*
37     * The rodata section
38     *
39     */
40
41    . = ALIGN ( _max_align );
42    .rodata : {
43	_rodata = .;
44	*(.rodata)
45	*(.rodata.*)
46	_erodata = .;
47    }
48
49    /*
50     * The data section
51     *
52     */
53
54    . = ALIGN ( _max_align );
55    .data : {
56	_data = .;
57	*(.data)
58	*(.data.*)
59	*(SORT(.tbl.*))		/* Various tables.  See include/tables.h */
60	_edata = .;
61    }
62
63    /*
64     * The bss section
65     *
66     */
67
68    . = ALIGN ( _max_align );
69    .bss : {
70	_bss = .;
71	*(.bss)
72	*(.bss.*)
73	*(COMMON)
74	_ebss = .;
75    }
76
77    /*
78     * Weak symbols that need zero values if not otherwise defined
79     *
80     */
81
82    .weak 0x0 : {
83	_weak = .;
84	*(.weak)
85	_eweak = .;
86    }
87    _assert = ASSERT ( ( _weak == _eweak ), ".weak is non-zero length" );
88
89    /*
90     * Dispose of the comment and note sections to make the link map
91     * easier to read
92     *
93     */
94
95    /DISCARD/ : {
96	*(.comment)
97	*(.comment.*)
98	*(.note)
99	*(.note.*)
100	*(.eh_frame)
101	*(.eh_frame.*)
102	*(.rel)
103	*(.rel.*)
104	*(.discard)
105    }
106}
107