binutils-gdb/include
Alan Modra bb6bf75e7a PowerPC @l, @h and @ha warnings, plus VLE e_li
This patch started off just adding the warnings in tc-ppc.c about
incorrect usage of @l, @h and @ha in instructions that don't have
16-bit D-form fields.  That unfortunately showed up three warnings in
ld/testsuite/ld-powerpc/vle-multiseg.s on instructions like
	e_li r3, IV_table@l+0x00
which was being assembled to
   8:	70 60 00 00 	e_li    r3,0
			a: R_PPC_ADDR16_LO	IV_table
The ADDR16_LO reloc is of course completely bogus on e_li, which has
a split 20-bit signed integer field in bits 0x1f7fff, the low 11 bit
in 0x7ff, the next 5 bits in 0x1f0000, and the high 4 bits in 0x7800.
Applying an ADDR16_LO reloc to the instruction potentially changes
the e_li instruction to e_add2i., e_add2is, e_cmp16i, e_mull2i,
e_cmpl16i, e_cmph16i, e_cmphl16i, e_or2i, e_and2i., e_or2is, e_lis,
e_and2is, or some invalid encodings.

Now there is a relocation that suits e_li, R_PPC_VLE_ADDR20, which was
added 2017-09-05 but I can't see code in gas to generate the
relocation.  In any case, VLE_ADDR20 probably doesn't have the correct
semantics for @l since ideally you'd want an @l to pair with @h or @ha
to generate a 32-bit constant.  Thus @l should only produce a 16-bit
value, I think.  So we need some more relocations to handle e_li it
seems, or as I do in this patch, modify the behaviour of existing
relocations when applied to e_li instructions.

include/
	* opcode/ppc.h (E_OPCODE_MASK, E_LI_MASK, E_LI_INSN): Define.
bfd/
	* elf32-ppc.c (ppc_elf_howto_raw <R_PPC_VLE_ADDR20>): Correct
	mask and shift value.
	(ppc_elf_vle_split16): Use E_OPCODE_MASK.  Handle e_li
	specially.
gas/
	* config/tc-ppc.c (md_assemble): Adjust relocs for VLE before
	TLS tweaks.  Handle e_li.  Warn on unexpected operand field
	for lo16/hi16/ha16 relocs.
2018-12-06 23:01:03 +10:30
..
aout
cgen
coff
elf
gdb
mach-o Add support for new load commands added by Apple to the MACH-O file format. 2018-11-07 15:20:22 +00:00
opcode PowerPC @l, @h and @ha warnings, plus VLE e_li 2018-12-06 23:01:03 +10:30
som
vms
alloca-conf.h
ansidecl.h
bfdlink.h Separate header PT_LOAD for -z separate-code 2018-10-08 20:26:08 +10:30
binary-io.h
bout.h
ChangeLog PowerPC @l, @h and @ha warnings, plus VLE e_li 2018-12-06 23:01:03 +10:30
ChangeLog-0415
ChangeLog-2016
ChangeLog-2017
ChangeLog-9103
COPYING
COPYING3
demangle.h
diagnostics.h Disable -Wformat-nonliteral in parts of printcmd.c 2018-09-05 21:47:33 -06:00
dis-asm.h opcodes/riscv: Hide '.L0 ' fake symbols 2018-12-06 09:40:56 +00:00
dwarf2.def
dwarf2.h
dyn-string.h
environ.h
fibheap.h
filenames.h
floatformat.h Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
fnmatch.h
fopen-bin.h
fopen-same.h
fopen-vms.h
gcc-c-fe.def Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
gcc-c-interface.h
gcc-cp-fe.def
gcc-cp-interface.h
gcc-interface.h
getopt.h
hashtab.h
hp-symtab.h
leb128.h
libiberty.h
longlong.h
lto-symtab.h
MAINTAINERS
md5.h
oasys.h
objalloc.h
obstack.h
os9k.h
partition.h
plugin-api.h
progress.h
safe-ctype.h
sha1.h
simple-object.h libiberty: Sync with GCC 2018-06-18 09:34:12 -04:00
sort.h
splay-tree.h
symcat.h
timeval-utils.h
vtv-change-permission.h
xregex2.h Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
xregex.h
xtensa-config.h Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
xtensa-isa-internal.h Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
xtensa-isa.h