binutils-gdb/ld/testsuite
Peter Edwards fa4f2d46f9 x86: Fix DT_JMPREL/DT_PLTRELSZ when relocs share a section
If a linker script does not place the PLT relocations and "normal"
relocations in separate ELF sections, `ld` will currently output incorrect
values for DT_JMPREL and DT_PLTRELSZ - they cover the entire ELF section,
rather than just the PLT relocations

Don't ignore the extent of the BFD section - use the size of the srelplt
BFD section and its offset from the output_secttion

bfd/

	PR ld/30787
	* elfxx-x86.c (_bfd_x86_elf_finish_dynamic_sections): Use input
	section for DT_JMPREL and DT_PLTRELSZ.

ld/

	PR ld/30787
	* testsuite/ld-i386/i386.exp: Run pr30787.
	* testsuite/ld-x86-64/x86-64.exp: Likewise.
	* testsuite/ld-i386/pr30787.d: New file.
	* testsuite/ld-i386/pr30787.s: Likewise.
	* testsuite/ld-i386/pr30787.t: Likewise.
	* testsuite/ld-x86-64/pr30787.d: Likewise.
	* testsuite/ld-x86-64/pr30787.s: Likewise.
	* testsuite/ld-x86-64/pr30787.t: Likewise.
2023-08-23 09:10:16 -07:00
..
config
ld-aarch64
ld-alpha
ld-arc
ld-arm
ld-auto-import
ld-avr
ld-bootstrap
ld-bpf Revert "2.41 Release sources" 2023-08-02 12:06:23 +01:00
ld-cdtest
ld-checks
ld-cris
ld-crx
ld-csky
ld-ctf kvx: New port. 2023-08-16 14:22:54 +01:00
ld-cygwin
ld-d10v
ld-discard
ld-dynamic
ld-elf kvx: New port. 2023-08-16 14:22:54 +01:00
ld-elfcomm
ld-elfvers
ld-elfweak
ld-fastcall
ld-frv
ld-gc
ld-h8300
ld-i386 x86: Fix DT_JMPREL/DT_PLTRELSZ when relocs share a section 2023-08-23 09:10:16 -07:00
ld-ia64
ld-ifunc kvx: New port. 2023-08-16 14:22:54 +01:00
ld-kvx kvx: New port. 2023-08-16 14:22:54 +01:00
ld-libs
ld-linkonce
ld-loongarch-elf Revert "2.41 Release sources" 2023-08-02 12:06:23 +01:00
ld-m68hc11
ld-m68k
ld-mep
ld-metag
ld-mips-elf MIPS: Support `-gnuabi64' target triplet suffix for 64-bit Linux targets 2023-07-28 06:00:37 +01:00
ld-misc
ld-mmix
ld-mn10300
ld-msp430-elf
ld-nds32
ld-nios2
ld-or1k
ld-pdp11
ld-pe Revert "2.41 Release sources" 2023-08-02 12:06:23 +01:00
ld-pie
ld-plugin
ld-powerpc PR30697, ppc32 mix of local-dynamic and global-dynamic TLS 2023-08-04 17:59:01 +09:30
ld-pru
ld-riscv-elf
ld-s12z
ld-s390
ld-scripts kvx: New port. 2023-08-16 14:22:54 +01:00
ld-selective
ld-sframe
ld-sh
ld-shared
ld-size
ld-sparc
ld-spu
ld-srec
ld-tic6x
ld-tilegx
ld-tilepro
ld-undefined MIPS: Support `-gnuabi64' target triplet suffix for 64-bit Linux targets 2023-07-28 06:00:37 +01:00
ld-unique
ld-v850
ld-vax-elf
ld-visium
ld-vsb
ld-vxworks
ld-x86-64 x86: Fix DT_JMPREL/DT_PLTRELSZ when relocs share a section 2023-08-23 09:10:16 -07:00
ld-xstormy16
ld-xtensa
ld-z8k
ld-z80
lib ld: ld-lib.exp: log failed dump.out contents for debugging 2023-08-17 05:21:02 +01:00
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