]> git.ipfire.org Git - thirdparty/binutils-gdb.git/log
thirdparty/binutils-gdb.git
7 years agoPR22300, Abort in elf32_hppa_relocate_section building polyml
Alan Modra [Sat, 28 Oct 2017 03:40:55 +0000 (14:10 +1030)] 
PR22300, Abort in elf32_hppa_relocate_section building polyml

polyml produces object files with the wrong OS/ABI for hppa-linux.
This, along with the fact that elf32-hppa.c is using the strictest
backend relocs_compatible, results in wrong merging of ELF symbols.

So, remove the relocs_compatible check in _bfd_elf_merge_symbol.
_bfd_elf_merge_symbol is only called nowadays from within blocks
protected by is_elf_hash_table, so "we are doing an ELF link" as the
removed comment says, is true.

Also relax relocs_compatible for hppa and powerpc.  relocs_compatible
is used for more than just merging symbols, as the name suggests.
This allows objects that are in fact reasonably compatible to be
linked.

PR 22300
* elflink.c (_bfd_elf_merge_symbol): Remove relocs_compatible check.
* elf32-hppa.c (elf_backend_relocs_compatible): Define.
* elf32-ppc.c (elf_backend_relocs_compatible): Define.
* elf64-ppc.c (elf_backend_relocs_compatible): Define.

(cherry picked from commit c0e331c794d6bd75d9be9bea6145513074c33f39)

7 years agoPR22348, conflicting global vars in crx and cr16
Alan Modra [Wed, 25 Oct 2017 11:29:14 +0000 (21:59 +1030)] 
PR22348, conflicting global vars in crx and cr16

include/
PR 22348
* opcode/cr16.h (instruction): Delete.
(cr16_words, cr16_allWords, cr16_currInsn): Delete.
* opcode/crx.h (crx_cst4_map): Rename from cst4_map.
(crx_cst4_maps): Rename from cst4_maps.
(crx_no_op_insn): Rename from no_op_insn.
(instruction): Delete.
opcodes/
PR 22348
* cr16-dis.c (cr16_cinvs, instruction, cr16_currInsn): Make static.
(cr16_words, cr16_allWords, processing_argument_number): Likewise.
(imm4flag, size_changed): Likewise.
* crx-dis.c (crx_cinvs, NUMCINVS, instruction, currInsn): Likewise.
(words, allWords, processing_argument_number): Likewise.
(cst4flag, size_changed): Likewise.
* crx-opc.c (crx_cst4_map): Rename from cst4_map.
(crx_cst4_maps): Rename from cst4_maps.
(crx_no_op_insn): Rename from no_op_insn.
gas/
PR 22348
* config/tc-crx.c (instruction, output_opcode): Make static.
(relocatable, ins_parse, cur_arg_num): Likewise.
(parse_insn): Adjust for renamed opcodes globals.
(check_range): Likewise

(cherry picked from commit e5d70d6b5a5c2832ad199ac1b91f68324b4a12c9)

7 years agoAllow for __gnu_lto_slim prefixed with extra "_"
Alan Modra [Wed, 25 Oct 2017 05:02:52 +0000 (15:32 +1030)] 
Allow for __gnu_lto_slim prefixed with extra "_"

Some targets prefix global symbols with "_".

bfd/
* archive.c (_bfd_compute_and_write_armap): Match "__gnu_lto_slim"
optionally prefixed with "_".
* linker.c (_bfd_generic_link_add_one_symbol): Likewise.
binutils/
* nm.c (filter_symbols): Match "__gnu_lto_slim" optionally prefixed
with "_".
gold/
* symtab.cc (Symbol_table::add_from_relobj): Match "__gnu_lto_slim"
optionally prefixed with "_".
ld/
* testsuite/ld-plugin/lto-3r.d: Match "__gnu_lto_v" optionally
prefixed with "_".
* testsuite/ld-plugin/lto-5r.d: Likewise.

(cherry picked from commit e601d38b7cc222345d4128f45db18529b9fb477b)

7 years agoAutomatic date update in version.in
GDB Administrator [Wed, 1 Nov 2017 00:01:21 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Tue, 31 Oct 2017 00:01:34 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Mon, 30 Oct 2017 00:01:40 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Sun, 29 Oct 2017 00:01:20 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Sat, 28 Oct 2017 00:01:25 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Fri, 27 Oct 2017 00:01:37 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Thu, 26 Oct 2017 00:01:24 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Wed, 25 Oct 2017 00:01:23 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Tue, 24 Oct 2017 00:01:27 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Mon, 23 Oct 2017 00:01:08 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Sun, 22 Oct 2017 00:01:26 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Sat, 21 Oct 2017 00:01:21 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Fri, 20 Oct 2017 00:01:28 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Thu, 19 Oct 2017 00:01:27 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Wed, 18 Oct 2017 00:01:13 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years ago[GOLD] Fix powerpc64 optimization of TOC accesses
Alan Modra [Tue, 17 Oct 2017 14:03:05 +0000 (00:33 +1030)] 
[GOLD] Fix powerpc64 optimization of TOC accesses

Fixes a thinko.  Given code that puts variables into the TOC (a bad
idea, but some see the TOC as a small data section) this bug could
result in an attempt to optimize a sequence that should not be
optimized.

* powerpc.cc (Target_powerpc::Scan::local): Correct dst_off
calculation for TOC16 relocs.
(Target_powerpc::Scan::global): Likewise.

(cherry picked from commit 412294daf8786fd9060059b8be7fc59a35e13922)

7 years agoAutomatic date update in version.in
GDB Administrator [Tue, 17 Oct 2017 00:01:24 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Mon, 16 Oct 2017 00:01:19 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Sun, 15 Oct 2017 00:01:37 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Sat, 14 Oct 2017 00:01:25 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Fri, 13 Oct 2017 00:01:37 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Thu, 12 Oct 2017 00:01:33 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Wed, 11 Oct 2017 00:01:37 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Tue, 10 Oct 2017 00:01:31 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Mon, 9 Oct 2017 00:01:23 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Sun, 8 Oct 2017 00:01:23 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Sat, 7 Oct 2017 00:01:26 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Fri, 6 Oct 2017 00:01:31 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agobfd_error_on_input is for archives
Alan Modra [Thu, 5 Oct 2017 00:36:44 +0000 (11:06 +1030)] 
bfd_error_on_input is for archives

* elflink.c (elf_link_input_bfd): Correct ctor/dtor in init_array/
fini_array error value.

(cherry picked from commit 8c6716e57eb991ba6ceb07011045d626652aaf01)

7 years agoAutomatic date update in version.in
GDB Administrator [Thu, 5 Oct 2017 00:01:18 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoPR22245, Fix potential UB in bfd_set_error
Pavel I. Kryukov [Tue, 3 Oct 2017 19:42:07 +0000 (22:42 +0300)] 
PR22245, Fix potential UB in bfd_set_error

Passing enum as a first argument to variadic argument function
may lead to undefined behavior. The explanation on CERT site:
https://www.securecoding.cert.org/confluence/display/cplusplus/
EXP58-CPP.+Pass+an+object+of+the+correct+type+to+va_start

The bug was found by Kirill Nedostoev (nedostoev.ka@phystech.edu)
when he tried to build GNU binutils with Clang 7.

PR 22245
* bfd.c (bfd_set_error): Avoid UB on passing arg to va_start that
undergoes default promotion.
* bfd-in2.h: Regenerate.

(cherry picked from commit 9ba5f27cdd15d22d6c5739ff5d2b1c81d796e114)

7 years agoAutomatic date update in version.in
GDB Administrator [Wed, 4 Oct 2017 00:01:27 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Tue, 3 Oct 2017 00:01:18 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Mon, 2 Oct 2017 00:01:26 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Sun, 1 Oct 2017 00:01:19 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Sat, 30 Sep 2017 00:01:33 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Fri, 29 Sep 2017 00:01:30 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoPR22220, BFD linker wrongly marks symbols as PREVAILING_DEF_IRONLY
Alan Modra [Thu, 28 Sep 2017 07:41:38 +0000 (17:11 +0930)] 
PR22220, BFD linker wrongly marks symbols as PREVAILING_DEF_IRONLY

non_ir_ref_dynamic wasn't being set in the case where we have a
versioned dynamic symbol definition with a non-versioned matching IR
symbol.

bfd/
PR 22220
* elflink.c (_bfd_elf_merge_symbol): Set non_ir_ref_dynamic in
a case where plugin_notice isn't called.
ld/
* testsuite/ld-plugin/pr22220.h,
* testsuite/ld-plugin/pr22220lib.cc,
* testsuite/ld-plugin/pr22220lib.ver,
* testsuite/ld-plugin/pr22220main.cc: New test.
* testsuite/ld-plugin/lto.exp: Run it.

(cherry picked from commit 1a3b5c34fe371f618402f811a981839c9191ff9f)

7 years ago[GOLD] Set non-exec stack for ppc64
Alan Modra [Fri, 22 Sep 2017 01:34:41 +0000 (11:04 +0930)] 
[GOLD] Set non-exec stack for ppc64

gcc doesn't emit stack notes for ELFv1, since ELFv1 never needs an
executable stack.  Note that ELFv1 is usually big-endian and ELFv2
little-endian, but the ABI is really orthogonal to endiannes.

* powerpc.cc (Target_powerpc<64,*>::powerpc_info): Set
is_default_stack_executable false.

(cherry picked from commit ec76901011c5af6a565936d4ad87247c51901b58)

7 years agoAutomatic date update in version.in
GDB Administrator [Thu, 28 Sep 2017 00:01:32 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Wed, 27 Sep 2017 00:01:33 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agox86-64: Don't pass output_bfd to info->callbacks->minfo
H.J. Lu [Tue, 26 Sep 2017 21:41:22 +0000 (14:41 -0700)] 
x86-64: Don't pass output_bfd to info->callbacks->minfo

Don't pass output_bfd to info->callbacks->minfo when dumping local IFUNC
functions in the map file.

PR ld/22199
* elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Don't pass
output_bfd to info->callbacks->minfo.

(cherry picked from commit ac69a0d75bf472a140e5405c8a90420d5f63a998)

7 years agoAutomatic date update in version.in
GDB Administrator [Tue, 26 Sep 2017 00:01:31 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Mon, 25 Sep 2017 00:01:32 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Sun, 24 Sep 2017 00:01:36 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Sat, 23 Sep 2017 00:01:24 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agox86: Guard against corrupted PLT
H.J. Lu [Fri, 22 Sep 2017 21:15:40 +0000 (14:15 -0700)] 
x86: Guard against corrupted PLT

There should be only one entry in PLT for a given symbol.  Set howto to
NULL after processing a PLT entry to guard against corrupted PLT so that
the duplicated PLT entries are skipped.

PR binutils/22170
 * elf32-i386.c (elf_i386_get_synthetic_symtab): Guard against
 corrupted PLT.
 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.

(cherry picked from commit 61e3bf5f83f7e505b6bc51ef65426e5b31e6e360)

7 years agox86: Return -1 if bfd_canonicalize_dynamic_reloc returns 0
H.J. Lu [Fri, 22 Sep 2017 14:25:16 +0000 (07:25 -0700)] 
x86: Return -1 if bfd_canonicalize_dynamic_reloc returns 0

Stop if bfd_canonicalize_dynamic_reloc returns 0.

PR binutils/22163
* elf32-i386.c (elf_i386_get_synthetic_symtab): Also return -1
if bfd_canonicalize_dynamic_reloc returns 0.
* elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.

(cherry picked from commit b69e9267d15a09ce3f3d4599eae2952dfc6df502)

7 years agoAutomatic date update in version.in
GDB Administrator [Fri, 22 Sep 2017 00:01:21 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoreadelf: Handle E_MIPS_MACH_5900
Maciej W. Rozycki [Thu, 21 Sep 2017 23:54:19 +0000 (00:54 +0100)] 
readelf: Handle E_MIPS_MACH_5900

Fix commit e407c74b5b60 ("Support for MIPS R5900 (Sony Playstation 2)"),
<https://sourceware.org/ml/binutils/2012-12/msg00240.html>, and add the
handling of E_MIPS_MACH_5900, correctly showing `5900' among `Flags:' in
the output of `-h' rather than `unknown CPU'.

binutils/
* readelf.c (get_machine_flags) <E_MIPS_MACH_5900>: New case.

gas/
* testsuite/gas/mips/elf_mach_5900.d: New test.
* testsuite/gas/mips/mips.exp: Run it.

(cherry picked from commit ef272caa7482bd9031e82a2e6f1b81870fe2129e)

7 years agoRe Revert previous change to bfd/development.sh, setting the development flag back...
Nick Clifton [Thu, 21 Sep 2017 14:17:28 +0000 (15:17 +0100)] 
Re Revert previous change to bfd/development.sh, setting the development flag back to true.

This flag should only be set in release tarballs, not on branches,
as branches will continue to receive development updates.

7 years agoAutomatic date update in version.in
GDB Administrator [Thu, 21 Sep 2017 00:01:23 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAdd --no-relax option.
James Clarke [Fri, 4 Aug 2017 05:44:21 +0000 (22:44 -0700)] 
Add --no-relax option.

gold/
* options.h (General_options): Set a non-NULL second help string
argument for relax to allow --no-relax.

7 years agoSet the development flag to false on the 2.29 branch.
Nick Clifton [Wed, 20 Sep 2017 08:45:15 +0000 (09:45 +0100)] 
Set the development flag to false on the 2.29 branch.

* development.sh (development): Set to false.

7 years ago[GOLD] PowerPC function address in non-PIC
Alan Modra [Tue, 19 Sep 2017 23:47:56 +0000 (09:17 +0930)] 
[GOLD] PowerPC function address in non-PIC

ppc32, like many targets, defines the address of a function as the PLT
call stub code for functions referenced but not defined in a non-PIC
executable.  ppc32 gold, unlike other targets, inherits the ppc64
multiple stub capability for dealing with very large binaries where
one set of stubs can't be reached from all code locations.  This means
there can be multiple choices of address for a function, which might
cause function pointer comparison failures.  So for ppc32, make
non-branch references always use the first stub group.

(PowerPC64 ELFv1 is always PIC so doesn't need to define the address
of an external function as the PLT stub.  PowerPC64 ELFv2 needs a
special set of global entry stubs to serve as the address of external
functions, so it too is not affected by this bug.)

* powerpc.cc (Target_powerpc::Branch_info::make_stub): Put
stubs for ppc32 non-branch relocs in first stub table.
(Target_powerpc::Relocate::relocate): Resolve similarly.

(cherry picked from commit 64b5d6d785eb4c337b7c071ab9607186541a8b14)

7 years agoAutomatic date update in version.in
GDB Administrator [Wed, 20 Sep 2017 00:01:22 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoFix spelling ypos in changelog entries binutils-2_29_1.1
Nick Clifton [Tue, 19 Sep 2017 14:18:16 +0000 (15:18 +0100)] 
Fix spelling ypos in changelog entries

7 years agoImport xtensa patches from the mainline sources to fix name lookup and sorting.
Nick Clifton [Tue, 19 Sep 2017 13:59:01 +0000 (14:59 +0100)] 
Import xtensa patches from the mainline sources to fix name lookup and sorting.

* xtensa-isa.c (xtensa_isa_init): Don't update lookup table
entries for sysregs with negative indices.

* emultempl/xtensaelf.em (xtensa_wild_group_interleave_callback):
Only check for by_name sorting.

7 years agoChangeLog fixes
Alan Modra [Tue, 19 Sep 2017 08:30:58 +0000 (18:00 +0930)] 
ChangeLog fixes

7 years agoPowerPC64 stubs don't match calculated size
Alan Modra [Tue, 19 Sep 2017 03:52:49 +0000 (13:22 +0930)] 
PowerPC64 stubs don't match calculated size

After the PR 21411 fix, the linker generated .eh_frame for ppc64 glink
can be edited by the generic code.  The sequence of events goes
something like:
1) Some object file adds .eh_frame aligned to 8, making the output
   .eh_frame aligned to at least 8, so linker generated .eh_frame FDE
   is padded to an 8 byte boundary.
2) All .eh_frame past the glink .eh_frame is garbage collected.
3) Generic code detects that last FDE (the glink .eh_frame) doesn't
   need to be padded to an 8 byte boundary, reducing size from 88 to
   84.
4) elf64-ppc.c check fails.

PR 21441
* elf64-ppc.c (ppc64_elf_build_stubs): Don't check glink_eh_frame
size.

(cherry picked from commit 25516cc573ff3551a7ac0538e1d3de5811c7199e)

7 years agoPR22150, ld keeps a version reference for gc'd symbols
Alan Modra [Tue, 19 Sep 2017 02:29:30 +0000 (11:59 +0930)] 
PR22150, ld keeps a version reference for gc'd symbols

elf_gc_sweep_symbol should run after verdefs are calculated, since
the verdef code creates symbols for the versions.  However,
elf_gc_sweep_symbol needs to run before verrefs so as to not emit
useless verrefs for symbols that are gc'd.

I've also removed a _bfd_elf_link_renumber_dynsyms calls added by
Maciej after I fussed about it when reviewing.  On further examination
the call appears to be unnecessary.  Looking at renumber_dynsyms also
made me realize that the test to exclude .gnu.version has been wrong
since 2016-04-26 (git commit d5486c4372), so fix that too.

PR 22150
* elflink.c (bfd_elf_size_dynamic_sections): Garbage collect
symbols before calculating verrefs.  Don't renumber dynsyms
after gc.  Exclude .gnu.version when zero or one dynsym.
Localize some vars and reindent.

(cherry picked from commit 3d13f3e9bda5aada68915f5d958f731ae79ed41d)

7 years ago[GOLD, PowerPC] Add --no-stub-group-multi
Alan Modra [Tue, 19 Sep 2017 02:15:51 +0000 (11:45 +0930)] 
[GOLD, PowerPC] Add --no-stub-group-multi

The trouble with stubs per output section is that ppc32 uses a plt
stub as the address of a global function.  This needs to be unique,
otherwise we'll get multiple addresses for a function.

Obviously this is only a partial solution, since ppc32 will get
multiple stubs when code is larger than 33M.  A proper fix will
involve selecting a unique stub to use for non-branch relocs.

* options.h (stub-group-multi): Default to true.  Add
--no-stub-group-multi.

(cherry picked from commit ab502e635e78a6c6c9c8abf3072bfeedaca9c26f)

7 years agoRemove .eh_frame zero terminators
Alan Modra [Thu, 31 Aug 2017 10:09:14 +0000 (19:39 +0930)] 
Remove .eh_frame zero terminators

The machinery to do this was there, but not enabled if the terminator
was the only thing in the section.

bfd/
* elf-eh-frame.c (_bfd_elf_parse_eh_frame): Don't exit early
for a section containing just a terminator.  Allow multiple
terminators at end of section.
* elflink.c (bfd_elf_discard_info): Iterate over .eh_frame
sections when not adding alignment.  Assert on terminator in
the middle of FDEs.
ld/
* testsuite/ld-elf/eh3.d: Update.
* testsuite/ld-elf/eh4.d: Update.

(cherry picked from commit 9866ffe25a0fe73f5153f2720650baf0dd9cc828)

7 years agoPR22048, Incorrect .eh_frame section in libc.so
Alan Modra [Thu, 31 Aug 2017 03:18:37 +0000 (12:48 +0930)] 
PR22048, Incorrect .eh_frame section in libc.so

PR 21441
PR 22048
* elflink.c (bfd_elf_discard_info): Don't pad embedded zero
terminators.

(cherry picked from commit af471f828cc74d65b50a7531ba2c69522266cfe9)

7 years agoPR21441, Unnecessary padding of .eh_frame section
Alan Modra [Sun, 13 Aug 2017 23:55:17 +0000 (09:25 +0930)] 
PR21441, Unnecessary padding of .eh_frame section

Until all .eh_frame sections have been edited we don't know their
sizes.  So it isn't possible to properly decide whether a non-empty
.eh_frame section follows a given section until editing is complete.

bfd/
PR 21441
* elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Don't add
alignment padding here.
* elflink.c (bfd_elf_discard_info): Add .eh_frame padding here
in a reverse pass over sections.
ld/
PR 21441
* testsuite/ld-x86-64/pr21038a.d: Adjust.
* testsuite/ld-x86-64/pr21038a-now.d: Adjust.

(cherry picked from commit 79a94a2ad1e6e2f227de07427481e4bb8be84504)

7 years agoRevert "Import patch from mainline to improve padding of .eh_frame sections."
Alan Modra [Tue, 19 Sep 2017 04:52:26 +0000 (14:22 +0930)] 
Revert "Import patch from mainline to improve padding of .eh_frame sections."

This reverts commit 35e01275b59ac867d342379d457e732b5acda6a3.

7 years agoAutomatic date update in version.in
GDB Administrator [Tue, 19 Sep 2017 00:01:22 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agold: Require GCC 5 or above for 3 x86 tests
H.J. Lu [Wed, 9 Aug 2017 03:20:43 +0000 (20:20 -0700)] 
ld: Require GCC 5 or above for 3 x86 tests

Require GCC 5 or above for 3 x86 tests which fail with GCC 4.9.3.

PR ld/21924
* testsuite/ld-i386/i386.exp: Require GCC 5 or above for
"weakundef1 with PIE" test.
* testsuite/ld-x86-64/tls.exp: Require GCC 5 or above for
"tlsdesc1" and "tlsdesc1 with PIE" tests.

(cherry picked from commit 25d28c91b89d8f4a7e78b98b01e2c2382cea3e60)

7 years agoCheck error return from bfd_canonicalize_dynamic_reloc
H.J. Lu [Mon, 18 Sep 2017 20:05:25 +0000 (13:05 -0700)] 
Check error return from bfd_canonicalize_dynamic_reloc

Since bfd_canonicalize_dynamic_reloc returns -1 on error, check it in
elf_i386_get_synthetic_symtab and elf_x86_64_get_synthetic_symtab.

PR ld/22148
* elf32-i386.c (elf_i386_get_synthetic_symtab): Check error
return from bfd_canonicalize_dynamic_reloc.
* elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.

(cherry picked from commit 94670f6cf11fc29cc6db6814b38c4305d9bcac96)

7 years agoAutomatic date update in version.in
GDB Administrator [Mon, 18 Sep 2017 00:01:24 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Sun, 17 Sep 2017 00:01:29 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Sat, 16 Sep 2017 00:01:38 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoBump version to 2.29.1 and regenerate configure files binutils-2_29_1
Nick Clifton [Fri, 15 Sep 2017 12:10:29 +0000 (13:10 +0100)] 
Bump version to 2.29.1 and regenerate configure files

7 years agoAutomatic date update in version.in
GDB Administrator [Fri, 15 Sep 2017 00:01:25 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoImport patch from mainline to fix an address violation when parsing a corrupt PE...
Nick Clifton [Thu, 14 Sep 2017 10:27:40 +0000 (11:27 +0100)] 
Import patch from mainline to fix an address violation when parsing a corrupt PE binary.

PR binutils/22113
* peXXigen.c (pe_print_idata): Extend check for HintName vector
entries.

7 years agoRevert "Add enable-gold and enable-ld to src-release"
Alan Modra [Thu, 14 Sep 2017 09:08:44 +0000 (18:38 +0930)] 
Revert "Add enable-gold and enable-ld to src-release"

This reverts commit bd926929f0fae108e24cb51d9f9546b27f0a04df.

7 years agoAdd enable-gold and enable-ld to src-release
matt rice [Wed, 13 Sep 2017 16:46:22 +0000 (09:46 -0700)] 
Add enable-gold and enable-ld to src-release

So that the tarball picks up gold bison output.

* src-release.sh (do_proto_toplev): Enable gold during release process.

(cherry picked from commit 255300f5a96079a9860934c44bb9521e7aca45de)

7 years agoPR ld/20125, MMIX weak symbols
Hans-Peter Nilsson [Thu, 14 Sep 2017 03:03:14 +0000 (05:03 +0200)] 
PR ld/20125, MMIX weak symbols

Weak undefineds with PUSHJ relocs were "lost", causing internal
inconsistencies and an abort.

Import from mainline.

7 years ago* dwarf.c (display_debug_names): Initialize hash_prev.
Hans-Peter Nilsson [Thu, 14 Sep 2017 02:52:20 +0000 (04:52 +0200)] 
* dwarf.c (display_debug_names): Initialize hash_prev.

gcc-4.3.0 warns that it may be used uninitialized.  It takes a look
and a half at the code to understand that it's false.

Import from mainline.

7 years agoAutomatic date update in version.in
GDB Administrator [Thu, 14 Sep 2017 00:01:33 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Wed, 13 Sep 2017 00:01:36 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Tue, 12 Sep 2017 00:01:42 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Mon, 11 Sep 2017 00:01:48 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoImport fix from mainline that fixes buffer overrun errors when parsing corrupt DWARF...
Nick Clifton [Sun, 10 Sep 2017 09:26:33 +0000 (10:26 +0100)] 
Import fix from mainline that fixes buffer overrun errors when parsing corrupt DWARF debug information string sections.

PR 22047
* dwarf2.c (read_section): If necessary add a terminating NUL byte
to dwarf string sections.

7 years agoPowerPC64 --plt-align
Alan Modra [Sat, 9 Sep 2017 12:25:22 +0000 (21:55 +0930)] 
PowerPC64 --plt-align

This changes the PowerPC64 --plt-align option to perform the usual
alignment of code as suggested by its name, as well as the previous
behaviour of padding so as to reduce boundary crossing.  The old
behaviour is had by using a negative parameter.

The default is also changed to align plt stub code by default to 32
byte boundaries, the point being to get better bctr branch prediction
on power8 and power9 hardware.

bfd/
* elf64-ppp.c (plt_stub_pad): Handle positive and negative
plt_stub_align.
ld/
* ld.texinfo (--plt-align): Describe new behaviour of option.
* emultempl/ppc64elf.em (params): Default plt_stub_align to 5.
* testsuite/ld-powerpc/powerpc.exp: Pass --no-plt-align for
selected tests.
* testsuite/ld-powerpc/relbrlt.d: Pass --no-plt-align.
* testsuite/ld-powerpc/elfv2so.d: Adjust expected output.

(cherry picked from commit 2420fff633eff03ec1f85eba82a926cd0ecf4229)
(and commit bab55c05 for part of elfv2so.d change)

7 years agoAutomatic date update in version.in
GDB Administrator [Sun, 10 Sep 2017 00:01:32 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agox86: Remove restriction on NOTRACK prefix position
H.J. Lu [Sat, 9 Sep 2017 12:31:30 +0000 (05:31 -0700)] 
x86: Remove restriction on NOTRACK prefix position

Since the NOTRACK prefix is no longer required to be the last prefix
before the REX prefix, restriction on the NOTRACK prefix position is
removed from assembler as well as disassembler.  Assembler encodes the
NOTRACK prefix the same way as the DS segment register, which places
it before other prefixes.  Disassembler displays prefixes in the order
they appear.

gas/

* config/tc-i386.c (NOTRACK_PREFIX): Removed.
(REX_PREFIX): Updated.
(MAX_PREFIXES): Likewise.
(parse_insn): Remove restriction on NOTRACK prefix position.
* testsuite/gas/i386/notrack.s: Add tests with NOTRACK prefix
before other prefixes.
* testsuite/gas/i386/x86-64-notrack.s: Likewise.
* testsuite/gas/i386/notrackbad.s: Remove tests with NOTRACK
prefix before other prefixes.
* testsuite/gas/i386/x86-64-notrackbad.s: Likewise.
* testsuite/gas/i386/notrack-intel.d: Updated.
* testsuite/gas/i386/notrack.d: Likewise.
* testsuite/gas/i386/notrackbad.l: Likewise.
* testsuite/gas/i386/x86-64-notrack-intel.d: Likewise.
* testsuite/gas/i386/x86-64-notrack.d: Likewise.
* testsuite/gas/i386/x86-64-notrackbad.l: Likewise.

opcodes/

* i386-dis.c (last_active_prefix): Removed.
(ckprefix): Don't set last_active_prefix.
(NOTRACK_Fixup): Don't check last_active_prefix.

(cherry picked from commit 4e9ac44a8925c7da81735ef24beb5456a0c0fa24)

7 years agox86: Check for valid PLT section size
H.J. Lu [Mon, 28 Aug 2017 18:25:58 +0000 (11:25 -0700)] 
x86: Check for valid PLT section size

Update x86 get_synthetic_symtab to check for valid PLT section size
before examining PLT section contents.

PR binutils/22018
* elf32-i386.c (elf_i386_get_synthetic_symtab): Check for valid
PLT section size.
* elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.

(cherry picked from commit 90efb6422939ca031804266fba669f77c22a274a)

7 years agoAutomatic date update in version.in
GDB Administrator [Sat, 9 Sep 2017 00:01:49 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Fri, 8 Sep 2017 00:01:19 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Thu, 7 Sep 2017 00:01:38 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Wed, 6 Sep 2017 00:01:23 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoImport patches from mainline to fix minor binutils bugs:
Nick Clifton [Tue, 5 Sep 2017 14:32:04 +0000 (15:32 +0100)] 
Import patches from mainline to fix minor binutils bugs:

PR 21861
* winduni.c (codepages): Use cp1252 for codepage 0.

PR 21813
* rddbg.c (read_symbol_stabs_debugging_info): Check for an empty
string whilst concatenating symbol names.

PR 21909
* prdbg.c (pr_int_type): Increase size of local string buffer.
(pr_float_type): Likewise.
(pr_bool_type): Likewise.

PR 21820
* readelf.c (dump_section_as_strings): Do not fail if the section
was empty.
(dump_section_as_bytes): Likewise.

PR 21990
* readelf.c (process_version_sections <SHT_GNU_verneed>): Check
for invalid vn_next field before adding to idx.  Use unsigned
long for index vars.  Move index checks.
<SHT_GNU_verdef>: Likewise for vd_next.

PR 21994
* readelf.c (process_version_sections <SHT_GNU_verdef>): Check
vd_aux and vda_next for sanity.  Delete "end".  Correct overflow
checks.
(process_version_sections <SHT_GNU_verneed>): Correct overflow
check.  Don't report invalid vna_next on overflow.  Do report
invalid vna_next on size less than aux info.

7 years agoImport patch from mainline to fix memory leak.
Nick Clifton [Tue, 5 Sep 2017 13:53:37 +0000 (14:53 +0100)] 
Import patch from mainline to fix memory leak.

PR binutils/22032
* opncls.c (bfd_close_all_done): Don't call bfd_cache_close
before _close_and_cleanup.  Call iovec->bclose after.
(bfd_close): Remove code common to, and call, bfd_close_all_done.

7 years agoImport parch from mainline to prevent buffer overrun.
Nick Clifton [Tue, 5 Sep 2017 12:27:56 +0000 (13:27 +0100)] 
Import parch from mainline to prevent buffer overrun.

PR 21995
* readelf.c (process_mips_specific): Add checks for a NULL data
pointer.

7 years agoAutomatic date update in version.in
GDB Administrator [Tue, 5 Sep 2017 00:01:19 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoImport patch from mainline to improve padding of .eh_frame sections.
Nick Clifton [Mon, 4 Sep 2017 16:28:17 +0000 (17:28 +0100)] 
Import patch from mainline to improve padding of .eh_frame sections.

PR 21441
bfd * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Don't add
alignment padding here.
* elflink.c (bfd_elf_discard_info): Add .eh_frame padding here
in a reverse pass over sections.

ld * testsuite/ld-elf/eh3.d: Update.
* testsuite/ld-elf/eh4.d: Update.
PR 21441
* testsuite/ld-x86-64/pr21038a.d: Adjust.
* testsuite/ld-x86-64/pr21038a-now.d: Adjust.