binutils-gdb/ld/testsuite
Alan Modra 7ba71655a4 PowerPC addpcis fix
This came up because I was looking at ld/tmpdir/addpcis.o and noticed
the odd addends on REL16DX_HA.  They ought to both be -4.  The error
crept in due REL16DX_HA howto being pc-relative (as indeed it should
be), and code at gas/write.c:1001 after this comment
	      /* Make it pc-relative.  If the back-end code has not
		 selected a pc-relative reloc, cancel the adjustment
		 we do later on all pc-relative relocs.  */
*not* cancelling the pc-relative adjustment.  So I've made a dummy
non-relative split reloc so that the generic code handles this, rather
than attempting to add hacks later in md_apply_fix which would not be
very robust.  Having the new internal reloc also makes it easy to
support

 addpcis rx,sym@ha

as an equivalent to

 addpcis rx,(sym-0f)@ha
0:

The patch also fixes overflow checking, which must test whether the
addi will overflow too since @l relocs don't have any overflow check.

Lastly, since I was poking at md_apply_fix, I arranged to have the
generic gas/write.c code emit errors for subtraction expressions where
we lack reloc support.

include/
	* elf/ppc64.h (R_PPC64_16DX_HA): New.  Expand fake reloc comment.
	* elf/ppc.h (R_PPC_16DX_HA): Likewise.
bfd/
	* reloc.c (BFD_RELOC_PPC_16DX_HA): New.
	* elf64-ppc.c (ppc64_elf_howto_raw <R_PPC64_16DX_HA>): New howto.
	(ppc64_elf_reloc_type_lookup): Translate new bfd reloc.
	(ppc64_elf_ha_reloc): Correct overflow test on REL16DX_HA.
	(ppc64_elf_relocate_section): Likewise.
	* elf32-ppc.c (ppc_elf_howto_raw <R_PPC_16DX_HA>): New howto.
	(ppc_elf_reloc_type_lookup): Translate new bfd reloc.
	(ppc_elf_check_relocs): Handle R_PPC_16DX_HA to pacify gcc.
	* libbfd.h: Regenerate.
	* bfd-in2.h: Regenerate.
gas/
	* config/tc-ppc.c (md_assemble): Use BFD_RELOC_PPC_16DX_HA for addpcis.
	(md_apply_fix): Remove fx_subsy check.  Move code converting to
	pcrel reloc earlier and handle BFD_RELOC_PPC_16DX_HA.  Remove code
	emiiting errors on seeing fx_pcrel set on unexpected relocs, as
	that is done now by the generic code via..
	* config/tc-ppc.h (TC_FORCE_RELOCATION_SUB_LOCAL): ..this. Define.
	(TC_VALIDATE_FIX_SUB): Define.
ld/
	* testsuite/ld-powerpc/addpcis.d: Define ext1 and ext2 at
	limits of addpcis range.
2017-02-28 11:59:47 +10:30
..
config Run more ld tests when not native 2017-01-02 23:48:08 +10:30
ld-aarch64 Fix AArch64 relocation handling in ILP32 mode. 2017-01-23 17:07:13 +00:00
ld-alpha
ld-arc [ARC] Add new linker emulation for nps 2017-01-10 10:55:13 +00:00
ld-arm
ld-auto-import
ld-avr
ld-bootstrap Run more ld tests when not native 2017-01-02 23:48:08 +10:30
ld-cdtest Run more ld tests when not native 2017-01-02 23:48:08 +10:30
ld-checks Run more ld tests when not native 2017-01-02 23:48:08 +10:30
ld-cris LD: vfinfo: Make clever formatters consistent WRT function name reporting 2017-02-15 13:41:51 +00:00
ld-crx
ld-cygwin Run more ld tests when not native 2017-01-02 23:48:08 +10:30
ld-d10v
ld-discard
ld-elf Testsuite fixes for hppa64-hpux 2017-02-25 19:13:34 +10:30
ld-elfcomm Run more ld tests when not native 2017-01-02 23:48:08 +10:30
ld-elfvers Add -rpath-link to various tests 2017-01-03 12:36:02 +10:30
ld-elfvsb Run more ld tests when not native 2017-01-02 23:48:08 +10:30
ld-elfweak Add -rpath-link to various tests 2017-01-03 12:36:02 +10:30
ld-fastcall Run more ld tests when not native 2017-01-02 23:48:08 +10:30
ld-frv
ld-gc Run more ld tests when not native 2017-01-02 23:48:08 +10:30
ld-h8300
ld-i386 i386: Allow "lea foo@GOT, %reg" in PIC 2017-02-15 11:39:48 -08:00
ld-ia64
ld-ifunc Fix compile time warning message in linker testsuite test. 2017-02-21 11:00:21 +00:00
ld-libs
ld-linkonce
ld-m68hc11
ld-m68k
ld-mep Run more ld tests when not native 2017-01-02 23:48:08 +10:30
ld-metag
ld-mips-elf MIPS/BFD: Also handle `jalr $0, $25' with R_MIPS_JALR 2017-02-28 00:22:36 +00:00
ld-misc
ld-mmix
ld-mn10300 Run more ld tests when not native 2017-01-02 23:48:08 +10:30
ld-nds32
ld-nios2 Run more ld tests when not native 2017-01-02 23:48:08 +10:30
ld-pe Run more ld tests when not native 2017-01-02 23:48:08 +10:30
ld-pie Don't run C tests in ld testsuite unless we have a C compiler 2017-01-03 11:47:47 +10:30
ld-plugin ld: Add additional checking for warnings/errors in testsuite 2017-02-16 13:06:12 +00:00
ld-powerpc PowerPC addpcis fix 2017-02-28 11:59:47 +10:30
ld-pru
ld-s390
ld-scripts Testsuite fixes for hppa64-hpux 2017-02-25 19:13:34 +10:30
ld-selective Run more ld tests when not native 2017-01-02 23:48:08 +10:30
ld-sh Run more ld tests when not native 2017-01-02 23:48:08 +10:30
ld-shared Run more ld tests when not native 2017-01-02 23:48:08 +10:30
ld-size Run more ld tests when not native 2017-01-02 23:48:08 +10:30
ld-sparc
ld-spu
ld-srec Run more ld tests when not native 2017-01-02 23:48:08 +10:30
ld-tic6x Run more ld tests when not native 2017-01-02 23:48:08 +10:30
ld-tilegx
ld-tilepro
ld-undefined Run more ld tests when not native 2017-01-02 23:48:08 +10:30
ld-unique [ld, testsuite] Append $board_cflags in one more place in ld-unique/unique.exp 2017-02-01 12:57:25 +00:00
ld-v850
ld-vax-elf
ld-versados Run more ld tests when not native 2017-01-02 23:48:08 +10:30
ld-visium
ld-vxworks
ld-x86-64 x86-64: Also generate unwind info for .plt.bnd 2017-01-12 10:32:17 -08:00
ld-xc16x
ld-xstormy16
ld-xtensa Run more ld tests when not native 2017-01-02 23:48:08 +10:30
ld-z8k
lib ld: Add additional checking for warnings/errors in testsuite 2017-02-16 13:06:12 +00: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