@@ -20,21 +20,15 @@ PROVIDE(__pre_init = default_pre_init);
20
20
*/
21
21
PROVIDE (_mp_hook = default_mp_hook );
22
22
23
- PHDRS
24
- {
25
- load PT_LOAD;
26
- ram_load PT_LOAD;
27
- virtual PT_NULL;
28
- }
29
-
30
23
SECTIONS
31
24
{
32
- .text.dummy ORIGIN (REGION_TEXT ) :
25
+ .text.dummy (NOLOAD ) :
33
26
{
34
27
/* This section is intended to make _stext address work */
35
- } > REGION_TEXT :virtual
28
+ . = _stext;
29
+ } > REGION_TEXT
36
30
37
- .text ALIGN ( _stext,4) :
31
+ .text _stext :
38
32
{
39
33
/* Put reset handler first in .text section so it ends up as the entry */
40
34
/* point of the program. */
@@ -45,48 +39,54 @@ SECTIONS
45
39
KEEP(*(.trap.rust));
46
40
47
41
*(.text .text.*);
48
- } > REGION_TEXT :load
42
+ } > REGION_TEXT
49
43
50
- .rodata ALIGN (4) :
44
+ .rodata : ALIGN (4)
51
45
{
52
46
*(.rodata .rodata.*);
53
- } > REGION_RODATA :load
54
47
55
- .data ALIGN (4) :
48
+ /* 4-byte align the end (VMA) of this section.
49
+ This is required by LLD to ensure the LMA of the following .data
50
+ section will have the correct alignment. */
51
+ . = ALIGN (4);
52
+ } > REGION_RODATA
53
+
54
+ .data : ALIGN (4)
56
55
{
57
56
_sidata = LOADADDR (.data);
58
57
_sdata = .;
59
58
/* Must be called __global_pointer$ for linker relaxations to work. */
60
59
PROVIDE (__global_pointer$ = . + 0x800);
60
+ *(.sdata .sdata.*);
61
61
*(.data .data.*);
62
62
. = ALIGN (4);
63
63
_edata = .;
64
- } > REGION_DATA AT > REGION_RODATA :ram_load
64
+ } > REGION_DATA AT > REGION_RODATA
65
65
66
- .bss :
66
+ .bss (NOLOAD) :
67
67
{
68
68
_sbss = .;
69
69
*(.sbss .sbss.* .bss .bss.*);
70
70
. = ALIGN (4);
71
71
_ebss = .;
72
- } > REGION_BSS :virtual
72
+ } > REGION_BSS
73
73
74
74
/* fictitious region that represents the memory available for the heap */
75
- .heap (INFO ) :
75
+ .heap (NOLOAD ) :
76
76
{
77
77
_sheap = .;
78
78
. += _heap_size;
79
79
. = ALIGN (4);
80
80
_eheap = .;
81
- } > REGION_HEAP :virtual
81
+ } > REGION_HEAP
82
82
83
83
/* fictitious region that represents the memory available for the stack */
84
- .stack (INFO ) :
84
+ .stack (NOLOAD ) :
85
85
{
86
86
_estack = .;
87
87
. = _stack_start;
88
88
_sstack = .;
89
- } > REGION_STACK :virtual
89
+ } > REGION_STACK
90
90
91
91
/* fake output .got section */
92
92
/* Dynamic relocations are unsupported. This section is only used to detect
0 commit comments