]> git.ipfire.org Git - thirdparty/binutils-gdb.git/log
thirdparty/binutils-gdb.git
7 years agoAdd generated files binutils-2_28
Tristan Gingold [Thu, 2 Mar 2017 09:17:52 +0000 (10:17 +0100)] 
Add generated files

7 years agoSync libiberty sources with GCC mainline.
Nick Clifton [Wed, 1 Mar 2017 15:09:29 +0000 (15:09 +0000)] 
Sync libiberty sources with GCC mainline.

Brings in:
  2017-01-18  Markus Trippelsdorf  <markus@trippelsdorf.de>

PR PR c++/70182
* cp-demangle.c (d_unqualified_name): Handle "on" for
operator names.
* testsuite/demangle-expected: Add tests.

 2017-01-18  Markus Trippelsdorf  <markus@trippelsdorf.de>

PR c++/77489
* cp-demangle.c (d_discriminator): Handle discriminator >= 10.
* testsuite/demangle-expected: Add tests for discriminator.

 2016-12-13  Jakub Jelinek  <jakub@redhat.com>

PR c++/78761
* cp-demangle.c (cplus_demangle_type): Demangle Dc as decltype(auto).
* testsuite/demangle-expected: Add test for decltype(auto).

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

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

7 years agoNios2 dynobj handling fixes
Alan Modra [Tue, 28 Feb 2017 00:08:51 +0000 (10:38 +1030)] 
Nios2 dynobj handling fixes

A number of places in elf32-nios.c created dynamic sections but didn't
set the hash table dynobj.  That meant we could have duplicate dynamic
sections connected to a number of bfds, so size_dynamic_sections
didn't properly discard or allocate contents.

Also, the entire set of dynamic sections was created in check_relocs
on seeing GOT relocs, when only .got related sections are needed,
probably done to hide segfaults later in finish_dynamic_sections.

The patch fixes these issues and makes the assembler emit errors when
nios2 lacks the necessary pc-relative relocs for subtraction
expressions, rather than silently generating bad code.
eg. ld-elf/merge.  I've also tidied uses of elf32_nios2_hash_table and
elf_hash_table.

bfd/
PR 20995
* elf32-nios2.c (nios2_elf32_relocate_section): Use htab
rather than elf32_nios2_hash_table or elf_hash_table.
(create_got_section): Likewise.
(nios2_elf32_finish_dynamic_symbol): Likewise.
(nios2_elf32_adjust_dynamic_symbol): Likewise.
(nios2_elf32_size_dynamic_sections): Likewise.
(nios2_elf32_check_relocs): Delete dynobj, sgot, and srelgot
vars.  Use htab equivalents directly instead.  Don't create
all dynamic sections on needing just the GOT.  Use a goto
rather than a fall-through with reloc test.  Ensure
htab->dynobj is set when making dynamic sreloc section.
(nios2_elf32_finish_dynamic_sections): Delete dynobj, use htab
equivalent directly instead.  Don't segfault on looking for
.dynamic when dynamic sections have not been created.  Don't
segfault on .got.plt being discarded.
(nios2_elf32_size_dynamic_sections): Delete plt and got vars.
Don't set "relocs" on .rela.plt.  Do handle .sbss.  Delete
fixme and another not so relevant comment.
(nios2_elf_add_symbol_hook): Delete dynobj var.  If not
already set, set hash table dynobj on creating .sbss.
gas/
* config/tc-nios2.h (TC_FORCE_RELOCATION_SUB_LOCAL): Define.
ld/
* testsuite/ld-elf/merge.d: xfail for nios.

7 years agoDon't make dynamic .data.rel.ro SEC_READONLY
Alan Modra [Mon, 27 Feb 2017 21:36:02 +0000 (08:06 +1030)] 
Don't make dynamic .data.rel.ro SEC_READONLY

I'd made this dynamic section read-only so a flag test distinguished
it from .dynbss, but like any other .data.rel.ro section it really
should be marked read-write.  (It is read-only after relocation, not
before.)  When using the standard linker scripts this usually doesn't
matter since the output section is among other read-write sections and
not page aligned.  However, it might matter in the extraordinary case
of the dynamic section being the only .data.rel.ro section with the
output section just happening to be page aligned and a multiple of a
page in size.  In that case the output section would be read-only, and
live it its own read-only PT_LOAD segment, which is incorrect.

* elflink.c (_bfd_elf_create_dynamic_sections): Don't make
dynamic .data.rel.ro read-only.
* elf32-arm.c (elf32_arm_finish_dynamic_symbol): Compare section
rather than section flags when deciding where copy reloc goes.
* elf32-cris.c (elf_cris_finish_dynamic_symbol): Likewise.
* elf32-hppa.c (elf32_hppa_finish_dynamic_symbol): Likewise.
* elf32-i386.c (elf_i386_finish_dynamic_symbol): Likewise.
* elf32-metag.c (elf_metag_finish_dynamic_symbol): Likewise.
* elf32-microblaze.c (microblaze_elf_finish_dynamic_symbol): Likewise.
* elf32-nios2.c (nios2_elf32_finish_dynamic_symbol): Likewise.
* elf32-or1k.c (or1k_elf_finish_dynamic_symbol): Likewise.
* elf32-ppc.c (ppc_elf_finish_dynamic_symbol): Likewise.
* elf32-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
* elf32-tic6x.c (elf32_tic6x_finish_dynamic_symbol): Likewise.
* elf32-tilepro.c (tilepro_elf_finish_dynamic_symbol): Likewise.
* elf64-ppc.c (ppc64_elf_finish_dynamic_symbol): Likewise.
* elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
* elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
* elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Likewise.
* elfnn-riscv.c (riscv_elf_finish_dynamic_symbol): Likewise.
* elfxx-mips.c (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise.
* elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Likewise.
* elfxx-tilegx.c (tilegx_elf_finish_dynamic_symbol): Likewise.

7 years agoPowerPC addpcis fix
Alan Modra [Mon, 27 Feb 2017 22:02:36 +0000 (08:32 +1030)] 
PowerPC addpcis fix

This came up because I was looking at ld/tmpdir/addpcis.o and noticed
the odd addends on REL16DX_HA.  They ought to both be -4.  The error
crept in due REL16DX_HA howto being pc-relative (as indeed it should
be), and code at gas/write.c:1001 after this comment
      /* Make it pc-relative.  If the back-end code has not
 selected a pc-relative reloc, cancel the adjustment
 we do later on all pc-relative relocs.  */
*not* cancelling the pc-relative adjustment.  So I've made a dummy
non-relative split reloc so that the generic code handles this, rather
than attempting to add hacks later in md_apply_fix which would not be
very robust.  Having the new internal reloc also makes it easy to
support

 addpcis rx,sym@ha

as an equivalent to

 addpcis rx,(sym-0f)@ha
0:

The patch also fixes overflow checking, which must test whether the
addi will overflow too since @l relocs don't have any overflow check.

Lastly, since I was poking at md_apply_fix, I arranged to have the
generic gas/write.c code emit errors for subtraction expressions where
we lack reloc support.

include/
* elf/ppc64.h (R_PPC64_16DX_HA): New.  Expand fake reloc comment.
* elf/ppc.h (R_PPC_16DX_HA): Likewise.
bfd/
* reloc.c (BFD_RELOC_PPC_16DX_HA): New.
* elf64-ppc.c (ppc64_elf_howto_raw <R_PPC64_16DX_HA>): New howto.
(ppc64_elf_reloc_type_lookup): Translate new bfd reloc.
(ppc64_elf_ha_reloc): Correct overflow test on REL16DX_HA.
(ppc64_elf_relocate_section): Likewise.
* elf32-ppc.c (ppc_elf_howto_raw <R_PPC_16DX_HA>): New howto.
(ppc_elf_reloc_type_lookup): Translate new bfd reloc.
(ppc_elf_check_relocs): Handle R_PPC_16DX_HA to pacify gcc.
* libbfd.h: Regenerate.
* bfd-in2.h: Regenerate.
gas/
* config/tc-ppc.c (md_assemble): Use BFD_RELOC_PPC_16DX_HA for addpcis.
(md_apply_fix): Remove fx_subsy check.  Move code converting to
pcrel reloc earlier and handle BFD_RELOC_PPC_16DX_HA.  Remove code
emiiting errors on seeing fx_pcrel set on unexpected relocs, as
that is done now by the generic code via..
* config/tc-ppc.h (TC_FORCE_RELOCATION_SUB_LOCAL): ..this. Define.
(TC_VALIDATE_FIX_SUB): Define.
ld/
* testsuite/ld-powerpc/addpcis.d: Define ext1 and ext2 at
limits of addpcis range.

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

7 years agobfd: RISC-V: relax to gp in more cases.
Andrew Waterman [Wed, 22 Feb 2017 05:56:57 +0000 (21:56 -0800)] 
bfd: RISC-V: relax to gp in more cases.

bfd/ChangeLog:

2017-02-24  Andrew Waterman  <andrew@sifive.com>

* elfnn-riscv.c (GP_NAME): New macro.
(riscv_global_pointer_value): Use it.
(_bfd_riscv_relax_lui): If symbol and global pointer are in same
output section, consider only that section's alignment.

7 years agoAdd new counter-enable CSRs
Andrew Waterman [Thu, 23 Feb 2017 05:23:05 +0000 (21:23 -0800)] 
Add new counter-enable CSRs

include/ChangeLog:

2017-02-22  Andrew Waterman  <andrew@sifive.com>

       * opcode/riscv-opc.h (CSR_SCOUNTEREN): New define.
       (CSR_MCOUNTEREN): Likewise.
       (scounteren): Declare register.
       (mcounteren): Likewise.

7 years agoAdd SFENCE.VMA instruction
Andrew Waterman [Tue, 14 Feb 2017 23:37:04 +0000 (15:37 -0800)] 
Add SFENCE.VMA instruction

include/ChangeLog:

2017-02-14  Andrew Waterman  <andrew@sifive.com>

        * opcode/riscv-opc.h (MATCH_SFENCE_VMA): New define.
        (MASK_SFENCE_VMA): Likewise.
        (sfence_vma): Declare instruction.

opcodes/ChangeLog:

2017-02-14  Andrew Waterman  <andrew@sifive.com>

        * riscv-opc.c (riscv_opcodes): Add sfence.vma instruction and
        pseudoinstructions.

7 years ago sve
Richard Sandiford [Mon, 27 Feb 2017 11:35:03 +0000 (11:35 +0000)] 
  sve

[AArch64] Additional SVE instructions

This patch supports some additions to the SVE architecture prior to
its public release.

include/
* opcode/aarch64.h (AARCH64_OPND_SVE_ADDR_RI_S4x16)
(AARCH64_OPND_SVE_IMM_ROT1, AARCH64_OPND_SVE_IMM_ROT2)
(AARCH64_OPND_SVE_Zm3_INDEX, AARCH64_OPND_SVE_Zm3_22_INDEX)
(AARCH64_OPND_SVE_Zm4_INDEX): New aarch64_opnds.

opcodes/
* aarch64-tbl.h (OP_SVE_HMH, OP_SVE_VMU_HSD, OP_SVE_VMVU_HSD)
(OP_SVE_VMVV_HSD, OP_SVE_VMVVU_HSD, OP_SVE_VM_HSD, OP_SVE_VUVV_HSD)
(OP_SVE_VUV_HSD, OP_SVE_VU_HSD, OP_SVE_VVVU_H, OP_SVE_VVVU_S)
(OP_SVE_VVVU_HSD, OP_SVE_VVV_D, OP_SVE_VVV_D_H, OP_SVE_VVV_H)
(OP_SVE_VVV_HSD, OP_SVE_VVV_S, OP_SVE_VVV_S_B, OP_SVE_VVV_SD_BH)
(OP_SVE_VV_BHSDQ, OP_SVE_VV_HSD, OP_SVE_VZVV_HSD, OP_SVE_VZV_HSD)
(OP_SVE_V_HSD): New macros.
(OP_SVE_VMU_SD, OP_SVE_VMVU_SD, OP_SVE_VM_SD, OP_SVE_VUVV_SD)
(OP_SVE_VU_SD, OP_SVE_VVVU_SD, OP_SVE_VVV_SD, OP_SVE_VZVV_SD)
(OP_SVE_VZV_SD, OP_SVE_V_SD): Delete.
(aarch64_opcode_table): Add new SVE instructions.
(aarch64_opcode_table): Use imm_rotate{1,2} instead of imm_rotate
for rotation operands.  Add new SVE operands.
* aarch64-asm.h (ins_sve_addr_ri_s4): New inserter.
(ins_sve_quad_index): Likewise.
(ins_imm_rotate): Split into...
(ins_imm_rotate1, ins_imm_rotate2): ...these two inserters.
* aarch64-asm.c (aarch64_ins_imm_rotate): Split into...
(aarch64_ins_imm_rotate1, aarch64_ins_imm_rotate2): ...these two
functions.
(aarch64_ins_sve_addr_ri_s4): New function.
(aarch64_ins_sve_quad_index): Likewise.
(do_misc_encoding): Handle "MOV Zn.Q, Qm".
* aarch64-asm-2.c: Regenerate.
* aarch64-dis.h (ext_sve_addr_ri_s4): New extractor.
(ext_sve_quad_index): Likewise.
(ext_imm_rotate): Split into...
(ext_imm_rotate1, ext_imm_rotate2): ...these two extractors.
* aarch64-dis.c (aarch64_ext_imm_rotate): Split into...
(aarch64_ext_imm_rotate1, aarch64_ext_imm_rotate2): ...these two
functions.
(aarch64_ext_sve_addr_ri_s4): New function.
(aarch64_ext_sve_quad_index): Likewise.
(aarch64_ext_sve_index): Allow quad indices.
(do_misc_decoding): Likewise.
* aarch64-dis-2.c: Regenerate.
* aarch64-opc.h (FLD_SVE_i3h, FLD_SVE_rot1, FLD_SVE_rot2): New
aarch64_field_kinds.
(OPD_F_OD_MASK): Widen by one bit.
(OPD_F_NO_ZR): Bump accordingly.
(get_operand_field_width): New function.
* aarch64-opc.c (fields): Add new SVE fields.
(operand_general_constraint_met_p): Handle new SVE operands.
(aarch64_print_operand): Likewise.
* aarch64-opc-2.c: Regenerate.

gas/
* doc/c-aarch64.texi: Document that sve implies fp16, simd and compnum.
* config/tc-aarch64.c (parse_vector_type_for_operand): Allow .q
to be used with SVE registers.
(parse_operands): Handle new SVE operands.
(aarch64_features): Make "sve" require F16 rather than FP.  Also
require COMPNUM.
* testsuite/gas/aarch64/sve.s: Add tests for new instructions.
Include compnum tests.
* testsuite/gas/aarch64/sve.d: Update accordingly.
* testsuite/gas/aarch64/sve-invalid.s: Add tests for new instructions.
* testsuite/gas/aarch64/sve-invalid.l: Update accordingly.  Also
update expected output for new FMOV and MOV alternatives.

7 years ago sve
Richard Sandiford [Mon, 27 Feb 2017 11:34:51 +0000 (11:34 +0000)] 
  sve

[AArch64] Add a "compnum" feature

This patch adds a named "compnum" feature for the ARMv8.3-A FCADD
and FCMLA extensions.

include/
* opcode/aarch64.h (AARCH64_FEATURE_COMPNUM): New macro.
(AARCH64_ARCH_V8_3): Include AARCH64_FEATURE_COMPNUM.

opcodes/
* aarch64-tbl.h (aarch64_feature_simd_v8_3): Replace with...
(aarch64_feature_compnum): ...this.
(SIMD_V8_3): Replace with...
(COMPNUM): ...this.
(CNUM_INSN): New macro.
(aarch64_opcode_table): Use it for the complex number instructions.

gas/
* doc/c-aarch64.texi: Add a "compnum" entry.
* config/tc-aarch64.c (aarch64_features): Likewise,
* testsuite/gas/aarch64/advsimd-compnum.s: New test.
* testsuite/gas/aarch64/advsimd-compnum.d: Likewise.

7 years ago sve
Richard Sandiford [Mon, 27 Feb 2017 11:34:45 +0000 (11:34 +0000)] 
  sve

[AArch64] Add SVE system registers

This patch adds the SVE-specific system registers.

opcodes/
* aarch64-opc.c (aarch64_sys_regs): Add SVE registers.
(aarch64_sys_reg_supported_p): Handle them.

gas/
* testsuite/gas/aarch64/sve-sysreg.s,
testsuite/gas/aarch64/sve-sysreg.d,
testsuite/gas/aarch64/sve-sysreg-invalid.d,
testsuite/gas/aarch64/sve-sysreg-invalid.l: New tests.

7 years ago sve
Richard Sandiford [Mon, 27 Feb 2017 11:34:39 +0000 (11:34 +0000)] 
  sve

[AArch64] Fix +sve documentation

The documentation entry for the SVE feature incorrectly said that
it was enabled by default for ARMv8-A or later.  This patch fixes
that and also mentions that +sve implies +simd.  (It also implies
+fp, but that follows by transitivity.)

gas/
* doc/c-aarch64.texi: Fix sve entry.

7 years ago[AArch64] Add separate feature flag for weaker release consistent load insns
Richard Sandiford [Mon, 27 Feb 2017 11:27:56 +0000 (11:27 +0000)] 
[AArch64] Add separate feature flag for weaker release consistent load insns

The weaker release consistency support of ARMv8.3-A is allowed as an optional
extension for ARMv8.2-A, so separate command line option and feature flag is
added: -march=armv8.2-a+rcpc turns LDAPR, LDAPRB, LDAPRH instructions on.

opcodes/
2017-01-04  Szabolcs Nagy  <szabolcs.nagy@arm.com>

* aarch64-tbl.h (RCPC, RCPC_INSN): Define.
(aarch64_opcode_table): Use RCPC_INSN.

include/
2017-01-04  Szabolcs Nagy  <szabolcs.nagy@arm.com>

* opcode/aarch64.h (AARCH64_FEATURE_RCPC): Define.
(AARCH64_ARCH_V8_3): Update.

gas/
2017-01-04  Szabolcs Nagy  <szabolcs.nagy@arm.com>

* config/tc-aarch64.c (aarch64_features): Add rcpc.
* doc/c-aarch64.texi (AArch64 Extensions): Document rcpc.
* testsuite/gas/aarch64/ldst-exclusive-armv8_3.d: Rename to ...
* testsuite/gas/aarch64/ldst-rcpc.d: This.
* testsuite/gas/aarch64/ldst-exclusive-armv8_3.s: Rename to ...
* testsuite/gas/aarch64/ldst-rcpc.s: This.
* testsuite/gas/aarch64/ldst-rcpc-armv8_2.d: New test.

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

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

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

7 years agoAutomatic date update in version.in
GDB Administrator [Fri, 24 Feb 2017 00:01:14 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoS/390: Issue error for overflowing relocs.
Andreas Krebbel [Thu, 5 Jan 2017 18:53:14 +0000 (19:53 +0100)] 
S/390: Issue error for overflowing relocs.

Building PIE executable from non-PIC code results in broken binaries.
With this patch the problem is detected at link-time.

bfd/ChangeLog:

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

* elf64-s390.c (elf_s390_relocate_section): Issue error for
non-PLT relocs of shared libary symbol in exectuable.

7 years agoS/390: Add support for new cpu architecture - arch12.
Andreas Krebbel [Mon, 2 Jan 2017 15:40:29 +0000 (16:40 +0100)] 
S/390: Add support for new cpu architecture - arch12.

This adds support of new instructions to the S/390 specific parts.

The important feature of the new instruction set is the support of
single and extended precision floating point vector operations.

Note: arch12 is NOT the official name of the new CPU.  It just
continues the series of archXX options supported as alternate names.
The archXX terminology refers to the edition number of the Principle
of Operations manual.  The official CPU name will be added later while
keeping support of the arch12 for backwards compatibility.

No testsuite regressions.

Committed to mainline.

Bye,

-Andreas-

opcodes/ChangeLog:

2017-02-23  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

* s390-mkopc.c (main): Accept arch12 as cpu string and vx2 as
facility.
* s390-opc.c: Add new operand description macros, new instruction
types, instruction masks, and new .insn instruction types.
* s390-opc.txt: Add new arch12 instructions.

include/ChangeLog:

2017-02-23  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

* opcode/s390.h (enum s390_opcode_cpu_val): New value
S390_OPCODE_ARCH12.
(S390_INSTR_FLAG_VX2): New macro definition.

gas/ChangeLog:

2017-02-23  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

* config/tc-s390.c (s390_parse_cpu): New entry for arch12.
* doc/as.texinfo: Document arch12 as cpu type.
* doc/c-s390.texi: Likewise.
* testsuite/gas/s390/s390.exp: Run arch12 specific tests.
* testsuite/gas/s390/zarch-arch12.d: New test.
* testsuite/gas/s390/zarch-arch12.s: New test.
* testsuite/gas/s390/zarch-z13.d: Rename some mnemonics in the
output patterns.

7 years agoCorrect VLE 16D and SDAREL relocations
Alan Modra [Thu, 23 Feb 2017 01:50:42 +0000 (12:20 +1030)] 
Correct VLE 16D and SDAREL relocations

PR 20744
bfd/
* elf32-ppc.c (ppc_elf_howto_raw): Correct dst_mask on all VLE
16D relocations.
(ppc_elf_vle_split16): Correct field mask and shift for 16D relocs.
(ppc_elf_relocate_section): Correct calculation for VLE SDAREL
relocs.
ld/
* testsuite/ld-powerpc/vle-reloc-2.s: Use r6 for last insn of
each group.
* testsuite/ld-powerpc/vle-reloc-2.d: Update for above change
and sdarel reloc fix.

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

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

7 years agoPowerPC ld segfault on script discarding dynamic sections
Alan Modra [Tue, 21 Feb 2017 21:40:58 +0000 (08:10 +1030)] 
PowerPC ld segfault on script discarding dynamic sections

bfd/
* elf64-ppc.c (ppc64_elf_finish_dynamic_sections): Don't segfault
on .got or .plt output section being discarded by script.
* elf32-ppc.c (ppc_elf_finish_dynamic_sections): Likewise.  Move
vxworks splt temp.
gold/
* powerpc.cc (Target_powerpc::make_iplt_section): Check that
output_section exists before attempting add_output_section_data.
(Target_powerpc::make_brlt_section): Likewise.

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

7 years agoAlpha executables segfault when linked with -z,now
Alan Modra [Mon, 20 Feb 2017 06:50:45 +0000 (17:20 +1030)] 
Alpha executables segfault when linked with -z,now

PR 21181
* elflink.c (bfd_elf_final_link): Make DT_REL/DT_RELA zero
if DT_RELSZ/DT_RELASZ is zero.

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

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

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

7 years agoAutomatic date update in version.in
GDB Administrator [Fri, 17 Feb 2017 00:01:10 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoxfail two ld-unique tests for hppa
Alan Modra [Thu, 16 Feb 2017 14:30:17 +0000 (01:00 +1030)] 
xfail two ld-unique tests for hppa

HPPA doesn't use OSABI of SYSV.

* testsuite/ld-unique/unique.exp: xfail two tests for hppa.

7 years agold testsuite function pointer comparisons vs. hppa
Alan Modra [Thu, 16 Feb 2017 11:49:10 +0000 (22:19 +1030)] 
ld testsuite function pointer comparisons vs. hppa

ld/testsuite/ld-elf/check-ptr-eq.c fails for hppa, since function
pointers may point at plabels.  It isn't valid to cast two function
pointers to void* and then compare the void pointers.

* testsuite/ld-elf/check-ptr-eq.c (check_ptr_eq): Change params
from void pointers to function pointers.
* testsuite/ld-elf/pr18718.c: Update to suit.
* testsuite/ld-elf/pr18720a.c: Update to suit.

7 years agohppa -z relro again
Alan Modra [Tue, 14 Feb 2017 00:15:51 +0000 (10:45 +1030)] 
hppa -z relro again

I misunderstood the hppa alias problem.  File offsets of segments need
to be such that no page is mapped twice with different permissions.
(Which still seems to me like something the kernel could fix, but
anyhow, this is not so difficult to achieve in ld.)

PR 21000
bfd/
* elf-bfd.h (struct elf_backend_data): Add no_page_alias.
* elfxx-target.h (elf_backend_no_page_alias): Define.
(elfNN_bed): Init new field.
* elf.c (assign_file_positions_for_load_sections): If no_page_alias
ensure PT_LOAD segment starts on a new page.
* elf32-hppa.c (elf_backend_no_page_alias): Define.
ld/
* testsuite/ld-elf/loadaddr1.d: Adjust for hppa file offsets.
* testsuite/ld-elf/loadaddr2.d: Likewise.
* testsuite/ld-elf/loadaddr3a.d: Likewise.
* testsuite/ld-scripts/rgn-at5.d: Likewise.

7 years agoPR21132, hppa-linux pie support doesn't work
Alan Modra [Thu, 16 Feb 2017 01:53:12 +0000 (12:23 +1030)] 
PR21132, hppa-linux pie support doesn't work

This fixes a long-standing hppa bug seen when generating PIEs, and I
think possible to trigger with forced local symbols in shared
libraries.  Not allocating enough space for PLT relocs results in ld
writing outside of the buffer.

PR 21132
* elf32-hppa.c (allocate_plt_static): Allocate space for relocs
if pic.

7 years agoFix more powerpc testsuite source errors
Alan Modra [Thu, 16 Feb 2017 04:43:56 +0000 (15:13 +1030)] 
Fix more powerpc testsuite source errors

* testsuite/ld-powerpc/vxworks1-lib.s: Correct addi to addic.
* testsuite/ld-powerpc/vxworks1-lib.dd: Adjust to suit.

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

7 years agoi386: Allow "lea foo@GOT, %reg" in PIC
H.J. Lu [Wed, 15 Feb 2017 19:39:30 +0000 (11:39 -0800)] 
i386: Allow "lea foo@GOT, %reg" in PIC

"lea foo@GOT, %reg" is OK in PIC since it only loads the GOT offset
into register, which can be used later with a GOT base register to
get the value in the GOT entry.

(cherry picked from commit 2a5684011edabf5804abb9e11253a9747587b284)

bfd/

PR ld/21168
* elf32-i386.c (elf_i386_relocate_section): Allow
"lea foo@GOT, %reg" in PIC.

ld/

PR ld/21168
* testsuite/ld-i386/i386.exp: Run pr21168.
* testsuite/ld-i386/pr21168a.c: New file.
* testsuite/ld-i386/pr21168b.S: Likewise.

7 years agoAutomatic date update in version.in users/ARM/embedded-binutils-2_28-branch-2017q1
GDB Administrator [Wed, 15 Feb 2017 00:01:18 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoFix powerpc testsuite source errors
Alan Modra [Tue, 14 Feb 2017 10:00:27 +0000 (20:30 +1030)] 
Fix powerpc testsuite source errors

PR 21118 work exposed these errors in the testsuite.

* testsuite/gas/ppc/cell.s: Correct invalid registers.
* testsuite/gas/ppc/vle-simple-1.s: Likewise.
* testsuite/gas/ppc/vle-simple-2.s: Likewise.

7 years agoUpdate ppc64_elf_gc_mark_dynamic_ref
Alan Modra [Tue, 14 Feb 2017 05:29:13 +0000 (15:59 +1030)] 
Update ppc64_elf_gc_mark_dynamic_ref

* elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref): Support
--gc-keep-exported, and test versioned field of sym rather than
looking for @ in name.

7 years agoAutomatic date update in version.in
GDB Administrator [Tue, 14 Feb 2017 00:01:15 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoDon't use "_gp" on RISC-V, use "_global_pointer$" instead
Palmer Dabbelt [Wed, 8 Feb 2017 19:26:07 +0000 (11:26 -0800)] 
Don't use "_gp" on RISC-V, use "_global_pointer$" instead

"_gp" could conflict with ABI-complient code.  While it's probably OK
because MIPS uses this name, we figured it'd be good to clean this up
before a release with RISC-V in it.

ld/ChangeLog:

2017-02-13  Palmer Dabbelt  <palmer@dabbelt.com>

        * emulparams/elf32lriscv-defs.sh (SDATA_START_SYMBOLS): Change
        _gp to __global_pointer$.

bfd/ChangeLog:

2017-02-13  Palmer Dabbelt  <palmer@dabbelt.com>

        * elfnn-riscv.c (riscv_global_pointer_value): Change _gp to
        __global_pointer$.

7 years agoMIPS/BFD: Respect the ELF gABI dynamic symbol table sort requirement
Maciej W. Rozycki [Thu, 2 Feb 2017 22:05:46 +0000 (22:05 +0000)] 
MIPS/BFD: Respect the ELF gABI dynamic symbol table sort requirement

Ensure all local symbols precede external symbols in the dynamic symbol
table.

No local symbols are expected to make it to the dynamic symbol table
except for section symbols already taken care of, so this is really a
safeguard only against a potential BFD bug otherwise not so harmful,
which may become a grave one due to a symbol table sorting requirement
violation (see PR ld/20828 for an example).  This means however that no
test suite coverage is possible for this change as code introduced here
is not normally expected to trigger.

Logically split then the part of the dynamic symbol table which is not
global offset table mapped, into a local area at the beginning and an
external area following.  By the time `mips_elf_sort_hash_table' is
called we have the number of local dynamic symbol table entries (section
and non-section) already counted in `local_dynsymcount', so use it to
offset the external area from the beginning.

bfd/
* elfxx-mips.c (mips_elf_hash_sort_data): Add
`max_local_dynindx'.
(mips_elf_sort_hash_table): Handle it.
(mips_elf_sort_hash_table_f) <GGA_NONE>: For forced local
symbols bump up `max_local_dynindx' rather than
`max_non_got_dynindx'.

(cherry picked from commit e17b0c351f0b22fb42edf34e5a6e486d72e9ee05)

7 years agoMIPS/BFD: Use `bfd_size_type' for dynamic symbol table indices
Maciej W. Rozycki [Thu, 2 Feb 2017 21:43:26 +0000 (21:43 +0000)] 
MIPS/BFD: Use `bfd_size_type' for dynamic symbol table indices

Use the `bfd_size_type' data type for dynamic symbol table indices in
the MIPS backend, in line with generic code and removing the need to use
a cast.

bfd/
* elfxx-mips.c (mips_elf_hash_sort_data): Convert the
`min_got_dynindx', `max_unref_got_dynindx' and
`max_non_got_dynindx' members to the `bfd_size_type' data type.
(mips_elf_sort_hash_table): Adjust accordingly.

(cherry picked from commit 55f8b9d243dbd879ffa585f7e0c7d8b6b819302d)

7 years agoMIPS/BFD: Streamline hash table references in `mips_elf_sort_hash_table'
Maciej W. Rozycki [Thu, 2 Feb 2017 21:30:27 +0000 (21:30 +0000)] 
MIPS/BFD: Streamline hash table references in `mips_elf_sort_hash_table'

Make all hash table references throughout `mips_elf_sort_hash_table' use
`htab', simplifying code and improving readability.

bfd/
* elfxx-mips.c (mips_elf_sort_hash_table): Use `htab' throughout
to access the hash table.

(cherry picked from commit 0f8c4b60ef3953a2373992e468106ae833049fff)

7 years agoMIPS/BFD: Fix assertion in `mips_elf_sort_hash_table'
Maciej W. Rozycki [Thu, 2 Feb 2017 20:53:16 +0000 (20:53 +0000)] 
MIPS/BFD: Fix assertion in `mips_elf_sort_hash_table'

Move the assertion on non-NULL `htab' in `mips_elf_sort_hash_table' to
the beginning, before the pointer is dereferenced (`mips_elf_hash_table
(info)' and `elf_hash_table (info)' both point to the same memory
location, differently typed).

bfd/
* elfxx-mips.c (mips_elf_sort_hash_table): Move assertion on
non-NULL `htab' to the beginning.

(cherry picked from commit 17a80fa80adbe79df39ba1fc70e611dff92df197)

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

7 years agoAutomatic date update in version.in
GDB Administrator [Sun, 12 Feb 2017 00:01:18 +0000 (00:01 +0000)] 
Automatic date update in version.in

7 years agoFix use after free in cgen instruction lookup
Alan Modra [Sat, 11 Feb 2017 06:47:59 +0000 (17:17 +1030)] 
Fix use after free in cgen instruction lookup

* cgen-opc.c (cgen_lookup_insn): Delete buf and base_insn temps.
Use insn_bytes_value and insn_int_value directly instead.  Don't
free allocated memory until function exit.

7 years agoPOWER9 add scv/rfscv instruction support
Nicholas Piggin [Fri, 10 Feb 2017 04:18:23 +0000 (14:18 +1000)] 
POWER9 add scv/rfscv instruction support

opcodes/
* ppc-opc.c (powerpc_opcodes) <scv, rfscv>: New mnemonics.

gas/
* testsuite/gas/ppc/power9.d <scv, rfscv>: New tests.

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

7 years agoAutomatic date update in version.in
GDB Administrator [Fri, 10 Feb 2017 00:01:05 +0000 (00:01 +0000)] 
Automatic date update in version.in

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

7 years agoAutomatic date update in version.in
GDB Administrator [Wed, 8 Feb 2017 00:01:06 +0000 (00:01 +0000)] 
Automatic date update in version.in

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

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

7 years agoAutomatic date update in version.in
GDB Administrator [Sun, 5 Feb 2017 00:01:05 +0000 (00:01 +0000)] 
Automatic date update in version.in

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

7 years ago[GOLD] PowerPC64 TOC indirect to TOC relative segfault
Alan Modra [Fri, 3 Feb 2017 08:48:37 +0000 (19:18 +1030)] 
[GOLD] PowerPC64 TOC indirect to TOC relative segfault

* powerpc.cc (Powerpc_relobj::make_toc_relative): Don't crash
when no .toc section exists.

7 years agoSupport -z relro on hppa
Alan Modra [Fri, 3 Feb 2017 06:19:47 +0000 (16:49 +1030)] 
Support -z relro on hppa

PR ld/21000
* emulparams/hppalinux.sh (DATA_ADDR, SHLIB_DATA_ADDR): Don't define.
(DATA_SEGMENT_ALIGN, DATA_SEGMENT_END, DATA_SEGMENT_RELRO_END): Define.
* scripttempl/elf.sc: Don't define the above if DATA_SEGMENT_ALIGN
is already defined.

7 years agoDon't make symbols dynamic other than undef weak
Alan Modra [Fri, 3 Feb 2017 06:19:29 +0000 (16:49 +1030)] 
Don't make symbols dynamic other than undef weak

Fixes: tmpdir/pr14525: symbol lookup error: tmpdir/pr14525: undefined
symbol: __executable_start
FAIL: PIE PR ld/14525

* elf32-hppa.c (ensure_undef_weak_dynamic): New function.
(allocate_plt_static, allocate_dynrelocs): Use it.

7 years agoSet SHF_INFO_LINK for .PARISC.unwind
Alan Modra [Fri, 3 Feb 2017 06:19:02 +0000 (16:49 +1030)] 
Set SHF_INFO_LINK for .PARISC.unwind

This flag should be set for any section header using sh_info to
point to another section.

Fixes a readelf warning about an unexpected value in info field,
resulting in FAIL: Build warn libbar.so

* elf-hppa.h (elf_hppa_fake_sections): Set SHF_INFO_LINK for
.PARISC.unwind section.

7 years agoFix PR ld/20995 for cris-linux
Hans-Peter Nilsson [Fri, 3 Feb 2017 00:23:16 +0000 (01:23 +0100)] 
Fix PR ld/20995 for cris-linux

* elf32-cris.c (elf_cris_finish_dynamic_symbol): Remove now unused
local variable dynobj.

PR ld/20995
* elf32-cris.c (elf_cris_size_dynamic_sections): Handle sdynrelro.
(elf_cris_adjust_dynamic_symbol): Place variables copied into the
executable from read-only sections into sdynrelro.
(elf_cris_finish_dynamic_symbol): Select sreldynrelro for
dynamic relocs in sdynrelro.
(elf_backend_want_dynrelro): Define.

7 years agoPR binutils/19935: Fix fallout from now-default initfini-array.
Hans-Peter Nilsson [Fri, 3 Feb 2017 00:14:27 +0000 (01:14 +0100)] 
PR binutils/19935: Fix fallout from now-default initfini-array.

* emulparams/criself.sh (USER_LABEL_PREFIX): Define.
(OTHER_END_SYMBOLS, ENTRY): Delete now-redundant defines.

7 years agoAutomatic date update in version.in
GDB Administrator [Fri, 3 Feb 2017 00:01:10 +0000 (00:01 +0000)] 
Automatic date update in version.in

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

7 years agoMIPS/LD/testsuite: Correct relocation addends in VxWorks tests
Maciej W. Rozycki [Wed, 1 Feb 2017 22:09:33 +0000 (22:09 +0000)] 
MIPS/LD/testsuite: Correct relocation addends in VxWorks tests

Fix commit 171191bac50e ("Add support for STT_IFUNC"),
<https://sourceware.org/ml/binutils/2008-12/msg00052.html>, commit
e04d7088afe0 ("PR ld/14088: Always display addend as signed hex
number"), <https://sourceware.org/ml/binutils/2012-05/msg00123.html> and
commit 343dbc36ffae ("Print addend as signed in objdump"),
<https://sourceware.org/ml/binutils/2012-05/msg00163.html> regressions:

FAIL: VxWorks executable test 1 (dynamic)
FAIL: ld-mips-elf/vxworks-forced-local-1

seen with `mips-vxworks' and `mipsel-vxworks' targets and adjust dump
patterns according to changes made to the presentation of relocation
addends in `readelf -r' and `objdump -r' output.

ld/
* testsuite/ld-mips-elf/vxworks-forced-local-1.d: Correct the
presentation of relocation addends.
* testsuite/ld-mips-elf/vxworks1-lib.rd: Likewise.
* testsuite/ld-mips-elf/vxworks1.dd: Likewise.
* testsuite/ld-mips-elf/vxworks1.rd: Likewise.

(cherry picked from commit c0c237fcdd133e84e67657cc6b7e4678f106bdcb)

7 years agoMIPS/LD/testsuite: Fix a `tls-multi-got-1-1.s' build failure
Maciej W. Rozycki [Wed, 1 Feb 2017 22:08:02 +0000 (22:08 +0000)] 
MIPS/LD/testsuite: Fix a `tls-multi-got-1-1.s' build failure

Correct a commit ec9ab52c3217 ("gas: consistently emit diagnostics for
non-zero data emission to .bss/.struct"),
<https://sourceware.org/ml/binutils/2015-12/msg00073.html> regression:

.../ld/testsuite/ld-mips-elf/tls-multi-got-1-1.s: Assembler messages:
.../ld/testsuite/ld-mips-elf/tls-multi-got-1-1.s:39: Error: attempt to store non-zero value in section `.tbss'
ERROR: -EB -march=mips1 -32 -KPIC .../ld/testsuite/ld-mips-elf/tls-multi-got-1-1.s: assembly failed
UNRESOLVED: Shared library with multiple GOTs and TLS

in MIPS target testing and move `tlsvar_ld' to `.tdata' section, in line
with the remaining local dynamic definitions introduced with the set of
tests added with commit f4e584bd00f1 ("TLS support for MIPS"),
<https://sourceware.org/ml/binutils/2005-02/msg00607.html>.

ld/
* testsuite/ld-mips-elf/tls-multi-got-1-1.s: Place `tlsvar_ld'
in `.tdata' section.
* testsuite/ld-mips-elf/tls-multi-got-1.got: Adjust accordingly.
* testsuite/ld-mips-elf/tls-multi-got-1.r: Likewise.

(cherry picked from commit 5139cfdb5515407900d0c3934c13712a5819456c)

7 years agoRISC-V gas: Remove em=linux from configure.tgt
Sebastian Huber [Thu, 19 Jan 2017 08:10:51 +0000 (09:10 +0100)] 
RISC-V gas: Remove em=linux from configure.tgt

The use of te-linux.h is unnecessary since the TE_LINUX define is unused
and LOCAL_LABELS_FB is defined to 1 in tc-riscv.h as well.

gas/
* configure.tgt (riscv*-*-*): Remove em=linux.

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

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

7 years agoMIPS: Add options to control branch ISA checks
Maciej W. Rozycki [Mon, 30 Jan 2017 17:11:22 +0000 (17:11 +0000)] 
MIPS: Add options to control branch ISA checks

Complement commit 9d862524f6ae ("MIPS: Verify the ISA mode and alignment
of branch and jump targets") and add GAS and LD options to control the
checks for invalid branches between ISA modes introduced there, to help
with some handwritten code lacking `.insn' annotation for labels used as
branch targets and code produced by older versions of GCC which suffers
from the issue with branches to code that has been optimized away,
addressed with GCC commit 242424 ("MIPS/GCC: Mark trailing labels with
`.insn'"), <https://gcc.gnu.org/ml/gcc-patches/2016-11/msg01061.html>.

bfd/
* elfxx-mips.h (_bfd_mips_elf_insn32): Rename prototype to...
(_bfd_mips_elf_linker_flags): ... this.  Add another parameter.
* elfxx-mips.c (mips_elf_link_hash_table): Add
`ignore_branch_isa' member.
(mips_elf_perform_relocation): Do not treat an ISA mode mismatch
in branch relocation calculation as an error if
`ignore_branch_isa' has been set.
(_bfd_mips_elf_insn32): Rename to...
(_bfd_mips_elf_linker_flags): ... this.  Rename the `on'
parameter to `insn32' and add an `ignore_branch_isa' parameter.
Handle the new parameter.

gas/
* config/tc-mips.c (mips_ignore_branch_isa): New variable.
(options): Add OPTION_IGNORE_BRANCH_ISA and
OPTION_NO_IGNORE_BRANCH_ISA enum values.
(md_longopts): Add "mignore-branch-isa" and
"mno-ignore-branch-isa" options.
(md_parse_option): Handle OPTION_IGNORE_BRANCH_ISA and
OPTION_NO_IGNORE_BRANCH_ISA.
(fix_bad_cross_mode_branch_p): Return FALSE if
`mips_ignore_branch_isa' has been set.
(md_show_usage): Add `-mignore-branch-isa' and
`-mno-ignore-branch-isa'.

* doc/as.texinfo (Target MIPS options): Add
`-mignore-branch-isa' and `-mno-ignore-branch-isa' options.
(-mignore-branch-isa, -mno-ignore-branch-isa): New options.
* doc/c-mips.texi (MIPS Options): Add `-mignore-branch-isa' and
`-mno-ignore-branch-isa' options.

* testsuite/gas/mips/branch-local-ignore-2.d: New test.
* testsuite/gas/mips/branch-local-ignore-3.d: New test.
* testsuite/gas/mips/branch-local-ignore-n32-2.d: New test.
* testsuite/gas/mips/branch-local-ignore-n32-3.d: New test.
* testsuite/gas/mips/branch-local-ignore-n64-2.d: New test.
* testsuite/gas/mips/branch-local-ignore-n64-3.d: New test.
* testsuite/gas/mips/mips.exp: Run the new tests.

ld/
* emultempl/mipself.em (ignore_branch_isa): New variable.
(mips_create_output_section_statements): Rename
`_bfd_mips_elf_insn32' called to `_bfd_mips_elf_linker_flags',
add `ignore_branch_isa' argument.
(PARSE_AND_LIST_PROLOGUE): Add OPTION_IGNORE_BRANCH_ISA and
OPTION_NO_IGNORE_BRANCH_ISA enum values.
(PARSE_AND_LIST_LONGOPTS): Add "ignore-branch-isa" and
"no-ignore-branch-isa" options.
(PARSE_AND_LIST_OPTIONS): Add `--ignore-branch-isa' and
`--no-ignore-branch-isa'.
(PARSE_AND_LIST_ARGS_CASES): Handle OPTION_IGNORE_BRANCH_ISA and
OPTION_NO_IGNORE_BRANCH_ISA.

* ld.texinfo (Options specific to MIPS targets): Add
`--ignore-branch-isa' and `--no-ignore-branch-isa' options.
(ld and the MIPS family): Likewise.

* testsuite/ld-mips-elf/bal-jalx-pic-ignore.d: New test.
* testsuite/ld-mips-elf/bal-jalx-pic-ignore-n32.d: New test.
* testsuite/ld-mips-elf/bal-jalx-pic-ignore-n64.d: New test.
* testsuite/ld-mips-elf/unaligned-branch-ignore-2.d: New test.
* testsuite/ld-mips-elf/unaligned-branch-ignore-r6-1: New test.
* testsuite/ld-mips-elf/unaligned-branch-ignore-mips16: New
test.
* testsuite/ld-mips-elf/unaligned-branch-ignore-micromips: New
test.
* testsuite/ld-mips-elf/mips-elf.exp: Run the new tests.

(cherry picked from commit 8b10b0b3e100c25322a083248c7a18bf5a1f3527)

7 years agoMIPS/GAS/testsuite: Convert branch local list tests to dump tests
Maciej W. Rozycki [Mon, 30 Jan 2017 17:10:31 +0000 (17:10 +0000)] 
MIPS/GAS/testsuite: Convert branch local list tests to dump tests

gas/
* testsuite/gas/mips/branch-local-2.d: New test.
* testsuite/gas/mips/branch-local-3.d: New test.
* testsuite/gas/mips/branch-local-n32-2.d: New test.
* testsuite/gas/mips/branch-local-n32-3.d: New test.
* testsuite/gas/mips/branch-local-n64-2.d: New test.
* testsuite/gas/mips/branch-local-n64-3.d: New test.
* testsuite/gas/mips/mips.exp: Fold corresponding list tests
into the new tests.

(cherry picked from commit 7795a8f8bdde2fa5c0e0639b92280314b32ec78d)

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

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

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

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

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

7 years agoAutomatic date update in version.in
GDB Administrator [Wed, 25 Jan 2017 00:02:38 +0000 (00:02 +0000)] 
Automatic date update in version.in

7 years agoSolaris2/LD: Fix anonymous version script acceptance bug
Maciej W. Rozycki [Mon, 23 Jan 2017 11:37:19 +0000 (11:37 +0000)] 
Solaris2/LD: Fix anonymous version script acceptance bug

Correct a bug in Solaris 2 linker emulation code triggered by a test
introduced with commit 81ff47b3a546 ("PR ld/20828: Fix linker script
symbols wrongly forced local with section GC") and only create implicit
version nodes if versioning is actually introduced with a version script
(or VERSION command) rather than only global vs local symbol visibility
selected, fixing an:

ld: anonymous version tag cannot be combined with other version tags

linker error produced whenever a version script (or VERSION command) is
used that does not assign symbol versions, such as:

{ global: foo; bar; local: *; };

and consequently removing a:

FAIL: PR ld/20828 dynamic symbols with section GC (version script)

test suite failure with the `x86_64-solaris2' target.

ld/
* emultempl/solaris2.em (elf_solaris2_before_allocation): Do not
add implicit version nodes if an anonymous version tag is being
used.

(cherry picked from commit 1a792e1c00e07a1e644145a9f71446cf2e75e9ab)

7 years agoMake the sh_info field of .rel.plt point to .plt (MIPS).
Vladimir Radosavljevic [Tue, 24 Jan 2017 01:18:00 +0000 (17:18 -0800)] 
Make the sh_info field of .rel.plt point to .plt (MIPS).

gold/
* mips.cc (Mips_output_data_plt::rel_plt): Remove const from return
type.
(Target_mips::make_plt_entry): Make the sh_info field of .rel.plt
point to .plt.

7 years agoFix MIPS GOT when global symbols are forced to local visibility.
Vladimir Radosavljevic [Tue, 24 Jan 2017 01:12:10 +0000 (17:12 -0800)] 
Fix MIPS GOT when global symbols are forced to local visibility.

gold/
PR gold/21054
* mips.cc (Mips_got_info::record_global_got_symbol): Don't add symbol
to the dynamic symbol table if it is forced to local visibility.
(Target_mips::do_finalize_sections): Don't add __RLD_MAP symbol to the
dynamic symbol table if it is forced to local visibility.

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

7 years agoPR ld/20828: Work around RISC-V failures
Maciej W. Rozycki [Mon, 23 Jan 2017 11:21:19 +0000 (11:21 +0000)] 
PR ld/20828: Work around RISC-V failures

Complement commit 81ff47b3a546 ("PR ld/20828: Fix linker script symbols
wrongly forced local with section GC") and add `.plt' to the list of
output sections created, fixing:

FAIL: PR ld/20828 dynamic symbols with section GC (auxiliary shared library)
FAIL: PR ld/20828 dynamic symbols with section GC (plain)
FAIL: PR ld/20828 dynamic symbols with section GC (version script)

failures with `riscv32-elf', `riscv32-linux', `riscv64-elf' and
`riscv64-linux' targets caused by LD crashing in the absence of such a
section.

ld/
PR ld/20828
* testsuite/ld-elf/pr20828.ld: Add `.plt'.

(cherry picked from commit 1e5f45bb15d287ed763b7b638254424149040f7a)

7 years agoPR ld/20828: Remove leading `_' from symbols used in tests
Maciej W. Rozycki [Mon, 23 Jan 2017 11:19:46 +0000 (11:19 +0000)] 
PR ld/20828: Remove leading `_' from symbols used in tests

Complement commit 81ff47b3a546 ("PR ld/20828: Fix linker script symbols
wrongly forced local with section GC") and remove the leading underscore
from `_fdata' and `_edata' symbols used in tests, fixing a:

FAIL: PR ld/20828 dynamic symbols with section GC (version script)

failure with targets such as: `bfin-elf', `bfin-uclinux', `metag-elf',
`metag-linux' `mn10300-elf', `sh-elf', `sh64-elf', and possibly other
ones, that have `_' set (with `elf_symbol_leading_char') as the leading
character for symbols.  As from commit 93252b1cf41a ("bfd/ld: handle ABI
prefixes in version scripts") these targets strip the leading underscore
before applying version script rules, because the (default) syntax for
symbol names is that of the C language rather than their low-level
symbol table encoding.

ld/
PR ld/20828
* testsuite/ld-elf/pr20828.ld: Rename `_fdata' and `_edata' to
`fdata' and `edata' respectively.
* testsuite/ld-elf/pr20828.ver: Adjust accordingly.
* testsuite/ld-elf/pr20828-a.sd: Likewise.
* testsuite/ld-elf/pr20828-b.sd: Likewise.
* testsuite/ld-elf/pr20828-c.sd: Likewise.

(cherry picked from commit fda46c417ff8324960ca305141df5fc6c2f580af)

7 years agoPR ld/20828: Relax symbol ordering in tests
Maciej W. Rozycki [Mon, 23 Jan 2017 11:18:33 +0000 (11:18 +0000)] 
PR ld/20828: Relax symbol ordering in tests

Complement commit 81ff47b3a546 ("PR ld/20828: Fix linker script symbols
wrongly forced local with section GC") and make tests check for the
presence of global `_fdata' and `_edata' symbols separately, removing
any dependency on symbol table ordering for tests to succeed and
removing:

FAIL: PR ld/20828 dynamic symbols with section GC (auxiliary shared library)
FAIL: PR ld/20828 dynamic symbols with section GC (plain)

failures with the `x86_64-solaris2' target, which has additional
intervening entries:

Symbol table '.dynsym' contains 6 entries:
   Num:    Value          Size Type    Bind   Vis      Ndx Name
     0: 0000000000000000     0 NOTYPE  LOCAL  DEFAULT  UND
     1: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT    1 _fdata
     2: 0000000000000000     0 OBJECT  GLOBAL DEFAULT    1 _DYNAMIC
     3: 0000000000000000     0 OBJECT  GLOBAL DEFAULT  ABS _PROCEDURE_LINKAGE_TABLE_
     4: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT    1 _edata
     5: 00000000000001b8     0 OBJECT  GLOBAL DEFAULT    4 _GLOBAL_OFFSET_TABLE_

Rename dump pattern files accordingly for consistency.

ld/
PR ld/20828
* testsuite/ld-elf/pr20828-1.sd: Remove test.
* testsuite/ld-elf/pr20828-a.sd: New test.
* testsuite/ld-elf/pr20828-2a.sd: Rename test to...
* testsuite/ld-elf/pr20828-b.sd: ... this.
* testsuite/ld-elf/pr20828-2b.sd: Rename test to...
* testsuite/ld-elf/pr20828-c.sd: ... this.
* testsuite/ld-elf/shared.exp: Adjust accordingly.

(cherry picked from commit adcbdc63e5ccf663dacc8493cec63a95b653285e)

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

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

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

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

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

7 years agoPR ld/20995: MIPS: Set GAS flags correctly for tests
Maciej W. Rozycki [Wed, 18 Jan 2017 18:07:58 +0000 (18:07 +0000)] 
PR ld/20995: MIPS: Set GAS flags correctly for tests

Complement commit 9acc85a62eb7 ("Use dynrelro for symbols in relro
sections too").

ld/
PR ld/20995
* testsuite/ld-elf/elf.exp: Set GAS flags correctly for the
`mips*-*-*' target and `pr20995' and `pr20995-2' tests.

(cherry picked from commit 6984613a53528c818482c3a531e17a86bac6e7dc)

7 years agoPR ld/20828: Fix linker script symbols wrongly forced local with section GC
Maciej W. Rozycki [Mon, 16 Jan 2017 22:10:57 +0000 (22:10 +0000)] 
PR ld/20828: Fix linker script symbols wrongly forced local with section GC

Fix a generic ELF linker regression introduced with a chain of changes
made to unused input section garbage collection:

- commit 1a766c6843ce ("Also hide symbols without PLT nor GOT
  references."),
  <https://sourceware.org/ml/binutils/2011-09/msg00076.html>,

- commit 1d5316ab67e1 ("PR ld/13177: garbage collector retains zombie
  references to external libraries"),
  <https://sourceware.org/ml/binutils/2011-10/msg00161.html>,

- commit 6673f753c019 ("Fix PR 12772, garbage collection of dynamic
  syms"), <https://sourceware.org/ml/binutils/2011-12/msg00077.html>,

causing the garbage collection of unused symbols present in a DSO
involved in a link to make identically named symbols ordinarily defined
(i.e. not hidden or PROVIDEd) by a linker script local, even though the
latter symbols are supposed to be global as if no DSO defined them as
well.

This is because linker script assignments are processed very late as
`lang_process' proceeds, down in the call to `ldemul_before_allocation',
which is made after the call to `lang_gc_sections' to do input section
garbage collecting.  Consequently if unused, then any such DSO-defined
symbol has already been garbage-collected and internally marked local.
It would ordinarily be removed from dynamic symbol table output, however
a linker script assignment correctly replaces its original definition
with the new one and enters it into the dynamic symbol table produced as
it is supposed to be exported.  The original local marking is however
retained making the symbol local in the dynamic symbol table and
therefore not available externally.  This also causes a sorting problem
with the MIPS target, which does not expect non-section local dynamic
symbols to be output and produces an invalid binary.

Fix the problem then, by removing the `forced_local' marking for the
offending case and add suitable test cases.  First to verify that unused
symbols ordinarily defined with linker script assignments remain
exported in the context of input section garbage collection whether or
not a DSO defining identically named symbols is present in the link.
Second that a linker version script still correctly retains or removes
such symbols as requested.

bfd/
PR ld/20828
* elflink.c (bfd_elf_record_link_assignment): Clear any
`forced_local' marking for DSO symbols that are not being
provided.

ld/
PR ld/20828
* testsuite/ld-elf/pr20828-1.sd: New test.
* testsuite/ld-elf/pr20828-2a.sd: New test.
* testsuite/ld-elf/pr20828-2b.sd: New test.
* testsuite/ld-elf/pr20828.ld: New test linker script.
* testsuite/ld-elf/pr20828.ver: New test version script.
* testsuite/ld-elf/pr20828.s: New test source.
* testsuite/ld-elf/shared.exp: Run the new test.

(cherry picked from commit 81ff47b3a54633819fac4d973e34f1ff0c65606e)

7 years agoPR gas/20649: MIPS: Fix GOT16/LO16 reloc pairing with comdat sections
Maciej W. Rozycki [Wed, 18 Jan 2017 18:18:21 +0000 (18:18 +0000)] 
PR gas/20649: MIPS: Fix GOT16/LO16 reloc pairing with comdat sections

Correct a regression from commit 8614eeee67f9 ("Traditional MIPS
patches"), <https://sourceware.org/ml/binutils/2000-07/msg00018.html>,
which caused symbols in linkonce or what is these days known as comdat
sections to be treated as external for the purpose of PIC relocation
generation even if their binding remains STB_LOCAL.  This in turn
disabled GOT16/LO16 relocation pairing with references to such symbols,
as no complementing LO16 relocation is expected for external GOT16
references in the o32 ABI, which ultimately leads to link errors, e.g.:

ld: comdat-reloc.o: Can't find matching LO16 reloc against `foo' for R_MIPS_GOT16 at 0x24 in section `.text.bar[bar]'

as with the LD test case included with this change.

Revert the special case for symbols in comdat sections then, making code
actually match `adjust_reloc_syms' as indicated in its explanatory
comment, and adjust calling code accordingly.  Also bring back the
corresponding description of what now is `s_is_linkonce', lost with
commit 5f0fe04bc550 ("Improved MIPS16/MIPS32 code intermixing for
gas."), <https://www.sourceware.org/ml/binutils/2006-07/msg00039.html>.

gas/
PR gas/20649
* config/tc-mips.c (pic_need_relax): Don't check for linkonce
symbols, remove the `segtype' parameter.
(mips_frob_file, md_estimate_size_before_relax): Adjust
accordingly.
(s_is_linkonce): Add an explanatory comment.
* testsuite/gas/mips/comdat-reloc.d: New test.
* testsuite/gas/mips/comdat-reloc.s: New test source.
* testsuite/gas/mips/mips.exp: Run the new test.

ld/
PR gas/20649
* testsuite/ld-mips-elf/mips-elf.exp: Add PIC comdat GOT16/LO16
relocation pairing link test.

(cherry picked from commit 9e009953a54bfbf79d83f37797f846c923aeea43)

7 years agoFix lex source files so that they will be accepted by flex v2.6.3
Bernhard Rosenkranzer [Wed, 18 Jan 2017 14:14:54 +0000 (14:14 +0000)] 
Fix lex source files so that they will be accepted by flex v2.6.3

PR 21059
binutils* config/bfin-lex.l: Support processing with flex 2.6.3.
* itbl-lex.l: Likewise.

gas * arlex.l: Support processing with flex 2.6.3.
* deflex.l: Likewise.
* syslex.l: Likewise.

ld * ldlex.l: Support processing with flex 2.6.3.

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

7 years agoRISC-V/GAS: Support more relocs against constant addresses
Andrew Waterman [Thu, 22 Dec 2016 02:05:28 +0000 (18:05 -0800)] 
RISC-V/GAS: Support more relocs against constant addresses

Previously, some pseudoinstructions like "call" only accepted
symbolic addresses and rejected constant addresses with an
esoteric internal error.  This patch enables them by deferring
application of constant relocations to md_apply_fix, rather than
eagerly applying them during instruction assembly.

gas/ChangeLog

2017-01-09  Andrew Waterman <andrew@sifive.com>

* config/tc-riscv.c (append_insn): Don't eagerly apply relocations
against constants.
(md_apply_fix): Mark relocations against constants as "done."

7 years agoRISC-V/GAS: Improve handling of invalid relocs
Andrew Waterman [Wed, 21 Dec 2016 20:47:13 +0000 (12:47 -0800)] 
RISC-V/GAS: Improve handling of invalid relocs

TLS relocs against constants previously segfaulted, and illegal
symbol subtractions were silently ignored.

The previous behavior was to segfault.

gas/ChangeLog

2017-01-09  Andrew Waterman <andrew@sifive.com>

* config/tc-riscv.c (md_apply_fix): Report TLS relocations against
constants.  Report disallowed symbol subtractions.