]> git.ipfire.org Git - thirdparty/binutils-gdb.git/log
thirdparty/binutils-gdb.git
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.

7 years agoImport patch from mainline to fix address violation errors when parsing corrupt ELF...
Nick Clifton [Mon, 4 Sep 2017 16:05:17 +0000 (17:05 +0100)] 
Import patch from mainline to fix address violation errors when parsing corrupt ELF binaries.

PR 21916
* elf-attrs.c (_bfd_elf_parse_attributes): Complain about very
small section lengths.
* elf.c (_bfd_elf_setup_sections): Skip empty entries in the group
table.
(elfcore_grok_freebsd_prstatus): Add checks to make sure that
there is enough data present in the note.

7 years agoImport patch from mainline to allows 16-bit MSP430 absolute branches to be relaxed...
Nick Clifton [Mon, 4 Sep 2017 15:43:00 +0000 (16:43 +0100)] 
Import patch from mainline to allows 16-bit MSP430 absolute branches to be relaxed ino 1-bit PC-relative branches.

PR 21824
* elf32-msp430.c (msp430_elf_relax_section): Allow conversion of
16-bit absolute branches into 10-bit pc-relative branches on the
MSP430 as well as the MSP430X.

7 years agoImport patch from mainline to fix address violation errors when parsing corrupt VMS...
Nick Clifton [Mon, 4 Sep 2017 15:31:12 +0000 (16:31 +0100)] 
Import patch from mainline to fix address violation errors when parsing corrupt VMS and MACHO binaries.

PR 21813
* mach-o.c (bfd_mach_o_canonicalize_relocs): Pass the base address
of the relocs to the canonicalize_one_reloc routine.
* mach-o.h (struct bfd_mach_o_backend_data): Update the prototype
for the _bfd_mach_o_canonicalize_one_reloc field.
* mach-o-arm.c (bfd_mach_o_arm_canonicalize_one_reloc): Add
res_base parameter.  Use to check for corrupt pair relocs.
* mach-o-aarch64.c (bfd_mach_o_arm64_canonicalize_one_reloc):
Likewise.
* mach-o-i386.c (bfd_mach_o_i386_canonicalize_one_reloc):
Likewise.
* mach-o-x86-64.c (bfd_mach_o_x86_64_canonicalize_one_reloc):
Likewise.
* vms-alpha.c (_bfd_vms_slurp_eihd): Make sure that there is
enough data in the record before attempting to parse it.
(_bfd_vms_slurp_eeom): Likewise.
(_bfd_vms_slurp_egsd): Check for an invalid section index.
(image_set_ptr): Likewise.
(alpha_vms_slurp_relocs): Likewise.
(alpha_vms_object_p): Check for a truncated record.

7 years agoImport patch from mainline to improve reporting of corrupt archives.
Nick Clifton [Mon, 4 Sep 2017 15:14:19 +0000 (16:14 +0100)] 
Import patch from mainline to improve reporting of corrupt archives.

PR 21787
* archive.c (bfd_generic_archive_p): If the bfd does not have the
correct magic bytes at the start, set the error to wrong format
and clear the format selector before returning NULL.

7 years agoImport patch from mainline to fix address violations when parsing corrupt COFF binaries
Nick Clifton [Mon, 4 Sep 2017 15:04:44 +0000 (16:04 +0100)] 
Import patch from mainline to fix address violations when parsing corrupt COFF binaries

PR 21786
* coff-rs6000.c (_bfd_strntol): New function.
(_bfd_strntoll): New function.
(GET_VALUE_IN_FIELD): New macro.
(EQ_VALUE_IN_FIELD): new macro.
(_bfd_xcoff_slurp_armap): Use new macros.
(_bfd_xcoff_archive_p): Likewise.
(_bfd_xcoff_read_ar_hdr): Likewise.
(_bfd_xcoff_openr_next_archived_file): Likewise.
(_bfd_xcoff_stat_arch_elt): Likewise.
* coff64-rs6000.c (_bfd_strntol): New function.
(_bfd_strntoll): New function.
(GET_VALUE_IN_FIELD): New macro.
(xcoff64_slurp_armap): Use new macros.

7 years agoImport patch from mainline to replace an abort when parsing a corrupt COFF binary...
Nick Clifton [Mon, 4 Sep 2017 14:51:32 +0000 (15:51 +0100)] 
Import patch from mainline to replace an abort when parsing a corrupt COFF binary with an error message instead.

PR binutils/21781
* coffcode.h (handle_COMDAT): Replace abort with an error message
and return.

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

7 years agoPR22067, x86 check_relocs invalid read
Alan Modra [Sun, 3 Sep 2017 23:05:21 +0000 (08:35 +0930)] 
PR22067, x86 check_relocs invalid read

PR 22067
* elf32-i386.c (elf_i386_hash_table): Check is_elf_hash_table first.
* elf64-x86-64.c (elf_x86_64_hash_table): Likewise.

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

7 years agox86-64: Check ELF_COMMON_DEF_P for common symbols
H.J. Lu [Sat, 2 Sep 2017 01:53:26 +0000 (18:53 -0700)] 
x86-64: Check ELF_COMMON_DEF_P for common symbols

bfd/

PR ld/22064
* elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Check
ELF_COMMON_DEF_P for common symbols.

ld/

PR ld/22064
* testsuite/ld-x86-64/pr22064a.S: New file.
* testsuite/ld-x86-64/pr22064b.c: Likewise.
* testsuite/ld-x86-64/x86-64.exp: Run PR ld/22064 test.

(cherry picked from commit ad71ce8de7dba823f5fc478e6d5eba03f1a2e822)

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

7 years agox86: Correct unwind information for the second PLT
H.J. Lu [Fri, 1 Sep 2017 13:11:54 +0000 (06:11 -0700)] 
x86: Correct unwind information for the second PLT

For i386, generate unwind information for the second PLT.  For x32,
correct alignment of .eh_frame section for the second PLT.

bfd/

PR ld/22061
* elf32-i386.c (elf_i386_link_setup_gnu_properties): Create
.eh_frame section for the second PLT.
* elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Correct
alignment of .eh_frame section for the second PLT.

ld/

PR ld/22061
* testsuite/ld-i386/ibt-plt-1.d: Pass --hash-style=sysv to ld.
Updated.
* testsuite/ld-i386/ibt-plt-2a.d: Likewise.
* testsuite/ld-i386/ibt-plt-2c.d: Likewise.
* testsuite/ld-i386/ibt-plt-3a.d: Likewise.
* testsuite/ld-i386/ibt-plt-3c.d: Likewise.
* testsuite/ld-x86-64/ibt-plt-1-x32.d: Likewise.
* testsuite/ld-x86-64/ibt-plt-2a-x32.d: Likewise.
* testsuite/ld-x86-64/ibt-plt-2c-x32.d: Likewise.
* testsuite/ld-x86-64/ibt-plt-3a-x32.d: Likewise.
* testsuite/ld-x86-64/ibt-plt-3c-x32.d: Likewise.
* testsuite/ld-i386/ibt-plt-2b.d: Pass --hash-style=sysv to ld
and dump unwind information.
* testsuite/ld-i386/ibt-plt-2d.d: Likewise.
* testsuite/ld-i386/ibt-plt-3b.d: Likewise.
* testsuite/ld-i386/ibt-plt-3d.d: Likewise.
* testsuite/ld-x86-64/ibt-plt-2b-x32.d: Likewise.
* testsuite/ld-x86-64/ibt-plt-2b.d: Likewise.
* testsuite/ld-x86-64/ibt-plt-2d-x32.d: Likewise.
* testsuite/ld-x86-64/ibt-plt-2d.d: Likewise.
* testsuite/ld-x86-64/ibt-plt-3b-x32.d: Likewise.
* testsuite/ld-x86-64/ibt-plt-3b.d: Likewise.
* testsuite/ld-x86-64/ibt-plt-3d-x32.d: Likewise.
* testsuite/ld-x86-64/ibt-plt-3d.d: Likewise.
* testsuite/ld-x86-64/ibt-plt-1.d: Pass --hash-style=sysv to ld.
* testsuite/ld-x86-64/ibt-plt-2a.d: Likewise.
* testsuite/ld-x86-64/ibt-plt-2c.d: Likewise.
* testsuite/ld-x86-64/ibt-plt-3a.d: Likewise.
* testsuite/ld-x86-64/ibt-plt-3c.d: Likewise.

(cherry picked from commit e10c9c620c3335731bb0052987affdc40942fd71)

7 years agoPrevent an address violation parsing corrupt DWARF information by fixing the test...
Nick Clifton [Fri, 1 Sep 2017 10:22:43 +0000 (11:22 +0100)] 
Prevent an address violation parsing corrupt DWARF information by fixing the test for an overlong debug line info structure.

        PR 22059
        * dwarf2.c (decode_line_info): Fix test for an overlong line info
        structure.

7 years agoImport latest bug fixes for the libiberty sources from GCC mainline.
Nick Clifton [Fri, 1 Sep 2017 09:56:58 +0000 (10:56 +0100)] 
Import latest bug fixes for the libiberty sources from GCC mainline.

PR lto/81968
* simple-object-elf.c (simple_object_elf_copy_lto_debug_section):
Keep names of removed global symbols.

* simple-object-xcoff.c (simple_object_xcoff_find_sections):
Improve .go_export csect handling.  Don't make assumptions
on containing section or number of auxiliary entries.

PR lto/81968
* simple-object-elf.c (simple_object_elf_copy_lto_debug_section):
Adjust field with for sh_type write, set SHF_EXCLUDE only for
removed sections.

PR lto/81925
* simple-object-elf.c (simple_object_elf_write_shdr): Adjust
type of sh_addralign and sh_entsize and properly write
sh_entsize as Elf_Addr.
(simple_object_elf_write_to_file): Read sh_entsize as Elf_Addr.

* simple-object-common.h (struct simple_object_functions): Add
copy_lto_debug_sections hook.
* simple-object.c: Include fcntl.h.
(handle_lto_debug_sections): New helper function.
(simple_object_copy_lto_debug_sections): New function copying
early LTO debug sections to regular debug sections in a new file.
(simple_object_start_write): Handle NULL segment_name.
* simple-object-coff.c (simple_object_coff_functions): Adjust
for not implemented copy_lto_debug_sections hook.
* simple-object-mach-o.c (simple_object_mach_o_functions): Likewise.
* simple-object-xcoff.c (simple_object_xcoff_functions): Likewise.
* simple-object-elf.c (SHT_NULL, SHT_SYMTAB, SHT_RELA, SHT_REL,
SHT_GROUP): Add various sectopn header types.
(SHF_EXCLUDE): Add flag.
(Elf32_External_Sym, Elf64_External_Sym): Add symbol struct.
(ELF_ST_BIND, ELF_ST_TYPE, ELF_ST_INFO): Add accessors.
(STT_OBJECT, STT_FUNC, STT_TLS, STT_GNU_IFUNC): Add Symbol types.
(STV_DEFAULT): Add symbol visibility.
(SHN_COMMON): Add special section index name.
(struct simple_object_elf_write): New.
(simple_object_elf_start_write): Adjust for new private data.
(simple_object_elf_write_shdr): Pass in values for all fields
we write.
(simple_object_elf_write_to_file): Adjust.  Copy from recorded
section headers if requested.
(simple_object_elf_release_write): Release private data.
(simple_object_elf_copy_lto_debug_sections): Copy and rename sections
as denoted by PFN and all their dependences, symbols and relocations
to the empty destination file.
(simple_object_elf_functions): Adjust for copy_lto_debug_sections hook.

* simple-object-xcoff.c (simple_object_xcoff_find_sections):
Search symbol table for .go_export symbol and apply pfn if found.

7 years agoCheck for an invalid note size when parsing ELF notes.
Nick Clifton [Fri, 1 Sep 2017 09:17:00 +0000 (10:17 +0100)] 
Check for an invalid note size when parsing ELF notes.

PR 21933
PR 22060
* elf.c (elf_read_notes): Check for a note size of -1.

7 years agoFix buffer overrun when parsing an ELF attribute string that is not NUL terminated.
Nick Clifton [Fri, 1 Sep 2017 08:59:17 +0000 (09:59 +0100)] 
Fix buffer overrun when parsing an ELF attribute string that is not NUL terminated.

PR 22058
* elf-attrs.c (_bfd_elf_parse_attributes): Ensure that the
attribute buffer is NUL terminated.

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

7 years agoAdd updated French translations for opcodes and gprof
Nick Clifton [Thu, 31 Aug 2017 13:32:26 +0000 (14:32 +0100)] 
Add updated French translations for opcodes and gprof

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

7 years agoMIPS/BFD: Correct microMIPS cross-mode BAL to JALX relaxation
Maciej W. Rozycki [Wed, 30 Aug 2017 15:03:31 +0000 (16:03 +0100)] 
MIPS/BFD: Correct microMIPS cross-mode BAL to JALX relaxation

Fix a bug in commit a6ebf6169a1b ("MIPS: Convert cross-mode BAL to
JALX") and in BFD linker relaxation correct the microMIPS interpretation
of the branch offset, which is supposed to be shifted by 1 bit, rather
than 2 as in the regular MIPS case.

bfd/
* elfxx-mips.c (mips_elf_perform_relocation): Correct microMIPS
branch offset interpretation.

gas/
* testsuite/gas/mips/branch-addend-micromips.d: New test.
* testsuite/gas/mips/branch-addend-micromips-n32.d: New test.
* testsuite/gas/mips/branch-addend-micromips-n64.d: New test.
* testsuite/gas/mips/branch-addend-micromips.s: New test source.
* testsuite/gas/mips/mips.exp: Run the new tests.

ld/
* testsuite/ld-mips-elf/bal-jalx-addend-micromips.d: New test.
* testsuite/ld-mips-elf/bal-jalx-addend-micromips-n32.d: New
test.
* testsuite/ld-mips-elf/bal-jalx-addend-micromips-n64.d: New
test.
* testsuite/ld-mips-elf/bal-jalx-local-micromips.d: New test.
* testsuite/ld-mips-elf/bal-jalx-local-micromips-n32.d: New
test.
* testsuite/ld-mips-elf/bal-jalx-local-micromips-n64.d: New
test.
* testsuite/ld-mips-elf/bal-jalx-pic-micromips.d: New test.
* testsuite/ld-mips-elf/bal-jalx-pic-micromips-n32.d: New test.
* testsuite/ld-mips-elf/bal-jalx-pic-micromips-n64.d: New test.
* testsuite/ld-mips-elf/bal-jalx-pic-ignore-micromips.d: New
test.
* testsuite/ld-mips-elf/bal-jalx-pic-ignore-micromips-n32.d: New
test.
* testsuite/ld-mips-elf/bal-jalx-pic-ignore-micromips-n64.d: New
test.
* testsuite/ld-mips-elf/mips-elf.exp: Run the new tests.

(cherry picked from commit 70e65ca8e5d1fc984d58f6137c290e807fe772a5)

7 years agoMIPS/GAS: Also respect `-mignore-branch-isa' with MIPS16 code
Maciej W. Rozycki [Wed, 30 Aug 2017 14:54:19 +0000 (15:54 +0100)] 
MIPS/GAS: Also respect `-mignore-branch-isa' with MIPS16 code

Fix a bug in commit 8b10b0b3e100 ("MIPS: Add options to control branch
ISA checks") and with the `-mignore-branch-isa' command-line option also
lift a GAS check for invalid MIPS16 branches between ISA modes, which is
made separately from regular MIPS and microMIPS checks.

gas/
* config/tc-mips.c (md_convert_frag): Respect
`mips_ignore_branch_isa'.
* testsuite/gas/mips/branch-local-5.d: New test.
* testsuite/gas/mips/branch-local-n32-5.d: New test.
* testsuite/gas/mips/branch-local-n64-5.d: New test.
* testsuite/gas/mips/branch-local-6.d: New test.
* testsuite/gas/mips/branch-local-n32-6.d: New test.
* testsuite/gas/mips/branch-local-n64-6.d: New test.
* testsuite/gas/mips/branch-local-7.d: New test.
* testsuite/gas/mips/branch-local-n32-7.d: New test.
* testsuite/gas/mips/branch-local-n64-7.d: New test.
* testsuite/gas/mips/branch-local-ignore-5.d: New test.
* testsuite/gas/mips/branch-local-ignore-n32-5.d: New test.
* testsuite/gas/mips/branch-local-ignore-n64-5.d: New test.
* testsuite/gas/mips/branch-local-ignore-6.d: New test.
* testsuite/gas/mips/branch-local-ignore-n32-6.d: New test.
* testsuite/gas/mips/branch-local-ignore-n64-6.d: New test.
* testsuite/gas/mips/branch-local-5.l: New stderr output.
* testsuite/gas/mips/branch-local-6.l: New stderr output.
* testsuite/gas/mips/branch-local-5.s: New test source.
* testsuite/gas/mips/branch-local-6.s: New test source.
* testsuite/gas/mips/branch-local-7.s: New test source.
* testsuite/gas/mips/mips.exp: Run the new tests.

(cherry picked from commit 37b2d327512baf2f39020e44958fd1f11db46a91)

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

7 years agoImport from mainline to fix PR gold/21868.
Han Shen [Mon, 28 Aug 2017 23:36:45 +0000 (16:36 -0700)] 
Import from mainline to fix PR gold/21868.

2017-08-28  James Clarke <jrtc27@jrtc27.com>

gold/ChangeLog:
PR gold/21868
* aarch64.cc (AArch64_relobj::try_fix_erratum_843419_optimized):
Add extra view offset argument to function.
(AArch64_relobj::fix_errata_and_relocate_erratum_stubs): Add
extra view offset set to the output offset when the view has
is_input_output_view set, since it has not already been
included. Pass this to try_fix_erratum_843419_optimized.

7 years agoImport patch from mainline to fix address violation issues when parsing corrupt binaries.
Nick Clifton [Tue, 29 Aug 2017 11:37:45 +0000 (12:37 +0100)] 
Import patch from mainline to fix address violation issues when parsing corrupt binaries.

* mach-o.c (bfd_mach_o_read_symtab_strtab): Fail if the symtab
size is -1.
* nlmcode.h (nlm_swap_auxiliary_headers_in): Replace assertion
with error return.
* section.c (bfd_make_section_with_flags): Fail if the name or bfd
are NULL.
* vms-alpha.c (bfd_make_section_with_flags): Correct computation
of end pointer.
(evax_bfd_print_emh): Check for invalid string lengths.

7 years agoAutomatic date update in version.in
GDB Administrator [Tue, 29 Aug 2017 00:02:29 +0000 (00:02 +0000)] 
Automatic date update in version.in

7 years ago[GOLD] Symbol flag for PowerPC64 localentry:0 tracking
Alan Modra [Mon, 28 Aug 2017 06:57:33 +0000 (16:27 +0930)] 
[GOLD] Symbol flag for PowerPC64 localentry:0 tracking

This patch provides a flag for PowerPC64 ELFv2 use in class Symbol,
and modifies Sized_target::resolve to return whether the symbol has
been resolved.  If not, normal processing continues.  I use this for
PowerPC64 ELFv2 to keep track of whether a symbol has any definition
with non-zero localentry, in order to disable --plt-localentry for
that symbol.

PR 21847
* powerpc.cc (Target_powerpc::is_elfv2_localentry0): Test
non_zero_localentry.
(Target_powerpc::resolve): New function.
(powerpc_info): Set has_resolve for 64-bit.
* target.h (Sized_target::resolve): Return bool.
* resolve.cc (Symbol_table::resolve): Continue with normal
processing when target resolve returns false.
* symtab.h (Symbol::non_zero_localentry, set_non_zero_localentry):
New accessors.
(Symbol::non_zero_localentry_): New flag bit.
* symtab.cc (Symbol::init_fields): Init non_zero_localentry_.

7 years agoAutomatic date update in version.in
GDB Administrator [Mon, 28 Aug 2017 00:02:24 +0000 (00:02 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Sun, 27 Aug 2017 00:02:32 +0000 (00:02 +0000)] 
Automatic date update in version.in

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

7 years agoAutomatic date update in version.in
GDB Administrator [Fri, 25 Aug 2017 00:02:23 +0000 (00:02 +0000)] 
Automatic date update in version.in

7 years agold: Early detection of orphans we know will be discarded
Andrew Burgess [Thu, 17 Aug 2017 10:29:04 +0000 (11:29 +0100)] 
ld: Early detection of orphans we know will be discarded

When processing an orphan section we first call lang_place_orphans, this
function handles a few sections for which the behaviour is known COMMON
sections, or sections marked as SEC_EXCLUDE.

Any orphans that are not handled in lang_place_orphans are passed on to
ldlang_place_orphan, this is where we decide where to put the orphan,
and then call lang_add_section to perform the actual orphan placement.

We previously had a larger set of checks at the start of the function
lang_add_section to discard some sections that we _knew_ should not be
added into the output file, this was where .group sections (in a final
link) and .debug* sections (with --strip-debug) were dropped.

The problem with dropping these sections at the lang_add_section stage
is that a user might also be using --orphan-handling=error to prevent
orphans.  If they are then they should not be get errors about sections
that we know will be discarded, and which are not mentioned in the
linker script.

The solution proposed in this patch is to move the "will this section be
discarded" check into a separate function, and use this in
lang_place_orphans to have the early discard phase discard sections that
we know should not be included in the output file.

ld/ChangeLog:

PR 21961
* ldlang.c (lang_discard_section_p): New function.
(lang_add_section): Checks moved out into new function, which is
now called.
(lang_place_orphans): Call lang_discard_section_p instead of
duplicating some of the checks from lang_add_section.
* testsuite/ld-elf/orphan-11.d: New file.
* testsuite/ld-elf/orphan-11.ld: New file.
* testsuite/ld-elf/orphan-11.s: New file.
* testsuite/ld-elf/orphan-12.d: New file.
* testsuite/ld-elf/orphan-12.s: New file.

7 years agoAutomatic date update in version.in
GDB Administrator [Thu, 24 Aug 2017 00:02:45 +0000 (00:02 +0000)] 
Automatic date update in version.in

7 years agoRemove pr19161 test hppa xfail
Alan Modra [Tue, 22 Aug 2017 23:28:42 +0000 (08:58 +0930)] 
Remove pr19161 test hppa xfail

* testsuite/ld-gc/pr19161.d: Don't xfail hppa.

7 years agoMake undefined symbols in allocate_dynrelocs dynamic
Alan Modra [Tue, 22 Aug 2017 23:28:08 +0000 (08:58 +0930)] 
Make undefined symbols in allocate_dynrelocs dynamic

..if they have dynamic relocs.  An undefined symbol in a PIC object
that finds no definition ought to become dynamic in order to support
--allow-shlib-undefined, but there is nothing in the generic ELF
linker code to do this if the reference isn't via the GOT or PLT.  (An
initialized function pointer is an example.)  So it falls to backend
code to ensure the symbol is made dynamic.

PR 21988
* elf64-ppc.c (ensure_undef_dynamic): Rename from
ensure_undefweak_dynamic.  Handle undefined too.
* elf32-ppc.c (ensure_undef_dynamic): Likewise.
* elf32-hppa.c (ensure_undef_dynamic): Likewise.
(allocate_dynrelocs): Discard undefined non-default visibility
relocs first.  Make undefined syms dynamic.  Tidy goto.

7 years agoMake __start/__stop symbols protected visibility
Alan Modra [Mon, 21 Aug 2017 03:58:06 +0000 (13:28 +0930)] 
Make __start/__stop symbols protected visibility

They can't be hidden visibility since apparently people use dlsym to
look them up.

bfd/
PR ld/21964
* elf-bfd.h (SYMBOLIC_BIND): Return TRUE for __start/__stop symbols.
* elflink.c (bfd_elf_define_start_stop): Rewrite.
ld/
PR ld/21964
* testsuite/ld-elf/pr21562a.d: Update for changed start/stop symbols.
* testsuite/ld-elf/pr21562b.d: Likewise.
* testsuite/ld-elf/pr21562c.d: Likewise.
* testsuite/ld-elf/pr21562d.d: Likewise.
* testsuite/ld-elf/pr21562e.d: Likewise.
* testsuite/ld-elf/pr21562f.d: Likewise.
* testsuite/ld-elf/pr21562g.d: Likewise.
* testsuite/ld-elf/pr21562h.d: Likewise.
* testsuite/ld-elf/pr21562i.d: Likewise.
* testsuite/ld-elf/pr21562j.d: Likewise.
* testsuite/ld-elf/pr21562k.d: Likewise.
* testsuite/ld-elf/pr21562l.d: Likewise.
* testsuite/ld-elf/pr21562m.d: Likewise.
* testsuite/ld-elf/pr21562n.d: Likewise.
* testsuite/ld-elf/sizeofa.d: Likewise.
* testsuite/ld-elf/sizeofb.d: Likewise.
* testsuite/ld-elf/startofa.d: Likewise.
* testsuite/ld-elf/startofb.d: Likewise.
* testsuite/ld-gc/pr20022.d: Likewise.
* testsuite/ld-gc/start.d: Likewise.
* testsuite/ld-elf/pr21964-1a.c: New file.
* testsuite/ld-elf/pr21964-1b.c: New file.
* testsuite/ld-elf/pr21964-2a.c: New file.
* testsuite/ld-elf/pr21964-2b.c: New file.
* testsuite/ld-elf/shared.exp: Run PR ld/21964 tests.

7 years agoCollision between NT_GNU_BUILD_ATTRIBUTE_OPEN and NT_PPC_VMX
Alan Modra [Sat, 12 Aug 2017 06:57:29 +0000 (16:27 +0930)] 
Collision between NT_GNU_BUILD_ATTRIBUTE_OPEN and NT_PPC_VMX

* readelf.c (process_note): Qualify NT_GNU_BUILD_ATTRIBUTE notes
by name data.

7 years agoPR21910, segfault in common symbol override test when hash-style=gnu
Alan Modra [Mon, 7 Aug 2017 08:32:49 +0000 (18:02 +0930)] 
PR21910, segfault in common symbol override test when hash-style=gnu

PR 21910
* elflink.c (bfd_elf_final_link): Don't segfault when sections
needed to define various dynamic tags have been discarded.

7 years agoDon't fail in elf32_hppa_set_gp
Alan Modra [Sat, 5 Aug 2017 13:58:21 +0000 (23:28 +0930)] 
Don't fail in elf32_hppa_set_gp

The base bfd_link_hash_table works fine here, the only thing to watch
out for is to only set elf_gp if the output is ELF.

bfd/
* elf32-hppa.c (elf32_hppa_set_gp): Don't require an
hppa_link_hash_table.
ld/
* testsuite/ld-unique/pr21529.d: Don't xfail hppa.

7 years agoAdd more targets to the list of architectures not supporting format changing during...
Nick Clifton [Thu, 3 Aug 2017 10:59:32 +0000 (11:59 +0100)] 
Add more targets to the list of architectures not supporting format changing during linking.  Fix seg-faults triggered when this is attempted.

PR ld/21884
* testsuite/ld-elf/pr21884.d: Add AVR, HPPA, IA64, M68HC1x and
SCORE to list of targets not supporting file format changes during
linking.
* testsuite/ld-unique/pr21529.d: Likewise.
* emultempl/avrelf.em (_before_allocation): Skip for non-ELF
output formats.
(avr_elf_create_output_section_statements): Fail if the output
format is not ELF.
(avr_finish): Do not access the ELF header in non-ELF format
output bfds.
* emultempl/m68hc1xelf.em (_before_allocation): Skip for non-ELF
output formats.
(m68hc11elf_create_output_section_statements): Fail if the putput
format is not ELF.
(m68hc11elf_after_allocation): Skip for non-ELF output formats.

7 years ago__tls_get_addr_opt stub eh_frame info
Alan Modra [Tue, 25 Jul 2017 04:22:32 +0000 (13:52 +0930)] 
__tls_get_addr_opt stub eh_frame info

Since the __tls_get_addr_opt stub saves LR and makes a call, eh_frame
info should be generated to describe how to unwind through the stub.

The patch also changes the way the backend iterates over stubs, from
looking at all sections in stub_bfd to which all dynamic sections are
attached as well, to iterating over the group list, which gets just
the stub sections.  Most binaries will have just one or two stub
groups, so this is a little faster.

bfd/
* elf64-ppc.c (struct map_stub): Add tls_get_addr_opt_bctrl.
(stub_eh_frame_size): New function.
(ppc_size_one_stub): Set group tls_get_addr_opt_bctrl.
(group_sections): Init group tls_get_addr_opt_bctrl.
(ppc64_elf_size_stubs): Update sizing and initialization of
.eh_frame.  Iteration over stubs via group list.
(ppc64_elf_build_stubs): Iterate over stubs via group list.
(ppc64_elf_finish_dynamic_sections): Update finalization of
.eh_frame.
ld/
* testsuite/ld-powerpc/tlsopt5.s: Add cfi.
* testsuite/ld-powerpc/tlsopt5.d: Update.
* testsuite/ld-powerpc/tlsopt5.wf: New file.
* testsuite/ld-powerpc/powerpc.exp: Perform new tlsopt5 test.

7 years agoppc32 tlsopt tests
Alan Modra [Fri, 14 Jul 2017 09:07:26 +0000 (18:37 +0930)] 
ppc32 tlsopt tests

These all were odd in that they used r13 as the GOT pointer.  That
didn't matter for the purpose of testing, but would never occur in
practice.  Also, the tlsopt5 tests could have their global dynamic
sequences optimized to initial exec, so link with -shared.

* testsuite/ld-powerpc/powerpc.exp: Add -shared to tlsop5 tests.
* testsuite/ld-powerpc/tlsopt5.d: Adjust.
* testsuite/ld-powerpc/tlsopt1_32.s: Use r30 as GOT pointer.
* testsuite/ld-powerpc/tlsopt2_32.s: Likewise.
* testsuite/ld-powerpc/tlsopt3_32.s: Likewise.
* testsuite/ld-powerpc/tlsopt4_32.s: Likewise.
* testsuite/ld-powerpc/tlsopt5_32.s: Rewrite.
* testsuite/ld-powerpc/tlsopt1_32.d: Adjust.
* testsuite/ld-powerpc/tlsopt2_32.d: Adjust.
* testsuite/ld-powerpc/tlsopt3_32.d: Adjust.
* testsuite/ld-powerpc/tlsopt5_32.d: Adjust.

7 years agoAutomatic date update in version.in
GDB Administrator [Wed, 23 Aug 2017 00:02:22 +0000 (00:02 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Mon, 21 Aug 2017 00:02:40 +0000 (00:02 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Sun, 20 Aug 2017 00:02:34 +0000 (00:02 +0000)] 
Automatic date update in version.in

7 years agoAutomatic date update in version.in
GDB Administrator [Sat, 19 Aug 2017 00:02:23 +0000 (00:02 +0000)] 
Automatic date update in version.in

7 years agoFix buffer overrun when parsing a corrupt tekhex binary.
Nick Clifton [Fri, 18 Aug 2017 07:47:16 +0000 (08:47 +0100)] 
Fix buffer overrun when parsing a corrupt tekhex binary.

PR binutils/21962
* tekhex.c (getsym): Fix check for source pointer walking off the
end of the input buffer.

7 years agoAutomatic date update in version.in
GDB Administrator [Fri, 18 Aug 2017 00:02:20 +0000 (00:02 +0000)] 
Automatic date update in version.in

7 years ago[AArch64] Skip IFUNC relocations in debug sections
Szabolcs Nagy [Thu, 17 Aug 2017 13:48:03 +0000 (14:48 +0100)] 
[AArch64] Skip IFUNC relocations in debug sections

Skip IFUNC relocations in debug sections ignored by ld.so.
Fixes the following ld test failures on aarch64:

FAIL: Build libpr18808.so
FAIL: Build libpr18808.so_2
FAIL: Run pr18808

aborting at bfd/elfnn-aarch64.c:4986 in elf64_aarch64_final_link_relocate.

bfd/
PR ld/18808
* elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Skip IFUNC
relocations in debug sections, change abort to _bfd_error_handler.

7 years ago[AArch64] Fix PR18841 ifunc relocation ordering
Szabolcs Nagy [Tue, 4 Jul 2017 14:43:59 +0000 (15:43 +0100)] 
[AArch64] Fix PR18841 ifunc relocation ordering

In order to get the ifunc relocs properly sorted the correct class
needs to be returned.  The code mimics what has been done for x86.

Fixes
FAIL: Run pr18841 with libpr18841c.so

bfd/
PR ld/18841
* elfnn-aarch64.c (elfNN_aarch64_reloc_type_class): Return
reloc_class_ifunc for ifunc symbols.

7 years agoAutomatic date update in version.in
GDB Administrator [Thu, 17 Aug 2017 00:02:46 +0000 (00:02 +0000)] 
Automatic date update in version.in

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

7 years ago[Patch AArch64] Turn lr, fp, ip0 and ip1 into proper aliases
Ramana Radhakrishnan [Tue, 15 Aug 2017 12:58:01 +0000 (13:58 +0100)] 
[Patch AArch64] Turn lr, fp, ip0 and ip1 into proper aliases

We got a report from the linux-arm-kernel folks about getting spurious
warnings when building the kernel with binutils 2.29. See
https://www.spinics.net/lists/arm-kernel/msg599929.html

which boils down to this testcase.

$> cat /tmp/tst.s
    lr .req x30
    /tmp/tst.s: Assembler messages:
    /tmp/tst.s:1: Warning: ignoring attempt to redefine built-in register 'lr'

Instead let's treat this as a proper alias at startup time thus
avoiding the problem and treating these as proper aliases
rather than new registers. This means that attempts to redefine
the alias with the same "name" will provoke no warning and attempts
to redefine the alias to something else will provoke the above mentioned
warning.

Tested make check-gas and no regressions.

Ok to apply to trunk (and backport to 2.29 branch)?

Regards
Ramana

7 years agoAutomatic date update in version.in
GDB Administrator [Mon, 14 Aug 2017 00:02:37 +0000 (00:02 +0000)] 
Automatic date update in version.in

7 years agold: Replace --rpath with -Wl,--rpath,
H.J. Lu [Tue, 8 Aug 2017 21:13:46 +0000 (14:13 -0700)] 
ld: Replace --rpath with -Wl,--rpath,

"--rpath ../bfd/.libs ../bfd/.libs/libbfd.so" isn't a valid compiler
command-line option.  We should use -Wl,--rpath, instead of --rpath.

PR ld/21923
* configure.ac (TESTBFDLIB): Replace --rpath with -Wl,--rpath,
for --disable-static.
* configure: Regenerated.

(cherry picked from commit fe22cbc418b35ed6ea3252a204bd351f8c201e0b and
 9165f4548be8612161fb90cfad9bd0cc6a752c90)

7 years agold: Restore linker scripts in PR ld/21884 tests
H.J. Lu [Sun, 13 Aug 2017 12:41:37 +0000 (05:41 -0700)] 
ld: Restore linker scripts in PR ld/21884 tests

OUTPUT_FORMAT in linker script of PR ld/21884 tests is needed to trigger
PR ld/21884.  Restore linker scripts and add nacl versions of the same
tests.

* testsuite/ld-i386/i386.exp: Run pr21884-nacl.
* testsuite/ld-x86-64/x86-64.exp: Likewise.
* testsuite/ld-i386/pr21884.d: Don't run on nacl targets.
* testsuite/ld-x86-64/pr21884.d: Likewise.
* testsuite/ld-i386/pr21884.t: Revert the last change.
* testsuite/ld-x86-64/pr21884.t: Likewise.
* testsuite/ld-i386/pr21884-nacl.d: New file.
* testsuite/ld-i386/pr21884-nacl.t: Likewise.
* testsuite/ld-x86-64/pr21884-nacl.d: Likewise.
* testsuite/ld-x86-64/pr21884-nacl.t: Likewise.

(cherry picked from commit 34c4758cc210e2ca042b0373938e57fd6844f89d)

7 years agoFix i686-nacl and x86_64-nacl pr21884 failures
Alan Modra [Sun, 13 Aug 2017 00:04:04 +0000 (09:34 +0930)] 
Fix i686-nacl and x86_64-nacl pr21884 failures

OUTPUT_FORMAT in the script results in "./ld-new: target elf32-i386
not found" and similarly for the x86_64 test.

* testsuite/ld-i386/pr21884.t: Remove unneeded format, arch and entry.
* testsuite/ld-x86-64/pr21884.t: Likewise.

7 years agoAutomatic date update in version.in
GDB Administrator [Sun, 13 Aug 2017 00:02:08 +0000 (00:02 +0000)] 
Automatic date update in version.in

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

7 years agoDo not choose a non-ELF format input file to hold the linker created GOT sections.
Nick Clifton [Mon, 7 Aug 2017 09:09:51 +0000 (10:09 +0100)] 
Do not choose a non-ELF format input file to hold the linker created GOT sections.

bfd/

PR 21884
* elf32-i386.c (elf_i386_link_setup_gnu_properties): If the dynobj
has not been set then use the bfd returned by
_bfd_elf_link_setup_gnu_properties.  If that is null then search
through all the input bfds selecting the first normal, ELF format
one.
* elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Likewise.

ld/

PR ld/21884
* testsuite/ld-i386/i386.exp: Run pr21884.
* testsuite/ld-x86-64/x86-64.exp: Likewise.
* testsuite/ld-i386/pr21884.d: New file.
* testsuite/ld-i386/pr21884.t: Likewise.
* testsuite/ld-x86-64/pr21884.d: Likewise.
* testsuite/ld-x86-64/pr21884.t: Likewise.

(cherry picked from commit b7a18930e3925c4092bd975e95bc3603aa1418d9 and
 9593aade74f0da0c08a4ab55e4c59173b07b1f63)

7 years agoAutomatic date update in version.in
GDB Administrator [Fri, 11 Aug 2017 00:02:21 +0000 (00:02 +0000)] 
Automatic date update in version.in

7 years agoBackport fix for a Darwin x86 assembler bug from the mainline.
Nick Clifton [Thu, 10 Aug 2017 16:17:20 +0000 (17:17 +0100)] 
Backport fix for a Darwin x86 assembler bug from the mainline.

PR gas/21939
* config/obj-macho.c (obj_mach_o_set_indirect_symbols): Increase
size of indirect_syms array so that it is large enough to hold
every symbol if necessary.

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

7 years ago[ARM] Don't warn on REG_SP when used in CRC32 instructions
Jiong Wang [Wed, 9 Aug 2017 16:52:54 +0000 (17:52 +0100)] 
[ARM] Don't warn on REG_SP when used in CRC32 instructions

According to ARMv8-A architecture manual, REG_SP is allowed in CRC32
instructions in Thumb mode.  It is REG_PC that will cause unpredictable
behaviours on both ARM and Thumb.

This patch removes the incorrect warning on Thumb mode.

Meanwhile the disassembler is updated to use format "<bitfield>R" instead of
"<bitfield>S".  "<bitfield>S" is not used elsewhere. so I have deleted related
code from the disassembler.

gas/
* config/tc-arm.c (do_crc32_1): Remove warning on REG_SP for thumb_mode.
* testsuite/gas/arm/crc32-armv8-a-bad.d: Update exepcted result.
* testsuite/gas/arm/crc32-armv8-r-bad.d: Likewise.
* testsuite/gas/arm/crc32-armv8-a.d: Likewise.
* testsuite/gas/arm/crc32-armv8-r.d: Likewise.
* testsuite/gas/arm/crc32-armv8-ar-bad.s: Update test case.
* testsuite/gas/arm/crc32-armv8-ar.s: Likewise.
* testsuite/gas/arm/crc32-bad.l: Update expected error message.

opcode/
* arm-dis.c (thumb32_opcodes): Use format 'R' instead of 'S' for
register operands in CRC instructions.
(print_insn_thumb32): Remove "<bitfield>S" support.  Updated the
comments.

7 years agoAutomatic date update in version.in
GDB Administrator [Wed, 9 Aug 2017 00:02:06 +0000 (00:02 +0000)] 
Automatic date update in version.in

7 years agoPR21017, microblaze missing _GLOBAL_OFFSET_TABLE_ symbol
Alan Modra [Tue, 8 Aug 2017 04:35:33 +0000 (14:05 +0930)] 
PR21017, microblaze missing _GLOBAL_OFFSET_TABLE_ symbol

PR 21017
* elf32-microblaze.c (microblaze_elf_check_relocs): Don't bump
got.refcount for GOTOFF relocs, just create .got section.

7 years agoAutomatic date update in version.in
GDB Administrator [Tue, 8 Aug 2017 00:01:50 +0000 (00:01 +0000)] 
Automatic date update in version.in

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

7 years agoAutomatic date update in version.in
GDB Administrator [Sun, 6 Aug 2017 00:01:39 +0000 (00:01 +0000)] 
Automatic date update in version.in

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

7 years agoAutomatic date update in version.in
GDB Administrator [Fri, 4 Aug 2017 00:01:40 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoELF checks for orphan placement
Alan Modra [Thu, 3 Aug 2017 04:31:34 +0000 (14:01 +0930)] 
ELF checks for orphan placement

The loop checking for previous orphan placement should run even when
the output is non-ELF.

PR ld/21884
* emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Revert
last change.  Rename iself to elfinput.  Expand comments.  Condition
ELF checks on having both input and output ELF files.  Extract..
(elf_orphan_compatible): ..this new function.

7 years agoAutomatic date update in version.in
GDB Administrator [Thu, 3 Aug 2017 00:02:06 +0000 (00:02 +0000)] 
Automatic date update in version.in

7 years agoFix double-word branch on bit instruction.
John David Anglin [Wed, 2 Aug 2017 16:06:16 +0000 (12:06 -0400)] 
Fix double-word branch on bit instruction.

        Backport from mainline
        2017-07-31  John David Anglin  <danglin@gcc.gnu.org>

        * config/tc-hppa.c (pa_ip): Clear `d' bit in branch on bit instructions
        with a double-word condition and a fixed bit position greater than 31.

7 years agoCheck ELF section header only for ELF output
H.J. Lu [Wed, 2 Aug 2017 12:10:29 +0000 (05:10 -0700)] 
Check ELF section header only for ELF output

When placing an orphan input section, check ELF section header only for
ELF output.

PR ld/21884
* emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Check
ELF section header only for ELF output.
* testsuite/ld-elf/pr21884.d: New test.
* testsuite/ld-elf/pr21884.t: Likewise.
* testsuite/ld-elf/pr21884a.s: Likewise.
* testsuite/ld-elf/pr21884b.s: Likewise.

(cherry picked from commit db99ecc08f5b66fbe9cb72e90352c7f77ec71a6e)

7 years agoAutomatic date update in version.in
GDB Administrator [Wed, 2 Aug 2017 00:01:46 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoS/390: Fix claimfile failures
Andreas Krebbel [Tue, 1 Aug 2017 13:15:38 +0000 (15:15 +0200)] 
S/390: Fix claimfile failures

This fixes a segfault when trying to access the local_plt field in the
s390 specific elf data althoug the underlaying object is a generic elf
object.

This fixes the following testsuite failures:

< FAIL: plugin claimfile replace symbol with source
< FAIL: plugin claimfile resolve symbol with source
< FAIL: plugin claimfile replace file with source
< FAIL: plugin set symbol visibility with source
< FAIL: plugin ignore lib with source
< FAIL: plugin claimfile replace lib with source
< FAIL: plugin 2 with source lib
< FAIL: load plugin 2 with source
< FAIL: plugin 3 with source lib
< FAIL: load plugin 3 with source

bfd/ChangeLog:

2017-08-01  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

Backport from mainline
2017-08-01  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

* elf32-s390.c (elf_s390_finish_dynamic_sections): Skip if it
isn't the S/390 specific elf data.
* elf64-s390.c (elf_s390_finish_dynamic_sections): Likewise.

7 years agoS/390: Fix segfault when linking -shared -nostartfiles
Andreas Krebbel [Tue, 1 Aug 2017 08:56:59 +0000 (10:56 +0200)] 
S/390: Fix segfault when linking -shared -nostartfiles

Regression-tested on s390x.

bfd/ChangeLog:

2017-08-01  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

Backport from mainline
2017-07-28  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

* elf32-s390.c (elf_s390_finish_dynamic_sections): Add NULL
pointer check for htab->elf.irelplt.
* elf64-s390.c (elf_s390_finish_dynamic_sections): Likewise.

7 years agoS/390: Support z14 as CPU name.
Andreas Krebbel [Tue, 1 Aug 2017 08:56:59 +0000 (10:56 +0200)] 
S/390: Support z14 as CPU name.

With IBM z14 officially announced I can add z14 as CPU name.

No regressions with that patch on s390x.

gas/ChangeLog:

2017-08-01  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

Backport from mainline
2017-07-21  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

* config/tc-s390.c (s390_parse_cpu): Add z14 as alternate CPU
name.
* doc/as.texinfo: Add z14 to CPU string list.
* doc/c-s390.texi: Likewise.

opcodes/ChangeLog:

2017-08-01  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

Backport from mainline
2017-07-21  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

* s390-mkopc.c (main): Enable z14 as CPU string in the opcode
table.

7 years agoAutomatic date update in version.in
GDB Administrator [Tue, 1 Aug 2017 00:01:47 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoPR 21847, PowerPC64 --plt-localentry again
Alan Modra [Mon, 31 Jul 2017 00:48:46 +0000 (10:18 +0930)] 
PR 21847, PowerPC64 --plt-localentry again

This makes ld warn about --plt-localentry if a version of glibc
without the necessary ld.so checks is detected, and revises the
documentation.

bfd/
* elf64-ppc.c (ppc64_elf_tls_setup): Warn on --plt-localentry
without ld.so checks.
gold/
* powerpc.cc (Target_powerpc::scan_relocs): Warn on --plt-localentry
without ld.so checks.
ld/
* ld.texinfo (plt-localentry): Revise.