binutils-gdb/ld/scripttempl
John David Anglin a82e3815df hppa: Implement PA 2.0 symbolic relocations for long displacements
The PA 2.0 architecture introduced several new load and store
instructions with long displacements.  These include floating
point loads and stores for word mode, and integer and floating
point loads and stores for double words.  Currently, ld does
not correctly support symbolic relocations for these instructions.

If these are used, ld applies the standard R_PARISC_DPREL14R
relocation and corrupts the instruction.  This change uses
bfd_hppa_insn2fmt to determine the correct relocation format.

We need to check the computed displacement as the immediate
value used in these instruction must be a multiple of 4 or 8
depending on whether the access is for a word or double word.

A misaligned offset can potentially occur if the symbol is not
properly aligned or if $global$ (the global pointer) is not
double word aligned.  $global$ is provided as a .data section
start symbol.  The patch adjusts elf.sc and hppalinux.sh to
align .data to a 8-byte boundary in non-shared and non-pie
links.

2024-04-01  John David Anglin  <danglin@gcc.gnu.org>

	PR ld/31503

bfd/ChangeLog:

	* elf32-hppa.c (final_link_relocate): Output

ld/ChangeLog:

	* emulparams/hppalinux.sh (DATA_SECTION_ALIGNMENT): Define.
	* scripttempl/elf.sc: Align .data section to DATA_SECTION_ALIGNMENT
	when relocating.
2024-04-01 23:00:52 +00:00
..
aix.sc Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
alpha.sc Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
alphavms.sc Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
aout.sc Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
arclinux.sc Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
avr.sc PR31124: Addendum: Remove PROVIDE of __flmap_init_label, __flmap. 2024-01-31 11:23:20 +00:00
crisaout.sc Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
dlx.sc Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
DWARF.sc Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
elf32cr16.sc Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
elf32crx.sc Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
elf32msp430.sc Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
elf64bpf.sc Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
elf64hppa.sc Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
elf.sc hppa: Implement PA 2.0 symbolic relocations for long displacements 2024-04-01 23:00:52 +00:00
elfarc.sc Revert "arc: Add new linker emulation and scripts for ARCv3 ISA." 2023-09-25 17:02:55 +03:00
elfarcv2.sc arc: Update elfarcv2 script template 2023-08-31 08:13:53 +03:00
elfd10v.sc Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
elfd30v.sc Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
elfm9s12z.sc Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
elfm68hc11.sc Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
elfm68hc12.sc Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
elfmicroblaze.sc Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
elfxgate.sc Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
elfxtensa.sc Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
epiphany_4x4.sc Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ft32.sc Re: Add --enable-linker-verssion 2023-03-16 17:30:28 +10:30
hppaelf.sc Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
i386beos.sc Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
i386go32.sc Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
i386msdos.sc Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ia64vms.sc Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ip2k.sc Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
iq2000.sc Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
mcorepe.sc Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
mep.sc Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
mips.sc Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
misc-sections.sc Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
mmo.sc Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
moxie.sc Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
nds32elf.sc Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
pdp11.sc Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
pe.sc Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
pep.sc Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
pj.sc Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
pru.sc ld: pru: Place exception-handling sections correctly 2023-05-04 12:41:55 +01:00
README Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
sh.sc Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
tic4xcoff.sc Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
tic30coff.sc Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
tic54xcoff.sc Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
v850_rh850.sc Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
v850.sc Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
vanilla.sc Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
visium.sc Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
xstormy16.sc Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
z80.sc Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
z8000.sc Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30

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-2024 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.