binutils-gdb/include/elf
Maciej W. Rozycki c9775dde32 MIPS16: Add R_MIPS16_PC16_S1 branch relocation support
For R_MIPS16_PC16_S1 the calculation is `(sign_extend(A) + S - P) >> 1'
and the usual MIPS16 bit shuffling applies to relocated field handling,
as per the encoding of the branch target in the extended form of the
MIPS16 B, BEQZ, BNEZ, BTEQZ and BTNEZ instructions.

	include/
	* elf/mips.h (R_MIPS16_PC16_S1): New relocation.

	bfd/
	* elf32-mips.c (elf_mips16_howto_table_rel): Add
	R_MIPS16_PC16_S1.
	(mips16_reloc_map): Likewise.
	* elf64-mips.c (mips16_elf64_howto_table_rel): Likewise.
	(mips16_elf64_howto_table_rela): Likewise.
	(mips16_reloc_map): Likewise.
	* elfn32-mips.c (elf_mips16_howto_table_rel): Likewise.
	(elf_mips16_howto_table_rela): Likewise.
	(mips16_reloc_map): Likewise.
	* elfxx-mips.c (mips16_branch_reloc_p): New function.
	(mips16_reloc_p): Handle R_MIPS16_PC16_S1.
	(b_reloc_p): Likewise.
	(mips_elf_calculate_relocation): Likewise.
	(_bfd_mips_elf_check_relocs): Likewise.
	* reloc.c (BFD_RELOC_MIPS16_16_PCREL_S1): New relocation.
	* bfd-in2.h: Regenerate.
	* libbfd.h: Regenerate.

	gas/
	* config/tc-mips.c (mips16_reloc_p): Handle
	BFD_RELOC_MIPS16_16_PCREL_S1.
	(b_reloc_p): Likewise.
	(limited_pcrel_reloc_p): Likewise.
	(md_pcrel_from): Likewise.
	(md_apply_fix): Likewise.
	(tc_gen_reloc): Likewise.
	(md_convert_frag): Likewise.
	(mips_fix_adjustable): Update comment.
	* testsuite/gas/mips/mips16-branch-reloc-2.d: Remove error
	output, add dump patterns.
	* testsuite/gas/mips/mips16-branch-reloc-3.d: Remove error
	output, add dump patterns.
	* testsuite/gas/mips/mips16-branch-addend-2.d: Remove error
	output, add dump patterns.
	* testsuite/gas/mips/mips16-branch-addend-3.d: Remove error
	output, add dump patterns.
	* testsuite/gas/mips/mips16-branch-absolute.d: Remove error
	output, add dump patterns.
	* testsuite/gas/mips/mips16-branch-reloc-2.l: Remove file.
	* testsuite/gas/mips/mips16-branch-reloc-3.l: Remove file.
	* testsuite/gas/mips/mips16-branch-addend-2.l: Remove file.
	* testsuite/gas/mips/mips16-branch-addend-3.l: Remove file.
	* testsuite/gas/mips/mips16-branch-absolute.l: Remove file.
	* testsuite/gas/mips/mips16-branch-addend-2.s: Add padding.
	* testsuite/gas/mips/branch-weak.s: Adjust alignment, avoid
	implicit instruction padding, avoid MIPS16 JR->JRC conversion.
	* testsuite/gas/mips/branch-weak-6.d: New test.
	* testsuite/gas/mips/branch-weak-7.d: New test.
	* testsuite/gas/mips/mips.exp: Run the new tests.

	ld/
	* testsuite/ld-mips-elf/mips16-branch-2.d: New test.
	* testsuite/ld-mips-elf/mips16-branch-3.d: New test.
	* testsuite/ld-mips-elf/mips16-branch-addend-2.d: New test.
	* testsuite/ld-mips-elf/mips16-branch-addend-3.d: New test.
	* testsuite/ld-mips-elf/mips16-branch.s: New test source.
	* testsuite/ld-mips-elf/mips-elf.exp: Run the new tests.
2016-06-28 01:29:56 +01:00
..
ChangeLog-0415 binutils ChangeLog rotation 2016-01-01 22:59:17 +10:30
ChangeLog-9103 Add copyright notices 2012-12-10 12:48:03 +00:00
aarch64.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
alpha.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
arc-reloc.def arc: Fix relocation formula for ARC_NPS_CMEM16 relocation 2016-04-20 11:45:24 +01:00
arc.h Arc assembler: Convert nps400 from a machine type to an extension. 2016-06-21 14:03:08 +01:00
arm.h Use getters/setters to access ARM branch type 2016-05-10 16:17:04 +01:00
avr.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
bfin.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
common.h Add constants for FreeBSD-specific auxiliary vector entry types. 2016-06-24 10:30:45 -07:00
cr16.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
cr16c.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
cris.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
crx.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
d10v.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
d30v.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
dlx.h addmore extern C 2016-06-22 12:59:58 -04:00
dwarf.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
epiphany.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
external.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
fr30.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
frv.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
ft32.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
h8.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
hppa.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
i370.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
i386.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
i860.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
i960.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
ia64.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
internal.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
ip2k.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
iq2000.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
lm32.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
m32c.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
m32r.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
m68hc11.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
m68k.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
mcore.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
mep.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
metag.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
microblaze.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
mips.h MIPS16: Add R_MIPS16_PC16_S1 branch relocation support 2016-06-28 01:29:56 +01:00
mmix.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
mn10200.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
mn10300.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
moxie.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
msp430.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
mt.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
nds32.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
nios2.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
or1k.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
pj.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
ppc.h PowerPC VLE 2016-06-07 22:04:38 +09:30
ppc64.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
reloc-macros.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
rl78.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
rx.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
s390.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
score.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
sh.h add more extern C 2016-06-01 21:26:32 -04:00
sparc.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
spu.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
tic6x-attrs.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
tic6x.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
tilegx.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
tilepro.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
v850.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
vax.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
visium.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
vxworks.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
x86-64.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
xc16x.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
xgate.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
xstormy16.h Copyright update for binutils 2016-01-01 23:00:01 +10:30
xtensa.h xtensa: prototype xtensa_make_property_section in elf/xtensa.h 2016-06-25 11:50:33 -04:00