diff options
author | Albert Ou <albert@sifive.com> | 2016-12-07 15:06:20 -0800 |
---|---|---|
committer | Albert Ou <albert@sifive.com> | 2016-12-07 15:06:20 -0800 |
commit | 9ad15e8896557e9526a12e868801ed5e7d320298 (patch) | |
tree | bde92769a52112aa6e4f4246e247ddf735bdcb4d | |
parent | fb1d8d0dcc27f3460b3e18f6b62832f6568e0214 (diff) |
Place .init_array/.fini_array sections in flash instead of RAM
This appears to resolve the issue of .sdata being assigned an incorrect
LMA (ld warning "section `.sdata' can't be allocated in segment 1").
-rw-r--r-- | bsp/env/freedom-e300-hifive1/link.lds | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/bsp/env/freedom-e300-hifive1/link.lds b/bsp/env/freedom-e300-hifive1/link.lds index e25baf4..e224273 100644 --- a/bsp/env/freedom-e300-hifive1/link.lds +++ b/bsp/env/freedom-e300-hifive1/link.lds @@ -46,24 +46,14 @@ SECTIONS *(.gnu.linkonce.r.*) } >flash AT>flash :flash - .lalign : - { - . = ALIGN(4); - PROVIDE( _data_lma = . ); - } >flash AT>flash :flash - - .dalign : - { - . = ALIGN(4); - PROVIDE( _data = . ); - } >ram AT>flash :ram_init + . = ALIGN(4); .preinit_array : { PROVIDE_HIDDEN (__preinit_array_start = .); KEEP (*(.preinit_array)) PROVIDE_HIDDEN (__preinit_array_end = .); - } >ram AT>flash :ram_init + } >flash AT>flash :flash .init_array : { @@ -71,7 +61,7 @@ SECTIONS KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) PROVIDE_HIDDEN (__init_array_end = .); - } >ram AT>flash :ram_init + } >flash AT>flash :flash .fini_array : { @@ -79,7 +69,7 @@ SECTIONS KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*))) KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors)) PROVIDE_HIDDEN (__fini_array_end = .); - } >ram AT>flash :ram_init + } >flash AT>flash :flash .ctors : { @@ -101,7 +91,7 @@ SECTIONS KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) KEEP (*(SORT(.ctors.*))) KEEP (*(.ctors)) - } >ram AT>flash :ram_init + } >flash AT>flash :flash .dtors : { @@ -110,6 +100,18 @@ SECTIONS KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) KEEP (*(SORT(.dtors.*))) KEEP (*(.dtors)) + } >flash AT>flash :flash + + .lalign : + { + . = ALIGN(4); + PROVIDE( _data_lma = . ); + } >flash AT>flash :flash + + .dalign : + { + . = ALIGN(4); + PROVIDE( _data = . ); } >ram AT>flash :ram_init .data : |