binutils-gdb/ld/scripttempl
Dimitar Dimitrov ba268471bf ld: pru: Add optional section alignments
The Texas Instruments SoCs with AARCH64 host processors have stricter
alignment requirements than ones with ARM32 host processors.  It's not
only the requirement for resource_table to be aligned to 8.  But also
any loadable segment size must be a multiple of 4 [1].

The current PRU default linker script may output a segment size not
aligned to 4, which would cause firmware load failure on AARCH64 hosts.

Fix this by using COMMONPAGESIZE and MAXPAGESIZE to signify respectively
the section memory size requirement and the resource table section's
start address alignment.  This would avoid penalizing the ARM32 hosts,
for which the default values (1 and 1) are sufficient.

For AARCH64 hosts, the alignments would be overwritten from GCC spec
files using the linker command line, e.g.:
  -z common-page-size=4 -z max-page-size=8

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/remoteproc/pru_rproc.c?h=v6.1#n555

ld/ChangeLog:

	* scripttempl/pru.sc (_data_end): Remove the alignment.
	(.data): Align output section size to COMMONPAGESIZE.
	(.resource_table): Ditto.

Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
2023-02-04 14:12:47 +02:00
..
aix.sc
alpha.sc
alphavms.sc
aout.sc
arclinux.sc
avr.sc
crisaout.sc
dlx.sc
DWARF.sc
elf32cr16.sc
elf32crx.sc
elf32msp430.sc
elf64bpf.sc
elf64hppa.sc
elf_chaos.sc
elf.sc
elfarc.sc
elfarcv2.sc
elfd10v.sc
elfd30v.sc
elfm9s12z.sc
elfm68hc11.sc
elfm68hc12.sc
elfmicroblaze.sc
elfxgate.sc
elfxtensa.sc
epiphany_4x4.sc
ft32.sc
hppaelf.sc
i386beos.sc
i386go32.sc
i386msdos.sc
ia64vms.sc
ip2k.sc
iq2000.sc
mcorepe.sc
mep.sc
mips.sc
mipsbsd.sc
mmo.sc
moxie.sc
nds32elf.sc
pdp11.sc
pe.sc
pep.sc
pj.sc
pru.sc
README
sh.sc
tic4xcoff.sc
tic30coff.sc
tic54xcoff.sc
v850_rh850.sc
v850.sc
vanilla.sc
visium.sc
xstormy16.sc
z80.sc
z8000.sc

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

The files in this directory are linker script templates.
genscripts.sh sets some shell variables, then sources
EMULATION.sc, to generate EMULATION.{x,xr,xu,xn,xbn} -- the script
files for default, -r, -Ur, -n, -N.

Copyright (C) 2012-2023 Free Software Foundation, Inc.

Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved.