binutils-gdb/ld/testsuite
Xi Ruoyao ae2e4d4035 LoongArch: Fix R_LARCH_IRELATIVE insertion after elf_link_sort_relocs
loongarch_elf_finish_dynamic_symbol is called after elf_link_sort_relocs
if -z combreloc.  elf_link_sort_relocs redistributes the contents of
.rela.* sections those would be merged into .rela.dyn, so the slot for
R_LARCH_IRELATIVE may be out of relplt->contents now.

To make things worse, the boundary check

    dyn < dyn + relplt->size / sizeof (*dyn)

is obviously wrong ("x + 10 < x"? :), causing the issue undetected
during the linking process and the resulted executable suddenly crashes
at runtime.

The issue was found during an attempt to add static-pie support to the
toolchain.

Fix it by iterating through the inputs of .rela.dyn to find the slot.
2022-09-20 17:16:06 +08:00
..
config
ld-aarch64 ld: aarch64: Adjust TLS relaxation condition 2022-08-02 12:10:01 +01:00
ld-alpha
ld-arc
ld-arm readelf: print 0x0 as 0, and remove trailing spaces 2022-08-13 14:11:27 +09:30
ld-auto-import
ld-avr
ld-bootstrap
ld-bpf
ld-cdtest
ld-checks
ld-cris Trailing spaces in objdump -r header 2022-05-31 11:25:09 +09:30
ld-crx
ld-csky Trailing spaces in objdump -r header 2022-05-31 11:25:09 +09:30
ld-ctf Modify ld-ctf test files to suit ARM 2022-09-14 10:19:57 +09:30
ld-cygwin
ld-d10v
ld-discard
ld-dynamic
ld-elf elf: Reset alignment for each PT_LOAD segment 2022-08-03 13:34:01 -07:00
ld-elfcomm
ld-elfvers
ld-elfweak
ld-fastcall
ld-frv
ld-gc
ld-h8300
ld-i386 i386: Don't allow GOTOFF relocation against IFUNC symbol for PIC 2022-07-21 11:40:27 -07:00
ld-ia64
ld-ifunc i386: Don't allow GOTOFF relocation against IFUNC symbol for PIC 2022-07-21 11:40:27 -07:00
ld-libs
ld-linkonce
ld-loongarch-elf LoongArch: Fix R_LARCH_IRELATIVE insertion after elf_link_sort_relocs 2022-09-20 17:16:06 +08:00
ld-m68hc11
ld-m68k
ld-mep
ld-metag Trailing spaces in objdump -r header 2022-05-31 11:25:09 +09:30
ld-mips-elf BFD_RELOC_MIPS_16 2022-06-14 10:03:55 +09:30
ld-misc
ld-mmix
ld-mn10300 Trailing spaces in objdump -r header 2022-05-31 11:25:09 +09:30
ld-msp430-elf
ld-nds32
ld-nios2 Trailing spaces in objdump -r header 2022-05-31 11:25:09 +09:30
ld-or1k
ld-pdp11
ld-pe Re: Missing linking test case for pe dll using a def file 2022-08-21 07:53:12 +09:30
ld-pie
ld-plugin
ld-powerpc PowerPC32 ld test fails with --enable-targets=all 2022-07-26 22:14:20 +09:30
ld-pru Trailing spaces in objdump -r header 2022-05-31 11:25:09 +09:30
ld-riscv-elf RISC-V: PR28509, the default visibility symbol cannot be referenced by R_RISCV_JAL. 2022-09-12 11:31:41 +08:00
ld-s12z
ld-s390
ld-scripts
ld-selective
ld-sh PR10372, SH: ld test with sim/sh/run fails always 2022-08-25 13:33:39 +09:30
ld-shared
ld-size Trailing spaces in objdump -r header 2022-05-31 11:25:09 +09:30
ld-sparc
ld-spu
ld-srec
ld-tic6x Trailing spaces in objdump -r header 2022-05-31 11:25:09 +09:30
ld-tilegx
ld-tilepro
ld-undefined
ld-unique
ld-v850
ld-vax-elf
ld-visium
ld-vsb
ld-vxworks
ld-x86-64 BFD library: Use entry 0 in directory and filename tables of DWARF-5 debug info. 2022-08-30 16:01:20 +01:00
ld-xstormy16
ld-xtensa xtensa: bfd: fix TLS relocations generated for PIE 2022-09-02 09:54:49 -07:00
ld-z8k
ld-z80
lib
ChangeLog-2004
ChangeLog-2005
ChangeLog-2006
ChangeLog-2007
ChangeLog-2008
ChangeLog-2009
ChangeLog-2010
ChangeLog-2011
ChangeLog-2012
ChangeLog-2013
ChangeLog-2014
ChangeLog-2015
ChangeLog-9303