Alan Modra f9c6b9078c Report overflow on PowerPC64 @h and @ha relocations.
This changes the behaviour of @h and @ha on PowerPC64 to report errors
on 32-bit overflow.  The motivation for this change is that on
PowerPC64, most uses of @h and @ha modifiers and their corresponding
relocations are to build up 32-bit offsets.  We'd like to know when
such offsets overflow.  Only rarely do people use @h or @ha with the
high 32-bit modifiers to build a 64-bit constant.  Those uses will now
need to use two new modifiers, @high and @higha, if the constant isn't
known at assembly time.  For now, we won't report overflow at assembly
time..

This also fixes an error when applying some of the HIGHER and HIGHEST
relocations.

include/elf/
	* ppc64.h (R_PPC64_ADDR16_HIGH, R_PPC64_ADDR16_HIGHA,
	R_PPC64_TPREL16_HIGH, R_PPC64_TPREL16_HIGHA,
	R_PPC64_DTPREL16_HIGH, R_PPC64_DTPREL16_HIGHA): New.
	(IS_PPC64_TLS_RELOC): Match new tls relocs.
bfd/
	* reloc.c (BFD_RELOC_PPC64_ADDR16_HIGH, BFD_RELOC_PPC64_ADDR16_HIGHA,
	BFD_RELOC_PPC64_TPREL16_HIGH, BFD_RELOC_PPC64_TPREL16_HIGHA,
	BFD_RELOC_PPC64_DTPREL16_HIGH, BFD_RELOC_PPC64_DTPREL16_HIGHA): New.
	* elf64-ppc.c (ppc64_elf_howto_raw): Add entries for new relocs.
	Make all _HA and _HI relocs report signed overflow.
	(ppc64_elf_reloc_type_lookup): Handle new relocs.
	(must_be_dyn_reloc, ppc64_elf_check_relocs): Likewise.
	(dec_dynrel_count, ppc64_elf_relocate_section): Likewise.
	(ppc64_elf_relocate_section): Don't apply 0x8000 adjust to
	R_PPC64_TPREL16_HIGHER, R_PPC64_TPREL16_HIGHEST,
	R_PPC64_DTPREL16_HIGHER, and R_PPC64_DTPREL16_HIGHEST.
	* libbfd.h: Regenerate.
	* bfd-in2.h: Regenerate.
gas/
	* config/tc-ppc.c (SEX16): Don't mask.
	(REPORT_OVERFLOW_HI): Define as zero.
	(ppc_elf_suffix): Support @high, @higha, @dtprel@high, @dtprel@higha,
	@tprel@high, and @tprel@higha modifiers.
	(md_assemble): Ignore X_unsigned when applying 16-bit insn fields.
	Add (disabled) code to check @h and @ha reloc overflow for powerpc64.
	Handle new relocs.
	(md_apply_fix): Similarly.
elfcpp/
	* powerpc.h (R_PPC64_ADDR16_HIGH, R_PPC64_ADDR16_HIGHA,
	R_PPC64_TPREL16_HIGH, R_PPC64_TPREL16_HIGHA,
	R_PPC64_DTPREL16_HIGH, R_PPC64_DTPREL16_HIGHA): Define.
gold/
	* powerpc.cc (Target_powerpc::Scan::check_non_pic): Handle new relocs.
	(Target_powerpc::Scan::global, local): Likewise.
	(Target_powerpc::Relocate::relocate): Likewise.  Check for overflow
	on all ppc64 @h and @ha relocs.
2013-10-30 13:33:15 +10:30
..
2013-10-25 14:02:58 +00:00
2013-08-05 21:58:23 +00:00
2012-12-17 16:56:12 +00:00
2012-11-08 03:03:26 +00:00
2013-01-10 20:03:55 +00:00
2012-11-07 05:51:37 +00:00
2012-11-09 08:29:34 +00:00
2013-08-26 22:18:07 +00:00
2013-08-21 07:28:37 +00:00
2012-12-17 16:56:12 +00:00
2013-08-23 07:54:19 +00:00
2012-12-10 12:48:03 +00:00
2012-12-10 12:48:03 +00:00
2012-12-10 12:48:03 +00:00
2012-12-10 12:48:03 +00:00
2012-12-10 12:48:03 +00:00
2012-12-10 12:48:03 +00:00
2012-12-10 12:48:03 +00:00
2012-12-10 12:48:03 +00:00
2012-12-10 12:48:03 +00:00
2012-12-10 12:48:03 +00:00
2013-02-04 05:10:44 +00:00
2012-12-10 12:48:03 +00:00
2012-12-10 12:48:03 +00:00
2012-12-10 12:48:03 +00:00
2012-12-10 12:48:03 +00:00
2013-07-24 14:12:41 +00:00
2012-11-09 08:29:34 +00:00
2012-10-18 17:42:29 +00:00
2013-01-10 20:03:55 +00:00
2012-11-06 05:51:18 +00:00
2013-02-04 05:25:41 +00:00
2013-02-04 05:25:41 +00:00
2013-01-10 20:03:55 +00:00
2013-01-10 20:03:55 +00:00
2012-12-17 16:56:12 +00:00
2013-01-10 20:03:55 +00:00
2013-01-10 20:03:55 +00:00
2013-01-10 20:03:55 +00:00
2013-01-10 20:03:55 +00:00
2013-01-10 20:03:55 +00:00
2013-01-10 20:03:55 +00:00
2013-08-26 22:18:07 +00:00
2013-01-10 20:03:55 +00:00
2013-01-10 20:03:55 +00:00
2013-01-10 09:49:22 +00:00
2013-01-10 20:03:55 +00:00
2013-10-25 14:03:01 +00:00
2013-05-16 16:34:51 +00:00
2013-08-26 19:27:25 +00:00
2013-04-09 15:50:38 +00:00
2013-03-30 10:14:15 +00:00
2013-03-30 10:14:15 +00:00
2013-03-30 10:14:15 +00:00
2013-03-30 10:14:15 +00:00
2013-03-30 10:14:15 +00:00
2013-03-30 10:14:15 +00:00
2013-03-22 15:53:36 +00:00
2013-03-30 10:14:15 +00:00
2013-08-26 19:27:25 +00:00
2013-03-30 10:14:15 +00:00
2013-03-30 10:14:15 +00:00
2013-10-09 05:23:23 +00:00
2013-03-30 10:14:15 +00:00
2013-03-30 10:14:15 +00:00
2013-03-30 10:14:15 +00:00
2013-01-10 09:49:22 +00:00
2013-03-30 10:14:15 +00:00
2013-03-30 10:14:15 +00:00
2013-07-18 14:08:42 +00:00
2013-03-30 10:14:15 +00:00
2013-03-30 10:14:15 +00:00
2013-10-09 15:44:27 +00:00
2013-10-09 16:24:43 +00:00
2013-03-30 10:14:15 +00:00
2013-03-30 10:14:15 +00:00
2013-03-30 10:14:15 +00:00
2013-08-23 07:54:19 +00:00
2013-03-30 10:14:15 +00:00
2013-03-30 10:14:15 +00:00
2013-10-09 19:40:04 +00:00
2013-03-30 10:14:15 +00:00
2013-03-30 10:14:15 +00:00
2013-07-01 03:45:05 +00:00
2013-03-30 10:14:15 +00:00
2013-02-07 03:44:26 +00:00
2013-02-21 02:29:11 +00:00
2013-03-30 10:14:15 +00:00
2013-08-26 19:27:25 +00:00
2013-08-26 19:27:25 +00:00
2013-02-18 10:40:19 +00:00
2013-02-21 02:29:11 +00:00
2013-10-17 10:05:38 +00:00
2013-02-21 02:29:11 +00:00
2013-06-25 18:02:34 +00:00
2013-10-09 17:54:32 +00:00
2013-06-24 14:28:17 +00:00
2013-01-10 20:03:55 +00:00
2012-10-18 17:42:29 +00:00
2013-01-10 20:03:55 +00:00
2013-01-10 20:03:55 +00:00
2013-01-10 20:03:55 +00:00
2013-01-10 20:03:55 +00:00
2013-01-10 20:03:55 +00:00
2012-12-17 16:56:12 +00:00
2012-10-18 17:42:29 +00:00
2012-10-18 17:42:29 +00:00
2013-01-10 20:03:55 +00:00
2012-12-17 16:56:12 +00:00
2012-12-17 16:56:12 +00:00
2013-01-10 20:03:55 +00:00
2013-04-08 20:08:21 +00:00
2013-04-08 20:08:21 +00:00
2013-05-22 06:13:59 +00:00
2013-01-10 20:03:55 +00:00
2013-01-10 20:03:55 +00:00
2012-12-17 16:56:12 +00:00
2013-01-10 20:03:55 +00:00
2013-10-30 09:30:01 +10:30
2013-01-14 13:14:08 +00:00
2012-12-17 16:56:12 +00:00
2013-10-09 18:02:48 +00:00

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

BFD is an object file library.  It permits applications to use the
same routines to process object files regardless of their format.

BFD is used by the GNU debugger, assembler, linker, and the binary
utilities.

The documentation on using BFD is scanty and may be occasionally
incorrect.  Pointers to documentation problems, or an entirely
rewritten manual, would be appreciated.

There is some BFD internals documentation in doc/bfdint.texi which may
help programmers who want to modify BFD.

BFD is normally built as part of another package.  See the build
instructions for that package, probably in a README file in the
appropriate directory.

BFD supports the following configure options:

  --target=TARGET
	The default target for which to build the library.  TARGET is
	a configuration target triplet, such as sparc-sun-solaris.
  --enable-targets=TARGET,TARGET,TARGET...
	Additional targets the library should support.  To include
	support for all known targets, use --enable-targets=all.
  --enable-64-bit-bfd
	Include support for 64 bit targets.  This is automatically
	turned on if you explicitly request a 64 bit target, but not
	for --enable-targets=all.  This requires a compiler with a 64
	bit integer type, such as gcc.
  --enable-shared
	Build BFD as a shared library.
  --with-mmap
	Use mmap when accessing files.  This is faster on some hosts,
	but slower on others.  It may not work on all hosts.

Report bugs with BFD to bug-binutils@gnu.org.

Patches are encouraged.  When sending patches, always send the output
of diff -u or diff -c from the original file to the new file.  Do not
send default diff output.  Do not make the diff from the new file to
the original file.  Remember that any patch must not break other
systems.  Remember that BFD must support cross compilation from any
host to any target, so patches which use ``#ifdef HOST'' are not
acceptable.  Please also read the ``Reporting Bugs'' section of the
gcc manual.

Bug reports without patches will be remembered, but they may never get
fixed until somebody volunteers to fix them.

Copyright (C) 2012 Free Software Foundation, Inc.

Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved.