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 Revert "MIPS: fix some ld testcases with compiler" 2023-06-15 04:45:03 +01:00
ld-aarch64 sframe: bfd: gas: ld: format bump to SFrame version 2 2023-06-29 16:31:58 -07:00
ld-alpha
ld-arc
ld-arm
ld-auto-import
ld-avr
ld-bootstrap ld: Add -z nosectionheader test to bootstrap.exp 2023-06-29 10:29:47 -07:00
ld-bpf Revert "2.41 Release sources" 2023-08-02 12:06:23 +01:00
ld-cdtest
ld-checks
ld-cris PR10957, Missing option to really print section+offset 2023-07-17 08:17:44 +09:30
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 Add extra linker warning message about discrepancies between normal and common symbols. 2023-06-07 14:30:13 +01:00
ld-elfvers Revert "MIPS: fix some ld testcases with compiler" 2023-06-15 04:45:03 +01:00
ld-elfweak
ld-fastcall
ld-frv
ld-gc Revert "MIPS: fix some ld testcases with compiler" 2023-06-15 04:45:03 +01:00
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 PR10957, Missing option to really print section+offset 2023-07-17 08:17:44 +09:30
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 Re: Add some expected failures for bfin linker tests 2023-06-15 11:45:03 +09:30
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 PR10957, Missing option to really print section+offset 2023-07-17 08:17:44 +09:30
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 Revert "MIPS: fix some ld testcases with compiler" 2023-06-15 04:45:03 +01:00
ld-sframe
ld-sh
ld-shared Revert "MIPS: fix some ld testcases with compiler" 2023-06-15 04:45:03 +01:00
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