binutils-gdb/ld/emultempl
Nelson Chu 73d931e560 RISC-V: PR31179, The SET/ADD/SUB fix breaks ABI compatibility with 2.41 objects
* Problematic fix commit,
2029e13917
RISC-V: Clarify the behaviors of SET/ADD/SUB relocations

* Bugzilla,
https://sourceware.org/bugzilla/show_bug.cgi?id=31179#c5

The addend of SUB_ULEB128 should be zero if using .uleb128, but we make it
non-zero by accident in assembler before.  This causes troubles by applying
the above commit, since the calculation is changed to support .reloc *SUB*
relocations with non-zero addend.

We encourage people to rebuild their stuff to get the non-zero addend of
SUB_ULEB128, but that might need some times, so report warnings to inform
people need to rebuild their stuff if --check-uleb128 is enabled.

Since the failed .reloc cases for ADD/SET/SUB/ULEB128 are rarely to use,
it may acceptable that stop supproting them until people rebuld their stuff,
maybe half-year or a year later.  Or maybe we should teach people that don't
write the .reloc R_RISCV_SUB* with non-zero constant, and then report
warnings/errors in assembler.

bfd/
	* elfnn-riscv.c (perform_relocation): Ignore the non-zero addend of
	R_RISCV_SUB_ULEB128.
	(riscv_elf_relocate_section): Report warnings to inform people need
	to rebuild their stuff if --check-uleb128 is enabled.  So that can
	get the right non-zero addend of R_RISCV_SUB_ULEB128.
	* elfxx-riscv.h (struct riscv_elf_params): Added bool check_uleb128.
ld/
	* NEWS: Updated.
	* emultempl/riscvelf.em: Added linker risc-v target options,
	--[no-]check-uleb128, to enable/disable checking if the addend of
	uleb128 is non-zero or not.  So that people will know they need to
	rebuild the objects with binutils 2.42 and up, to get the right zero
	addend of SUB_ULEB128 relocation, or they may get troubles if using
	.reloc.
	* ld/testsuite/ld-riscv-elf/ld-riscv-elf.exp: Updated.
	* ld/testsuite/ld-riscv-elf/pr31179*: New test cases.
2023-12-28 14:51:50 +08:00
..
aarch64elf.em Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
aix.em Re: ld STRINGIFY 2023-08-27 13:51:37 +09:30
alphaelf.em Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
arclinux.em Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
armelf.em Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
avrelf.em Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
beos.em ld STRINGIFY 2023-08-26 10:57:00 +09:30
bfin.em Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
cr16elf.em Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
crxelf.em Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
cskyelf.em Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
elf-generic.em Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
elf-x86.em Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
elf.em Add ability to change linker warning messages into errors when reporting executable stacks and/or executable segments. 2023-11-10 11:37:27 +00:00
emulation.em ld: Add a before_plugin_all_symbols_read hook 2022-03-09 18:23:43 -08:00
epiphanyelf_4x4.em Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
genelf.em Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
generic.em ld STRINGIFY 2023-08-26 10:57:00 +09:30
hppaelf.em Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
ia64elf.em Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
irix.em Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
kvxelf.em kvx: New port. 2023-08-16 14:22:54 +01:00
loongarchelf.em LoongArch: Modify link_info.relax_pass from 3 to 2 2023-11-17 16:38:55 +08:00
m68hc1xelf.em Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
m68kelf.em Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
metagelf.em Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
mipself.em Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
mmix-elfnmmo.em Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
mmixelf.em Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
mmo.em Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
msp430.em ld STRINGIFY 2023-08-26 10:57:00 +09:30
nds32elf.em Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
needrelax.em Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
netbsd.em Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
nios2elf.em Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
nto.em ld: replace wrong bfd_malloc in nto.em 2023-10-13 16:50:23 +02:00
pdp11.em ld STRINGIFY 2023-08-26 10:57:00 +09:30
pe.em ld STRINGIFY 2023-08-26 10:57:00 +09:30
pep.em ld STRINGIFY 2023-08-26 10:57:00 +09:30
ppc32elf.em Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
ppc64elf.em Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
pruelf.em Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
README Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
riscvelf.em RISC-V: PR31179, The SET/ADD/SUB fix breaks ABI compatibility with 2.41 objects 2023-12-28 14:51:50 +08:00
rxelf.em Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
rxlinux.em Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
s390.em Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
scoreelf.em Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
solaris2-x86.em Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
solaris2.em Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
spu_icache.o_c Regenerate spu overlay and icache manager files 2014-11-04 22:36:13 +10:30
spu_icache.S
spu_ovl.o_c Regenerate spu_ovl.o_c 2016-10-15 12:53:57 +10:30
spu_ovl.S Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
spuelf.em Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
stringify.sed ld STRINGIFY 2023-08-26 10:57:00 +09:30
tic6xdsbt.em Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
ticoff.em Revert "2.41 Release sources" 2023-08-02 12:06:23 +01:00
v850elf.em Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
vanilla.em Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
vms.em Revert "2.41 Release sources" 2023-08-02 12:06:23 +01:00
vxworks.em Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +10:30
xtensaelf.em ld: sprintf sanitizer null destination pointer 2023-08-03 21:19:54 +09:30
z80.em Update year range in copyright notice of binutils files 2023-01-01 21:50:11 +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 sourced by genscripts.sh, after
setting some variables to substitute in, to produce
C source files that contain jump tables for each emulation.

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.