summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPalmer Dabbelt <palmer@dabbelt.com>2017-06-09 23:15:52 -0700
committerPalmer Dabbelt <palmer@dabbelt.com>2017-06-09 23:23:02 -0700
commit185e62e71e5db52e76f3c7e57e4de15d5688cb2e (patch)
treea33662a777351cc442bab5c7e3dd2b28ef8e4a0e
parent33a52ac745ea72dd3732859e6a6f1ec16a3bc3c8 (diff)
Don't use .section\nALIGN, reorder sdata and srodata
I'm hoping this will make everything more likely to align. We can't use the other mechanism because our loader is lazy and assumes all the sections are contiguous.
-rw-r--r--bsp/env/coreplexip-e31-arty/link.lds16
-rw-r--r--bsp/env/freedom-e300-hifive1/link.lds16
2 files changed, 14 insertions, 18 deletions
diff --git a/bsp/env/coreplexip-e31-arty/link.lds b/bsp/env/coreplexip-e31-arty/link.lds
index 4e41577..739bc48 100644
--- a/bsp/env/coreplexip-e31-arty/link.lds
+++ b/bsp/env/coreplexip-e31-arty/link.lds
@@ -122,10 +122,15 @@ SECTIONS
*(.gnu.linkonce.d.*)
} >ram AT>flash :ram_init
- .srodata :
- ALIGN(8)
+ .sdata :
{
PROVIDE( _gp = . + 0x800 );
+ *(.sdata .sdata.*)
+ *(.gnu.linkonce.s.*)
+ } >ram AT>flash :ram_init
+
+ .srodata :
+ {
*(.srodata.cst16)
*(.srodata.cst8)
*(.srodata.cst4)
@@ -133,13 +138,6 @@ SECTIONS
*(.srodata .srodata.*)
} >ram AT>flash :ram_init
- .sdata :
- ALIGN(8)
- {
- *(.sdata .sdata.*)
- *(.gnu.linkonce.s.*)
- } >ram AT>flash :ram_init
-
. = ALIGN(4);
PROVIDE( _edata = . );
PROVIDE( edata = . );
diff --git a/bsp/env/freedom-e300-hifive1/link.lds b/bsp/env/freedom-e300-hifive1/link.lds
index 08b196f..bc4488d 100644
--- a/bsp/env/freedom-e300-hifive1/link.lds
+++ b/bsp/env/freedom-e300-hifive1/link.lds
@@ -122,10 +122,15 @@ SECTIONS
*(.gnu.linkonce.d.*)
} >ram AT>flash :ram_init
- .srodata :
- ALIGN(8)
+ .sdata :
{
PROVIDE( _gp = . + 0x800 );
+ *(.sdata .sdata.*)
+ *(.gnu.linkonce.s.*)
+ } >ram AT>flash :ram_init
+
+ .srodata :
+ {
*(.srodata.cst16)
*(.srodata.cst8)
*(.srodata.cst4)
@@ -133,13 +138,6 @@ SECTIONS
*(.srodata .srodata.*)
} >ram AT>flash :ram_init
- .sdata :
- ALIGN(8)
- {
- *(.sdata .sdata.*)
- *(.gnu.linkonce.s.*)
- } >ram AT>flash :ram_init
-
. = ALIGN(4);
PROVIDE( _edata = . );
PROVIDE( edata = . );