Browse Source

Fix .data alignment issue

Vadim Kaushan 5 years ago
parent
commit
03a3639de8
1 changed files with 5 additions and 0 deletions
  1. 5 0
      riscv-rt/link.x

+ 5 - 0
riscv-rt/link.x

@@ -50,6 +50,11 @@ SECTIONS
   .rodata : ALIGN(4)
   .rodata : ALIGN(4)
   {
   {
     *(.rodata .rodata.*);
     *(.rodata .rodata.*);
+
+    /* 4-byte align the end (VMA) of this section.
+       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 :load
 
 
   .data : ALIGN(4)
   .data : ALIGN(4)