Browse Source

ld: pru: Fix resource_table output section alignment

My commit 261980de18 added alignment for the resource table symbol.
But it is wrong.  The Linux remoteproc driver loads and interprets the
contents of the .resource_table ELF section, not of a table symbol.

Without this patch, if the linker happens to output padding for symbol
alignment, then the resource table contents as viewed by the kernel
loader would "shift" and look corrupted.

ld/ChangeLog:

	* scripttempl/pru.sc  (.resource_table): Align the output
	section, not the first symbol.

Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
binutils-2_38-branch
Dimitar Dimitrov 5 years ago
parent
commit
5109a7bd9b
  1. 5
      ld/ChangeLog
  2. 7
      ld/scripttempl/pru.sc

5
ld/ChangeLog

@ -1,3 +1,8 @@
2021-09-30 Dimitar Dimitrov <dimitar@dinux.eu>
* scripttempl/pru.sc (.resource_table): Align the output
section, not the first symbol.
2021-09-27 Nick Alcock <nick.alcock@oracle.com> 2021-09-27 Nick Alcock <nick.alcock@oracle.com>
* configure: Regenerate. * configure: Regenerate.

7
ld/scripttempl/pru.sc

@ -151,11 +151,10 @@ SECTIONS
${RELOCATING+ PROVIDE (_data_end = .) ; } ${RELOCATING+ PROVIDE (_data_end = .) ; }
} ${RELOCATING+ > dmem } } ${RELOCATING+ > dmem }
.resource_table ${RELOCATING-0} : /* Linux remoteproc loader requires the resource_table section
start address to be aligned to 8 bytes. */
.resource_table ${RELOCATING-0} ${RELOCATING+ ALIGN(8)} :
{ {
/* Linux remoteproc loader requires the resource table address
to be aligned to 8 bytes. */
${RELOCATING+. = ALIGN(8);}
KEEP (*(.resource_table)) KEEP (*(.resource_table))
} ${RELOCATING+ > dmem} } ${RELOCATING+ > dmem}

Loading…
Cancel
Save