From 73154541df060ecfda0386c1df6160ce8ff005c6 Mon Sep 17 00:00:00 2001 From: Jyotheeswar Reddy Date: Thu, 13 Aug 2015 18:48:06 +0530 Subject: [PATCH] PMUFW: lscript: Force generation of single loadable section MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bootgen currently has no support for multiple loadable sections in elfs. So a workaround is being implemented in PMUFW linker script. All sections are forced to be loadable and dummy bytes are added to fill the gaps. This change causes linker to throw a warning about bss section being made PROGBITS. Signed-off-by: Jyotheeswar Reddy Acked-by: Sören Brinkmann --- lib/sw_apps/zynqmp_pmufw/src/lscript.ld | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/lib/sw_apps/zynqmp_pmufw/src/lscript.ld b/lib/sw_apps/zynqmp_pmufw/src/lscript.ld index db241c43..2f584309 100644 --- a/lib/sw_apps/zynqmp_pmufw/src/lscript.ld +++ b/lib/sw_apps/zynqmp_pmufw/src/lscript.ld @@ -93,6 +93,7 @@ SECTIONS *(.gnu.linkonce.s2.*) . = ALIGN(8); __sdata2_end = .; + BYTE(0); } > PMU_RAM .sbss2 : { @@ -101,6 +102,7 @@ SECTIONS *(.sbss2.*) *(.gnu.linkonce.sb2.*) __sbss2_end = .; + BYTE(0); } > PMU_RAM .sdata : { @@ -110,9 +112,10 @@ SECTIONS *(.sdata.*) *(.gnu.linkonce.s.*) __sdata_end = .; + BYTE(0); } > PMU_RAM -.sbss (NOLOAD) : { +.sbss : { . = ALIGN(4); __sbss_start = .; *(.sbss) @@ -120,6 +123,7 @@ SECTIONS *(.gnu.linkonce.sb.*) . = ALIGN(8); __sbss_end = .; + BYTE(0); } > PMU_RAM .tdata : { @@ -138,7 +142,7 @@ SECTIONS __tbss_end = .; } > PMU_RAM -.bss (NOLOAD) : { +.bss : { . = ALIGN(4); __bss_start = .; *(.bss) @@ -147,6 +151,7 @@ SECTIONS *(COMMON) . = ALIGN(4); __bss_end = .; + BYTE(0); } > PMU_RAM _SDA_BASE_ = __sdata_start + ((__sbss_end - __sdata_start) / 2 ); @@ -154,15 +159,25 @@ _SDA_BASE_ = __sdata_start + ((__sbss_end - __sdata_start) / 2 ); _SDA2_BASE_ = __sdata2_start + ((__sbss2_end - __sdata2_start) / 2 ); /* Generate Stack definitions */ -.stack (NOLOAD) : { +.stack : { _stack_end = .; . += _STACK_SIZE; . = ALIGN(8); _stack = .; __stack = _stack; + BYTE(0); +} > PMU_RAM + +.filler : { + FILL(0); + _fill_start = .; + BYTE(0); + . += (_srv_tbl_start - _fill_start -1 ); + _fill_end = .; } > PMU_RAM .xpbr_serv_ext_tbl 0xffddf6e0: { + _srv_tbl_start = .; KEEP (*(.xpbr_serv_ext_tbl)) } > PMU_RAM