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

8 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.

8 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)

8 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

8 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.

8 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.

8 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.

8 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

8 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.

8 years agoAutomatic date update in version.in
GDB Administrator [Mon, 31 Jul 2017 00:01:19 +0000 (00:01 +0000)] 
Automatic date update in version.in

8 years agoAutomatic date update in version.in
GDB Administrator [Sun, 30 Jul 2017 00:01:47 +0000 (00:01 +0000)] 
Automatic date update in version.in

8 years agoPR 21847, Don't default PowerPC64 to --plt-localentry
Alan Modra [Sat, 29 Jul 2017 03:03:35 +0000 (12:33 +0930)] 
PR 21847, Don't default PowerPC64 to --plt-localentry

The big comment in ppc64_elf_tls_setup says why.  I've also added some
code to the bfd linker that catches the -lpthread -lc symbol
differences and disable generation of optimized call stubs even when
--plt-localentry is activated.  Gold doesn't yet have that.

PR 21847
bfd/
* elf64-ppc.c (struct ppc_link_hash_entry): Add non_zero_localentry.
(ppc64_elf_merge_symbol): Set non_zero_localentry.
(is_elfv2_localentry0): Test non_zero_localentry.
(ppc64_elf_tls_setup): Default to --no-plt-localentry.
gold/
* powerpc.cc (Target_powerpc::scan_relocs): Default to
--no-plt-localentry.
ld/
* ld.texinfo (plt-localentry): Document.

8 years agoAutomatic date update in version.in
GDB Administrator [Sat, 29 Jul 2017 00:01:49 +0000 (00:01 +0000)] 
Automatic date update in version.in

8 years agogold: Add put_ch_reserved to 64-bit Chdr_write
H.J. Lu [Fri, 28 Jul 2017 20:39:42 +0000 (13:39 -0700)] 
gold: Add put_ch_reserved to 64-bit Chdr_write

The 64-bit ELF compression header has a reserved field.  It should be
cleared to avoid random bits in it.

elfcpp/

PR gold/21857
* elfcpp.h (Chdr_write): Add put_ch_reserved.
(Chdr_write<64, true>::put_ch_reserved): New.
(Chdr_write<64, false>::put_ch_reserved): Likewise.

gold/

PR gold/21857
* compressed_output.cc (Output_compressed_section::set_final_data_size):
Call put_ch_reserved to clear the reserved field for 64-bit ELF.

(cherry picked from commit 49ba15a23a9d3d8a109ce2fd5053822eee7f1fdf)

8 years agoAutomatic date update in version.in
GDB Administrator [Fri, 28 Jul 2017 00:01:34 +0000 (00:01 +0000)] 
Automatic date update in version.in

8 years agoMove AVR .progmemx.* sections to higher memory.
Georg-Johann Lay [Thu, 27 Jul 2017 13:20:50 +0000 (14:20 +0100)] 
Move AVR .progmemx.* sections to higher memory.

PR ld/21849
* scripttempl/avr.sc: Split .progmemx.* from .progmem.* and locate
former at a higher address.

8 years agoAutomatic date update in version.in
GDB Administrator [Thu, 27 Jul 2017 00:01:59 +0000 (00:01 +0000)] 
Automatic date update in version.in

8 years agoGold: Fix mips.cc for GCC 4.2
H.J. Lu [Wed, 26 Jul 2017 17:39:20 +0000 (10:39 -0700)] 
Gold: Fix mips.cc for GCC 4.2

GCC 4.2 fails to compile "(uint64_t) 0x800080008000" with

error: integer constant is too large for ‘long’ type

This patch adds "llu" suffix to 0x800080008000 for GCC 4.2.

* mips.cc (Mips_relocate_functions): Add "llu" suffix to
0x800080008000.

(cherry picked from commit 104f0515d038716599728f8e2b58aefe3fc188aa)

8 years agoAutomatic date update in version.in
GDB Administrator [Wed, 26 Jul 2017 00:01:32 +0000 (00:01 +0000)] 
Automatic date update in version.in

8 years agoUpdated French translation for the BFD library.
Nick Clifton [Tue, 25 Jul 2017 08:48:28 +0000 (09:48 +0100)] 
Updated French translation for the BFD library.

8 years agoAutomatic date update in version.in
GDB Administrator [Tue, 25 Jul 2017 00:03:01 +0000 (00:03 +0000)] 
Automatic date update in version.in

8 years agoBump version to 2.29.0
Tristan Gingold [Mon, 24 Jul 2017 10:53:49 +0000 (12:53 +0200)] 
Bump version to 2.29.0

bfd/
2017-07-24  Tristan Gingold  <gingold@adacore.com>

* version.m4: Bump version to 2.29.0
* configure: Regenerate.

binutils/
2017-07-24  Tristan Gingold  <gingold@adacore.com>

* configure: Regenerate.

gas/
2017-07-24  Tristan Gingold  <gingold@adacore.com>

* configure: Regenerate.

gprof/
2017-07-24  Tristan Gingold  <gingold@adacore.com>

* configure: Regenerate.

ld/
2017-07-24  Tristan Gingold  <gingold@adacore.com>

* configure: Regenerate.

opcodes/
2017-07-24  Tristan Gingold  <gingold@adacore.com>

* configure: Regenerate.

8 years agoBump version to 2.29 binutils-2_29
Tristan Gingold [Mon, 24 Jul 2017 10:30:28 +0000 (12:30 +0200)] 
Bump version to 2.29

bfd/
2017-07-24  Tristan Gingold  <gingold@adacore.com>

* version.m4: Bump version to 2.29
* configure: Regenerate.

binutils/
2017-07-24  Tristan Gingold  <gingold@adacore.com>

* configure: Regenerate.

gas/
2017-07-24  Tristan Gingold  <gingold@adacore.com>

* configure: Regenerate.

gprof/
2017-07-24  Tristan Gingold  <gingold@adacore.com>

* configure: Regenerate.

ld/
2017-07-24  Tristan Gingold  <gingold@adacore.com>

* configure: Regenerate.

opcodes/
2017-07-24  Tristan Gingold  <gingold@adacore.com>

* configure: Regenerate.

8 years agoAutomatic date update in version.in
GDB Administrator [Mon, 24 Jul 2017 00:01:49 +0000 (00:01 +0000)] 
Automatic date update in version.in

8 years agoCorrect eh_frame info for __glink_PLTresolve
Alan Modra [Sun, 23 Jul 2017 10:33:40 +0000 (20:03 +0930)] 
Correct eh_frame info for __glink_PLTresolve

My PPC64_OPT_LOCALENTRY patch of June 1, git commit f378ab099d, and
the later gold change, git commit 7ee7ff7015, added an insn in
__glink_PLTresolve which needs a corresponding adjustment in the
eh_frame info for asynchronous exceptions to unwind correctly.

It would have been OK for both ABIs to use +5 for the advance before
restore of LR, since we can put the DW_CFA_restore_extended on any
insn after the actual restore and before the r12/r0 copy is clobbered,
but it's slightly better to delay as much as possible.  There are
then more addresses where fewer CFA program insns are executed.

bfd/
* elf64-ppc.c (ppc64_elf_size_stubs): Correct advance to
restore of LR.
gold/
* powerpc.cc (glink_eh_frame_fde_64v2): Correct advance to
restore of LR.
(glink_eh_frame_fde_64v1): Advance to restore of LR at latest
possible insn.

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

8 years agoAutomatic date update in version.in
GDB Administrator [Sat, 22 Jul 2017 00:01:49 +0000 (00:01 +0000)] 
Automatic date update in version.in

8 years agoUpdated French translation for the binutils subdirectory.
Nick Clifton [Fri, 21 Jul 2017 15:02:44 +0000 (16:02 +0100)] 
Updated French translation for the binutils subdirectory.

* po/fr.po: Updated French translation.

8 years agoAutomatic date update in version.in
GDB Administrator [Fri, 21 Jul 2017 00:01:23 +0000 (00:01 +0000)] 
Automatic date update in version.in

8 years agoUpdate German translation for the opcodes library.
Nick Clifton [Thu, 20 Jul 2017 10:49:12 +0000 (11:49 +0100)] 
Update German translation for the opcodes library.

* po/de.po: Updated German translation.

8 years agoAutomatic date update in version.in
GDB Administrator [Thu, 20 Jul 2017 00:01:56 +0000 (00:01 +0000)] 
Automatic date update in version.in

8 years agoAutomatic date update in version.in
GDB Administrator [Wed, 19 Jul 2017 00:01:49 +0000 (00:01 +0000)] 
Automatic date update in version.in

8 years agoUpdate translations.
Nick Clifton [Tue, 18 Jul 2017 13:41:22 +0000 (14:41 +0100)] 
Update translations.

bfd * po/es.po: Updated translation.
* po/fi.po: Likewise.
* po/fr.po: Likewise.
* po/id.po: Likewise.
* po/ja.po: Likewise.
* po/ro.po: Likewise.
* po/ru.po: Likewise.
* po/sr.po: Likewise.
* po/sv.po: Likewise.
* po/tr.po: Likewise.
* po/uk.po: Likewise.
* po/vi.po: Likewise.
* po/zh_CN.po: Likewise.

* po/hr.po: New translation.
* configure.ac (ALL_LINGUAS): Add hr.
* configure: Regenerate.

gold * po/es.po: Updated translation.
* po/fi.po: Likewise.
* po/fr.po: Likewise.
* po/id.po: Likewise.
* po/it.po: Likewise.
* po/vi.po: Likewise.
* po/zh_CN.po: Likewise.

* po/ja.po: New translation.
* po/sv.po: Likewise.
* po/uk.po: Likewise.

ld * po/bg.po: Updated translation.
* po/da.po: Likewise.
* po/es.po: Likewise.
* po/fi.po: Likewise.
* po/fr.po: Likewise.
* po/id.po: Likewise.
* po/it.po: Likewise.
* po/ja.po: Likewise.
* po/tr.po: Likewise.
* po/uk.po: Likewise.
* po/vi.po: Likewise.
* po/zh_CN.po: Likewise.
* po/zh_TW.po: Likewise.

* po/ru.po: New translation.
* po/de.po: Likewise.
* configure.ac (ALL_LINGUAS): Add ru and de.
* configure: Regenerate.

binutils* po/bg.po: Updated translation.
* po/ca.po: Likewise.
* po/da.po: Likewise.
* po/es.po: Likewise.
* po/fi.po: Likewise.
* po/fr.po: Likewise.
* po/hr.po: Likewise.
* po/id.po: Likewise.
* po/it.po: Likewise.
* po/ja.po: Likewise.
* po/ro.po: Likewise.
* po/ru.po: Likewise.
* po/sk.po: Likewise.
* po/sr.po: Likewise.
* po/sv.po: Likewise.
* po/tr.po: Likewise.
* po/uk.po: Likewise.
* po/vi.po: Likewise.
* po/zh_CN.po: Likewise.
* po/zh_TW.po: Likewise.

gas * po/es.po: Updated translation.
* po/fi.po: Likewise.
* po/fr.po: Likewise.
* po/id.po: Likewise.
* po/ja.po: Likewise.
* po/ru.po: Likewise.
* po/sv.po: Likewise.
* po/tr.po: Likewise.
* po/uk.po: Likewise.
* po/zh_CN.po: Likewise.

gprof * po/bg.po: Updated translation.
* po/da.po: Likewise.
* po/de.po: Likewise.
* po/eo.po: Likewise.
* po/es.po: Likewise.
* po/fi.po: Likewise.
* po/fr.po: Likewise.
* po/ga.po: Likewise.
* po/hu.po: Likewise.
* po/id.po: Likewise.
* po/it.po: Likewise.
* po/ja.po: Likewise.
* po/ms.po: Likewise.
* po/nl.po: Likewise.
* po/pt_BR.po: Likewise.
* po/ro.po: Likewise.
* po/ru.po: Likewise.
* po/sr.po: Likewise.
* po/sv.po: Likewise.
* po/tr.po: Likewise.
* po/uk.po: Likewise.
* po/vi.po: Likewise.

opcodes * po/da.po: Updated translation.
* po/de.po: Likewise.
* po/es.po: Likewise.
* po/fi.po: Likewise.
* po/fr.po: Likewise.
* po/id.po: Likewise.
* po/it.po: Likewise.
* po/nl.po: Likewise.
* po/pt_BR.po: Likewise.
* po/ro.po: Likewise.
* po/sv.po: Likewise.
* po/tr.po: Likewise.
* po/uk.po: Likewise.
* po/vi.po: Likewise.
* po/zh_CN.po: Likewise.

8 years agoAutomatic date update in version.in
GDB Administrator [Tue, 18 Jul 2017 00:01:41 +0000 (00:01 +0000)] 
Automatic date update in version.in

8 years agoSupport single digit GCC version
H.J. Lu [Tue, 11 Jul 2017 15:37:48 +0000 (08:37 -0700)] 
Support single digit GCC version

On Fedora 26, "g++ -dumpversion" displays "7", instead of "7.1.1".
Update selective.exp to support single digit GCC version.  Also
remove duplicated [4-9] version check.

* testsuite/ld-selective/selective.exp: Support single digit
GCC version.

(cherry picked from commit 61a0857c0fb512ce6a2ba4315a37fcce744f6045)

8 years agox86-64: Limit PIC check to shared library build
H.J. Lu [Mon, 17 Jul 2017 19:17:59 +0000 (12:17 -0700)] 
x86-64: Limit PIC check to shared library build

When building an executable, undefined symbols are error and undefined
weak symbols are resolved to zero.  We only need to check PIC for
building a shared library.

bfd/

PR ld/21782
* elf64-x86-64.c (elf_x86_64_relocate_section): Limit PIC check
to shared library.

ld/

PR ld/21782
* testsuite/ld-x86-64/pie3-nacl.d: New file.
* testsuite/ld-x86-64/pie3.d: Likewise.
* testsuite/ld-x86-64/pie3.s: Likewise.
* testsuite/ld-x86-64/x86-64.exp: Run pie3 and pie3-nacl.

(cherry picked from commit c5bb8910e80c6cd80c63541f86471c18375c8198)

8 years agoCorrect previous fix to ar, so that it now only comaplains about a lack of input...
Nick Clifton [Mon, 17 Jul 2017 09:53:53 +0000 (10:53 +0100)] 
Correct previous fix to ar, so that it now only comaplains about a lack of input files if not running in MRI mode.

PR 21433
* ar.c (main): Skip check for no files on the command line when
running in MRI mode.

8 years agoAutomatic date update in version.in
GDB Administrator [Mon, 17 Jul 2017 00:01:53 +0000 (00:01 +0000)] 
Automatic date update in version.in

8 years ago__tls_get_addr_opt GOT entries
Alan Modra [Sun, 16 Jul 2017 02:20:52 +0000 (11:50 +0930)] 
__tls_get_addr_opt GOT entries

My 2017-01-24 patch (commit f0158f44) wrongly applied an optimization
of GOT entries for the __tls_get_addr_opt stub, to shared libraries.

When the TLS segment layout is known, as it is for the executable and
shared libraries loaded at initial program start, powerpc supports a
__tls_get_addr optimization.  On the first call to __tls_get_addr for
a given __tls_index GOT entry, the DTPMOD word is set to zero and the
DTPREL word to the thread pointer offset to the thread variable.  This
allows the __tls_get_addr_opt stub to return that value immediately
without making a call into glibc for any subsequent __tls_get_addr
calls using that __tls_index GOT entry.

That's all fine, but I thought I'd be clever and when the thread
variable is local, set up the GOT entry as if __tls_get_addr had
already been called.  Which is good only for the executable, since ld
cannot know the TLS layout for shared libraries.

Of course, if this only applies to executables there isn't much point
to the optimization.  Normally, GD and LD code in an executable will
be converted to IE or LE, losing the __tls_get_addr call.  So the only
time it will trigger is with --no-tls-optimize.  Thus, revert all
support.

* elf64-ppc.c (ppc64_elf_relocate_section): Don't optimize
__tls_index GOT entries when using __tls_get_addr_opt stub.
* elf32-ppc.c (ppc_elf_relocate_section): Likewise.

8 years agoAutomatic date update in version.in
GDB Administrator [Sun, 16 Jul 2017 00:01:42 +0000 (00:01 +0000)] 
Automatic date update in version.in

8 years agoAutomatic date update in version.in
GDB Administrator [Sat, 15 Jul 2017 00:01:53 +0000 (00:01 +0000)] 
Automatic date update in version.in

8 years agoPR ld/21529: Use a linker script to limit output with the test case
Maciej W. Rozycki [Fri, 14 Jul 2017 10:53:08 +0000 (11:53 +0100)] 
PR ld/21529: Use a linker script to limit output with the test case

Complement commit d9409498813c ("Add a testcase for PR ld/21529") and
use a linker script to prevent an inter-segment gap arranged by the
default linker script associated with some targets such as `rx-elf':

$ ld -e main -o tmpdir/dump-elf tmpdir/pr21529.o
$ readelf -l tmpdir/dump-elf
Elf file type is EXEC (Executable file)
Entry point 0x10000004
There are 2 program headers, starting at offset 52

Program Headers:
  Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
  LOAD           0x001000 0x10000000 0x10000000 0x00008 0x00008 R E 0x1000
  LOAD           0x001ffc 0xbffffffc 0xbffffffc 0x00004 0x00004 RW  0x1000

 Section to Segment mapping:
  Segment Sections...
   00     .text
   01     .stack
$

and converted to padding with the use of the binary BFD for output from
producing unreasonably large files.

ld/
* testsuite/ld-unique/pr21529.ld: New test linker script.
* testsuite/ld-unique/pr21529.d: Use it.

(cherry picked from commit 211b0bed95b3f6b177a541ec52302b8febd6b49c)

8 years agoAutomatic date update in version.in
GDB Administrator [Fri, 14 Jul 2017 00:01:31 +0000 (00:01 +0000)] 
Automatic date update in version.in

8 years agoAutomatic date update in version.in
GDB Administrator [Thu, 13 Jul 2017 00:01:50 +0000 (00:01 +0000)] 
Automatic date update in version.in