Browse Source

Fix _stext override issue

Vadim Kaushan 5 years ago
parent
commit
44c86e244d
1 changed files with 6 additions and 12 deletions
  1. 6 12
      riscv-rt/link.x

+ 6 - 12
riscv-rt/link.x

@@ -20,19 +20,13 @@ PROVIDE(__pre_init = default_pre_init);
 */
 PROVIDE(_mp_hook = default_mp_hook);
 
-PHDRS
-{
-    load PT_LOAD;
-    ram_load PT_LOAD;
-    virtual PT_NULL;
-}
-
 SECTIONS
 {
-  .text.dummy ORIGIN(REGION_TEXT) :
+  .text.dummy (NOLOAD) :
   {
     /* This section is intended to make _stext address work */
-  } > REGION_TEXT :virtual
+    . = _stext;
+  } > REGION_TEXT
 
   .text _stext :
   {
@@ -45,7 +39,7 @@ SECTIONS
     KEEP(*(.trap.rust));
 
     *(.text .text.*);
-  } > REGION_TEXT :load
+  } > REGION_TEXT
 
   .rodata : ALIGN(4)
   {
@@ -55,7 +49,7 @@ SECTIONS
        This is required by LLD to ensure the LMA of the following .data
        section will have the correct alignment. */
     . = ALIGN(4);
-  } > REGION_RODATA :load
+  } > REGION_RODATA
 
   .data : ALIGN(4)
   {
@@ -67,7 +61,7 @@ SECTIONS
     *(.data .data.*);
     . = ALIGN(4);
     _edata = .;
-  } > REGION_DATA AT > REGION_RODATA :ram_load
+  } > REGION_DATA AT > REGION_RODATA
 
   .bss (NOLOAD) :
   {