Skip to content

Commit 44c86e2

Browse files
committed
Fix _stext override issue
1 parent 8f3ff84 commit 44c86e2

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

riscv-rt/link.x

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,13 @@ PROVIDE(__pre_init = default_pre_init);
2020
*/
2121
PROVIDE(_mp_hook = default_mp_hook);
2222

23-
PHDRS
24-
{
25-
load PT_LOAD;
26-
ram_load PT_LOAD;
27-
virtual PT_NULL;
28-
}
29-
3023
SECTIONS
3124
{
32-
.text.dummy ORIGIN(REGION_TEXT) :
25+
.text.dummy (NOLOAD) :
3326
{
3427
/* This section is intended to make _stext address work */
35-
} > REGION_TEXT :virtual
28+
. = _stext;
29+
} > REGION_TEXT
3630

3731
.text _stext :
3832
{
@@ -45,7 +39,7 @@ SECTIONS
4539
KEEP(*(.trap.rust));
4640

4741
*(.text .text.*);
48-
} > REGION_TEXT :load
42+
} > REGION_TEXT
4943

5044
.rodata : ALIGN(4)
5145
{
@@ -55,7 +49,7 @@ SECTIONS
5549
This is required by LLD to ensure the LMA of the following .data
5650
section will have the correct alignment. */
5751
. = ALIGN(4);
58-
} > REGION_RODATA :load
52+
} > REGION_RODATA
5953

6054
.data : ALIGN(4)
6155
{
@@ -67,7 +61,7 @@ SECTIONS
6761
*(.data .data.*);
6862
. = ALIGN(4);
6963
_edata = .;
70-
} > REGION_DATA AT > REGION_RODATA :ram_load
64+
} > REGION_DATA AT > REGION_RODATA
7165

7266
.bss (NOLOAD) :
7367
{

0 commit comments

Comments
 (0)