binutils-gdb/ld/testsuite
Stafford Horne 284a130902 or1k: Support large plt_relocs when generating plt entries
The current PLT generation code will generate invalid code when the PLT
relocation offset exceeds 64k.  This fixes the issue by detecting large
plt_reloc offsets and generare code sequences to create larger plt
relocations.

The "large" plt code needs 2 extra instructions to create 32-bit offsets.

bfd/ChangeLog:

	PR 27746
	* elf32-or1k.c (PLT_ENTRY_SIZE_LARGE, PLT_MAX_INSN_COUNT,
	OR1K_ADD, OR1K_ORI): New macros to help with plt creation.
	(elf_or1k_link_hash_table): New field plt_count.
	(elf_or1k_link_hash_entry): New field plt_index.
	(elf_or1k_plt_entry_size): New function.
	(or1k_write_plt_entry): Update to support variable size PLTs.
	(or1k_elf_finish_dynamic_sections): Use new or1k_write_plt_entry
	API.
	(or1k_elf_finish_dynamic_symbol): Update to write large PLTs
	when needed.
	(allocate_dynrelocs): Use elf_or1k_plt_entry_size to account for
	PLT size.

ld/ChangeLog:

	PR 27746
	testsuite/ld-or1k/or1k.exp (or1kplttests): Add tests for linking
	along with gotha() relocations.
	testsuite/ld-or1k/gotha1.dd: New file.
	testsuite/ld-or1k/gotha1.s: New file.
	testsuite/ld-or1k/gotha2.dd: New file.
	testsuite/ld-or1k/gotha2.s: New file
	testsuite/ld-or1k/pltlib.s (x): Define size to avoid link
	failure.
2021-05-06 20:51:25 +09:00
..
config
ld-aarch64 Adjust readelf's output so that section symbols without a name as shown with their section name. 2021-04-21 10:34:32 +01:00
ld-alpha Adjust readelf's output so that section symbols without a name as shown with their section name. 2021-04-21 10:34:32 +01:00
ld-arc
ld-arm Adjust readelf's output so that section symbols without a name as shown with their section name. 2021-04-21 10:34:32 +01:00
ld-auto-import
ld-avr
ld-bootstrap ld: Properly create a symbolic link to tmpdir/ldscripts 2021-04-23 12:36:45 -07:00
ld-bpf
ld-cdtest ld testsuite: change unresolved to unsupported/fail 2021-02-14 22:34:27 +10:30
ld-checks ld testsuite: change unresolved to unsupported/fail 2021-02-14 22:34:27 +10:30
ld-cris Adjust readelf's output so that section symbols without a name as shown with their section name. 2021-04-21 10:34:32 +01:00
ld-crx
ld-csky
ld-ctf libctf, ld: fix test results for upstream GCC 2021-05-06 09:31:31 +01:00
ld-cygwin
ld-d10v
ld-discard
ld-dynamic
ld-elf elf: Always append ".COUNT" to local symbols 2021-05-05 20:29:01 -07:00
ld-elfcomm ld testsuite: change unresolved to unsupported/fail 2021-02-14 22:34:27 +10:30
ld-elfvers ld testsuite: change unresolved to unsupported/fail 2021-02-14 22:34:27 +10:30
ld-elfvsb ld testsuite: change unresolved to unsupported/fail 2021-02-14 22:34:27 +10:30
ld-elfweak ld testsuite: change unresolved to unsupported/fail 2021-02-14 22:34:27 +10:30
ld-fastcall
ld-frv
ld-gc PE image base fallout 2021-03-12 10:41:34 +10:30
ld-h8300
ld-i386 x86: correct overflow checking for 16-bit PC-relative relocs 2021-04-26 10:41:35 +02:00
ld-ia64 Adjust readelf's output so that section symbols without a name as shown with their section name. 2021-04-21 10:34:32 +01:00
ld-ifunc ld testsuite: change unresolved to unsupported/fail 2021-02-14 22:34:27 +10:30
ld-libs
ld-linkonce
ld-m68hc11
ld-m68k
ld-mep
ld-metag
ld-mips-elf Adjust readelf's output so that section symbols without a name as shown with their section name. 2021-04-21 10:34:32 +01:00
ld-misc ld testsuite: change unresolved to unsupported/fail 2021-02-14 22:34:27 +10:30
ld-mmix Adjust readelf's output so that section symbols without a name as shown with their section name. 2021-04-21 10:34:32 +01:00
ld-mn10300 ld testsuite: change unresolved to unsupported/fail 2021-02-14 22:34:27 +10:30
ld-msp430-elf
ld-nds32
ld-nios2
ld-or1k or1k: Support large plt_relocs when generating plt entries 2021-05-06 20:51:25 +09:00
ld-pdp11
ld-pe x86-64/PE: adjust PR ld/26659 testcase for Cygwin 2021-04-22 10:55:07 +02:00
ld-pie
ld-plugin Add PR27441 testcase 2021-02-26 17:49:04 +10:30
ld-powerpc PowerPC undefweak testcase 2021-05-05 10:35:31 +09:30
ld-pru
ld-riscv-elf RISC-V: Improve multiple relax passes problem. 2021-03-11 17:27:13 +08:00
ld-s12z
ld-s390 Re: section symbols without a name 2021-05-03 12:42:03 +09:30
ld-scripts PE image base fallout 2021-03-12 10:41:34 +10:30
ld-selective ld testsuite: change unresolved to unsupported/fail 2021-02-14 22:34:27 +10:30
ld-sh ld testsuite: change unresolved to unsupported/fail 2021-02-14 22:34:27 +10:30
ld-shared ld testsuite: change unresolved to unsupported/fail 2021-02-14 22:34:27 +10:30
ld-size
ld-sparc Adjust readelf's output so that section symbols without a name as shown with their section name. 2021-04-21 10:34:32 +01:00
ld-spu
ld-srec PE image base fallout 2021-03-12 10:41:34 +10:30
ld-tic6x Adjust readelf's output so that section symbols without a name as shown with their section name. 2021-04-21 10:34:32 +01:00
ld-tilegx
ld-tilepro
ld-undefined bfd: don't silently wrap or truncate PE image section RVAs 2021-03-09 08:52:32 +01:00
ld-unique
ld-v850
ld-vax-elf
ld-visium
ld-vxworks
ld-x86-64 x86: correct overflow checking for 16-bit PC-relative relocs 2021-04-26 10:41:35 +02:00
ld-xc16x
ld-xstormy16
ld-xtensa
ld-z8k
ld-z80
lib libctf, ld: fix test results for upstream GCC 2021-05-06 09:31:31 +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