platform/upstream/binutils.git
8 years agoSync config.guess and config.sub with FSF GCC mainline versions
Nick Clifton [Mon, 23 May 2016 10:42:17 +0000 (11:42 +0100)]
Sync config.guess and config.sub with FSF GCC mainline versions

8 years agoSupport for dedicated ARM stub section with padding
Thomas Preud'homme [Mon, 23 May 2016 08:41:36 +0000 (09:41 +0100)]
Support for dedicated ARM stub section with padding

2016-05-23  Thomas Preud'homme  <thomas.preudhomme@arm.com>

bfd/
* elf32-arm.c (arm_dedicated_stub_section_padding): New function.
(elf32_arm_size_stubs): Declare stub_type in a more outer scope and
account for padding for stub section requiring one.
(elf32_arm_build_stubs): Add comment to stress the importance of
zeroing veneer section content.

8 years agoSupport for dedicated output section for some ARM veneer types
Thomas Preud'homme [Mon, 23 May 2016 08:38:32 +0000 (09:38 +0100)]
Support for dedicated output section for some ARM veneer types

2016-05-23  Thomas Preud'homme  <thomas.preudhomme@arm.com>

bfd/
* bfd-in.h (bfd_elf32_arm_keep_private_stub_output_sections): Declare
bfd hook.
* bfd-in2.h: Regenerate.
* elf32-arm.c (arm_dedicated_stub_output_section_required): New
function.
(arm_dedicated_stub_output_section_required_alignment): Likewise.
(arm_dedicated_stub_output_section_name): Likewise.
(arm_dedicated_stub_input_section_ptr): Likewise.
(elf32_arm_create_or_find_stub_sec): Add stub type parameter and
function description comment. Add support for dedicated output stub
section to given stub types.
(elf32_arm_add_stub): Add a stub type parameter and pass it down to
elf32_arm_create_or_find_stub_sec.
(elf32_arm_create_stub): Pass stub type down to elf32_arm_add_stub.
(elf32_arm_size_stubs): Pass stub type when calling
elf32_arm_create_or_find_stub_sec for Cortex-A8 erratum veneers.
(bfd_elf32_arm_keep_private_stub_output_sections): New function.

ld/
* emultempl/armelf.em (arm_elf_before_allocation): Call
bfd_elf32_arm_keep_private_stub_output_sections before generic
before_allocation function.

8 years agoSearch for libutil-freebsd as alternative to libutil
Jon Boden [Mon, 23 May 2016 07:46:33 +0000 (08:46 +0100)]
Search for libutil-freebsd as alternative to libutil

GDB needs kinfo_getvmmap() on GNU/kFreeBSD systems same as on
pure FreeBSD.  However on these systems the FreeBSD version of libutil
is renamed to libutil-freebsd.

2016-05-23  Jon Boden  <jon@ubuntubsd.org>

* configure.ac: Search for libutil-freebsd as alternative to libutil.
* configure: Re-generated.

8 years agotic54x: use concat more
Trevor Saunders [Thu, 19 May 2016 02:48:34 +0000 (22:48 -0400)]
tic54x: use concat more

gas/ChangeLog:

2016-05-23  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

* config/tc-tic54x.c (tic54x_sect): simplify string creation.

8 years agospu: make some constants unsigned
Trevor Saunders [Thu, 19 May 2016 02:39:18 +0000 (22:39 -0400)]
spu: make some constants unsigned

The field in spu_opcode is unsigned, and for some values of opcode we can end
up shifting into the high bit.  So avoid possibly creating a negative number
and then assigning it to a unsigned field by shifting an unsigned constant.

gas/ChangeLog:

2016-05-23  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

* config/tc-spu.c (APUOP): Use OPCODE as an unsigned constant.

8 years agotic54x: rename typedef of struct symbol_
Trevor Saunders [Thu, 19 May 2016 03:48:48 +0000 (23:48 -0400)]
tic54x: rename typedef of struct symbol_

generic gas code has a struct symbol, and tic54x typedefs a struct to symbol.
This seems at least rather confusing, and it seems like target specific headers
shouldn't  put such generic names in the global namespace preventing other
generic code from using them.

opcodes/ChangeLog:

2016-05-23  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

* tic54x-dis.c (sprint_mmr): Adjust.
* tic54x-opc.c: Likewise.

gas/ChangeLog:

2016-05-23  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

* config/tc-tic54x.c (tic54x_mmregs): Adjust.
(md_begin): Likewise.
(encode_condition): Likewise.
(encode_cc3): Likewise.
(encode_cc2): Likewise.
(encode_operand): Likewise.
(tic54x_undefined_symbol): Likewise.

include/ChangeLog:

2016-05-23  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

* opcode/tic54x.h (struct symbol_): typedef to tic54x_symbol instead of
plain symbol.

8 years agoAutomatic date update in version.in
GDB Administrator [Mon, 23 May 2016 00:00:19 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years agoAutomatic date update in version.in
GDB Administrator [Sun, 22 May 2016 00:00:19 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years agoAutomatic date update in version.in
GDB Administrator [Sat, 21 May 2016 00:00:22 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years agoDon't check R_386_GOT32 when setting need_convert_load
H.J. Lu [Fri, 20 May 2016 16:36:48 +0000 (09:36 -0700)]
Don't check R_386_GOT32 when setting need_convert_load

Since we no longer convert R_386_GOT32, don't check R_386_GOT32 when
setting need_convert_load.

* elf32-i386.c (elf_i386_check_relocs): Don't check R_386_GOT32
when setting need_convert_load.

8 years agoMIPS: Add support for P6600
Matthew Fortune [Fri, 20 May 2016 14:20:42 +0000 (15:20 +0100)]
MIPS: Add support for P6600

gas/
* config/tc-mips.c (mips_cpu_info_table): Update comment. Add
p6600 entry.
* doc/c-mips.texi: Document p6600 -march option.

8 years agoPreserve addend for R_386_GOT32 and R_X86_64_GOT32
H.J. Lu [Fri, 20 May 2016 13:01:28 +0000 (06:01 -0700)]
Preserve addend for R_386_GOT32 and R_X86_64_GOT32

We should preserve addend for R_386_GOT32 and R_X86_64_GOT32 as in
"movl $foo@GOT + 4, %eax" and "movq $foo@GOT + 4, %rax".

PR gas/19600
* config/tc-i386.c (md_apply_fix): Preserve addend for
BFD_RELOC_386_GOT32 and BFD_RELOC_X86_64_GOT32.
* testsuite/gas/i386/addend.d: New file.
* testsuite/gas/i386/addend.s: Likewise.
* testsuite/gas/i386/x86-64-addend.d: Likewise.
* testsuite/gas/i386/x86-64-addend.s: Likewise.
* testsuite/gas/i386/i386.exp: Run addend and x86-64-addend.
* testsuite/gas/i386/reloc32.d: Updated.

8 years agoMIPS: Fix the encoding of immediates with microMIPS JALX
Maciej W. Rozycki [Fri, 20 May 2016 12:32:19 +0000 (13:32 +0100)]
MIPS: Fix the encoding of immediates with microMIPS JALX

The microMIPS JALX instruction shares the R_MICROMIPS_26_S1 relocation
with microMIPS J/JAL/JALS instructions, however unlike the latters its
encoded immediate argument is unusually shifted left by 2 rather than 1
in calculating the value used for the operation requested.

We already handle this exception in `mips_elf_calculate_relocation' in
LD, in a scenario where JALX is produced as a result of relaxing JAL for
the purpose of making a cross-mode jump.  We also get it right in the
disassembler in `decode_micromips_operand'.

What we don't correctly do however is processing microMIPS JALX produced
by GAS from an assembly source, where a non-zero constant argument or a
symbol reference with a non-zero in-place addend has been used.  In this
case the same calculation is made as for microMIPS J/JAL/JALS, causing
the wrong encoding to be produced by GAS on making an object file, and
then again by LD in the final link.  The latter in particular causes the
calculation, where the addend fits in the relocatable field, to produce
different final addresses for the same source code depending on whether
REL or RELA relocations are used.

Correct these issues by special-casing microMIPS JALX in the places that
have been previously missed.

bfd/
* elfxx-mips.c (mips_elf_read_rel_addend): Adjust the addend for
microMIPS JALX.

gas/
* config/tc-mips.c (append_insn): Correct the encoding of a
constant argument for microMIPS JALX.
(tc_gen_reloc): Correct the encoding of an in-place addend for
microMIPS JALX.
* testsuite/gas/mips/jalx-addend.d: New test.
* testsuite/gas/mips/jalx-addend-n32.d: New test.
* testsuite/gas/mips/jalx-addend-n64.d: New test.
* testsuite/gas/mips/jalx-imm.d: New test.
* testsuite/gas/mips/jalx-imm-n32.d: New test.
* testsuite/gas/mips/jalx-imm-n64.d: New test.
* testsuite/gas/mips/jalx-addend.s: New test source.
* testsuite/gas/mips/jalx-imm.s: New test source.
* testsuite/gas/mips/mips.exp: Run the new tests.

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

8 years agoMIPS/GAS: Correct tab-after-space formatting mistakes
Maciej W. Rozycki [Fri, 20 May 2016 11:41:50 +0000 (12:41 +0100)]
MIPS/GAS: Correct tab-after-space formatting mistakes

* config/tc-mips.c: Correct tab-after-space formatting mistakes
throughout.

8 years agoAutomatic date update in version.in
GDB Administrator [Fri, 20 May 2016 00:00:10 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years agoDon't allow COPY relocations for protected symbols.
Cary Coutant [Thu, 19 May 2016 21:58:18 +0000 (14:58 -0700)]
Don't allow COPY relocations for protected symbols.

gold/
PR gold/19823
* copy-relocs.cc (Copy_relocs::make_copy_reloc): Add object
parameter; check for protected symbol.
* copy-relocs.h (Copy_relocs::make_copy_reloc): Add object parameter.
* mips.cc (Mips_copy_relocs): Adjust call to make_copy_reloc.
* symtab.cc (Symbol::init_fields): Initialize is_protected_.
(Symbol_table::add_from_dynobj): Mark protected symbols.
* symtab.h (Symbol::is_protected): New method.
(Symbol::set_is_protected): New method.
(Symbol::is_protected_): New data member.

* testsuite/Makefile.am (copy_test_protected): New test.
* testsuite/Makefile.in: Regenerate.
* testsuite/copy_test.cc (main): Add legal reference to protected
symbol.
* testsuite/copy_test_v1.cc (main): Likewise.
* testsuite/copy_test_2.cc (ip): Add protected symbol.
* testsuite/copy_test_protected.cc: New test source file.
* testsuite/copy_test_protected.sh: New test script.

8 years agoFix non-deterministic behavior when generating MIPS GOT.
Vladimir Radosavljevic [Thu, 19 May 2016 21:57:14 +0000 (14:57 -0700)]
Fix non-deterministic behavior when generating MIPS GOT.

* mips.cc (Mips_got_entry::Mips_got_entry): Remove object argument
for global got symbols, and set addend to 0.
(Mips_got_entry::hash): Change hash algorithm.
(Mips_got_entry::equals): Refactor.
(Mips_got_entry::object): Return input object for local got symbols
from union d.
(Mips_got_entry::addend): Change return of the relocation addend.
(Mips_got_entry::addend_): Move from union d.
(Mips_got_entry::object_): Move into union d.
(class Mips_symbol_hash): New class.
(Mips_got_info::Global_got_entry_set): New type.
(Mips_got_info::global_got_symbols): Change return type to
Global_got_entry_set.
(Mips_got_info::global_got_symbols_): Change type to
Global_got_entry_set.
(Mips_symbol::hash): New method.
(Mips_output_data_la25_stub::symbols_): Change type to std::vector.
(Mips_output_data_mips_stubs::Mips_stubs_entry_set): New type.
(Mips_output_data_mips_stubs::symbols_): Change type to
Mips_stubs_entry_set.
(Mips_got_info::record_global_got_symbol): Don't pass object
argument when creating global got symbol.
(Mips_got_info::record_got_entry): Remove find before inserting
got entries.
(Mips_got_info::add_reloc_only_entries): Change type of iterator
to Global_got_entry_set.
(Mips_got_info::count_got_symbols): Likewise.
(Mips_output_data_la25_stub::create_la25_stub): Use push_back
for adding entries to symbols_.
(Mips_output_data_la25_stub::do_write): Change type of iterator
to std::vector.
(Mips_output_data_mips_stubs::set_lazy_stub_offsets): Change type
of iterator to Mips_stubs_entry_set.
(Mips_output_data_mips_stubs::set_needs_dynsym_value): Likewise.
(Mips_output_data_mips_stubs::do_write): Likewise.

8 years agoDon't convert R_386_GOT32 relocation
H.J. Lu [Thu, 19 May 2016 19:56:55 +0000 (12:56 -0700)]
Don't convert R_386_GOT32 relocation

Don't convert R_386_GOT32 since we can't tell if it is applied
to "mov $foo@GOT, %reg" which isn't a load via GOT.

bfd/

PR ld/20117
* elf32-i386.c (elf_i386_convert_load_reloc): Don't check
R_386_GOT32X.
(elf_i386_convert_load): Don't convert R_386_GOT32.

ld/

PR ld/20117
* testsuite/ld-i386/i386.exp: Run pr20117.
* testsuite/ld-i386/pr19609-1i.d: Updated.
* testsuite/ld-i386/pr20117.d: New file.
* testsuite/ld-i386/pr20117.s: Likewise.

8 years agoSet sh_entsize for .init_array and similar.
Alan Modra [Thu, 19 May 2016 15:03:42 +0000 (00:33 +0930)]
Set sh_entsize for .init_array and similar.

PR gas/20118
* elf.c (elf_fake_sections): Set sh_entsize for SHT_INIT_ARRAY,
SHT_FINI_ARRAY, and SHT_PREINIT_ARRAY.

8 years agoFix invalid implicit conversions from void *
Andreas Schwab [Thu, 19 May 2016 12:43:56 +0000 (14:43 +0200)]
Fix invalid implicit conversions from void *

* ia64-libunwind-tdep.c (libunwind_descr): Add cast from void *.
(libunwind_frame_set_descr): Likewise.
(libunwind_frame_cache): Likewise.
(libunwind_frame_dealloc_cache): Likewise.
(libunwind_frame_sniffer): Likewise.
(libunwind_search_unwind_table): Likewise.
(libunwind_sigtramp_frame_sniffer): Likewise.
(libunwind_get_reg_special): Likewise.
(libunwind_load): Likewise.
* ia64-linux-nat.c (ia64_linux_fetch_register): Likewise.
(ia64_linux_store_register): Likewise.
(ia64_linux_xfer_partial): Likewise.
* ia64-tdep.c (ia64_access_reg): Likewise.
(ia64_access_fpreg): Likewise.
(ia64_access_rse_reg): Likewise.
(ia64_access_rse_fpreg): Likewise.

8 years ago[ARC] Fixed-linker-related-testsuite-for-ARC
Claudiu Zissulescu [Thu, 19 May 2016 12:51:53 +0000 (14:51 +0200)]
[ARC] Fixed-linker-related-testsuite-for-ARC

ld/
2016-05-19  Cupertino Miranda  <cmiranda@synopsys.com>

* testsuite/ld-elf/compressed1d.d: Removed from notarget.
* testsuite/ld-elf/group8a.d: Likewise.
* testsuite/ld-elf/group8b.d: Likewise.
* testsuite/ld-elf/group9a.d: Likewise.
* testsuite/ld-elf/group9b.d: Likewise.
* testsuite/ld-elf/pr12851.d: Likewise.
* testsuite/ld-elf/pr12975.d: Likewise.
* testsuite/ld-elf/pr13177.d: Likewise.
* testsuite/ld-elf/pr13195.d: Likewise.
* testsuite/ld-elf/pr17615.d: Likewise.
* testsuite/ld-elf/eh-frame-hdr.d: Removed from xfail.
* testsuite/ld-elf/group3b.d: Likewise.
* testsuite/ld-srec/srec.exp: Likewise.
* testsuite/lib/ld-lib.exp (check_gc_sections_available): Mark ARC
as supporting gc.
(check_shared_lib_support): Mark ARC as supporting.

8 years ago[ARC] Emulation and default script template changes.
Claudiu Zissulescu [Thu, 19 May 2016 12:44:01 +0000 (14:44 +0200)]
[ARC] Emulation and default script template changes.

2016-05-19  Cupertino Miranda  <cmiranda@synopsys.com>

* emulparams/arcelf.sh: Changed.
* emulparams/arclinux.sh: Likewise.
* scripttempl/arclinux.sc: Moved to a more standard implementation
similar to elf.sc.

8 years ago[ARC] BFD fixes.
Claudiu Zissulescu [Thu, 19 May 2016 12:39:36 +0000 (14:39 +0200)]
[ARC] BFD fixes.

2016-05-19  Cupertino Miranda  <cmiranda@synopsys.com>

* elf32-arc.c (arc_elf_final_write_processing): Changed.
(debug_arc_reloc): Likewise.
(elf_arc_relocate_section): Likewise.
(elf_arc_check_relocs): Likewise.
(elf_arc_adjust_dynamic_symbol): Likewise.
(elf_arc_add_symbol_hook): Likewise.

8 years agoLD/testsuite: Fix `ft32-*-*' position in `check_shared_lib_support'
Maciej W. Rozycki [Thu, 19 May 2016 10:19:04 +0000 (11:19 +0100)]
LD/testsuite: Fix `ft32-*-*' position in `check_shared_lib_support'

ld/
* testsuite/lib/ld-lib.exp (check_shared_lib_support): Reorder
`ft32-*-*' behind `frv-*-*'.

8 years agoRemove unsupported `am34-*-linux*' target triplet
Maciej W. Rozycki [Wed, 18 May 2016 03:19:02 +0000 (04:19 +0100)]
Remove unsupported `am34-*-linux*' target triplet

The `am34-*-linux*' target cannot be configured for, `am34' is not a CPU
name recognized by `config.sub'.  It has never been, required code has
not been contributed to GNU config, neither before nor since the
addition of the target triplet to our configury with commit bfff16424942
("Add MN10300 linker relaxation support for symbol differences") back in
2007.  Also there is no difference in actual tool configuration between
the `am34-*-linux*' and `am33_2.0-*-linux*' targets, except from a
different executable prefix and tooldir name.

Given the above remove the target triplet from our configuration.

bfd/
* config.bfd: Remove `am34-*-linux*' support.

ld/
* configure.tgt: Remove `am34-*-linux*' support.

8 years agoCorrect "Fix powerpc subis range"
Alan Modra [Thu, 19 May 2016 07:24:54 +0000 (16:54 +0930)]
Correct "Fix powerpc subis range"

* ppc-opc.c (NSISIGNOPT): Use insert_nsi and extract_nsi.

8 years agoFix powerpc subis range
Alan Modra [Wed, 18 May 2016 14:40:35 +0000 (00:10 +0930)]
Fix powerpc subis range

* ppc-opc.c: Formatting.
(NSISIGNOPT): Define.
(powerpc_opcodes <subis>): Use NSISIGNOPT.

8 years agoHack crossref tests for powerpc64
Alan Modra [Wed, 18 May 2016 14:40:13 +0000 (00:10 +0930)]
Hack crossref tests for powerpc64

A different set of hacks to make the crossref tests pass on powerpc64
and powerpc64le.

* testsuite/ld-scripts/crossref.exp: Remove -mcall-aixdesc hack.
* testsuite/ld-scripts/cross2.t: Tweak .opd and .toc placement.
* testsuite/ld-scripts/cross3.t: Likewise.
* testsuite/ld-scripts/cross4.t: Likewise.
* testsuite/ld-scripts/cross5.t: Likewise.
* testsuite/ld-scripts/cross6.t: Likewise.
* testsuite/ld-scripts/cross7.t: Likewise.

8 years agold-elf/shared.exp mix_pic_and_non_pic
Alan Modra [Wed, 18 May 2016 14:39:03 +0000 (00:09 +0930)]
ld-elf/shared.exp mix_pic_and_non_pic

Tweaks to make it easier to re-run these testcases by hand.

* testsuite/ld-elf/shared.exp (mix_pic_and_non_pic): Pass in
exe name rather than constructing testname.  Fix typo in
sub-test name.  Log copying.  Use -rpath rather than -R.

8 years agoAllocate ppc64 got and dynrelocs before plt
Alan Modra [Wed, 18 May 2016 14:29:04 +0000 (23:59 +0930)]
Allocate ppc64 got and dynrelocs before plt

The idea being to make undefined weak syms dynamic, before deciding
whether a sym needs a plt entry.  Fixes pr19719 ld testcase.

* elf64-ppc.c (allocate_dynrelocs): Allocate got and other dynamic
relocs before plt relocs.

8 years agoFix ppc64le S-record test fail
Alan Modra [Thu, 19 May 2016 03:02:40 +0000 (12:32 +0930)]
Fix ppc64le S-record test fail

Segfaults on --defsym symbol (__stack_chk_fail in this instance).

* elf64-ppc.c (ppc64_elf_branch_reloc): Check for NULL owner
before dereferencing.

8 years agoAutomatic date update in version.in
GDB Administrator [Thu, 19 May 2016 00:00:09 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years agogas/arc: Make member of arc_flags const
Andrew Burgess [Fri, 6 May 2016 12:59:03 +0000 (13:59 +0100)]
gas/arc: Make member of arc_flags const

By making the flgp field of struct arc_flags constant we can remove a
place where we cast away the const-ness of a variable.  Also, given that
the value assigned to this field almost always comes from compile-time
constant data, having the field non-constant is probably a bad thing.

gas/ChangeLog:

* config/tc-arc.c (find_opcode_match): Remove casting away of
const.
* config/tc-arc.h (struct arc_flags): Make flgp field const.

8 years agogas/arc: Use BFD_VMA_FMT for printf format specifier
Andrew Burgess [Wed, 4 May 2016 13:11:11 +0000 (14:11 +0100)]
gas/arc: Use BFD_VMA_FMT for printf format specifier

Some debug code has the wrong printf format specifier for some types
that are (ultimately) bfd_vma.  Fixed by using BFD_VMA_FMT string.  This
only becomes an issue when building the tc-arc.c file with -DDEBUG=1 to
build in the debug code.

gas/ChangeLog:

* config/tc-arc.c (md_pcrel_from_section): Use BFD_VMA_FMT where
appropriate.
(md_convert_frag): Likewise.

8 years agogas/arc: Fix array overrun when checking opcode array
Andrew Burgess [Wed, 4 May 2016 12:57:10 +0000 (13:57 +0100)]
gas/arc: Fix array overrun when checking opcode array

The opcode array iterator mechanism can, in some situations, result in
reading memory outside of the opcode array.  When using the
iterator-next mechanism to find the next possible arc_opcode, if we find
an opcode where the name field is NULL, or the name does not match, then
the cached opcode pointer is not set to NULL.  The result is that
another call to iterator-next will again increment the opcode
pointer (which might now point outside the opcode array) and attempt to
access the name field of this undefined opcode.

Fixed in this commit by clearing the cached opcode pointer.

I've added a test case, which currently shows the bug, however, this
will only expose this bug while the opcode used (dsp_fp_cmp) is the last
opcode in the table.

gas/ChangeLog:

* config/tc-arc.c (arc_opcode_hash_entry_iterator_next): Set
cached opcode to NULL when we reach a non-matching opcode.
* testsuite/gas/arc/asm-errors-2.d: New file.
* testsuite/gas/arc/asm-errors-2.err: New file.
* testsuite/gas/arc/asm-errors-2.s: New file.

8 years agogas/arc: Add guard against operand array overflow.
Andrew Burgess [Tue, 3 May 2016 12:43:44 +0000 (13:43 +0100)]
gas/arc: Add guard against operand array overflow.

Currently supplying an input file with too many operands to an
instruction will cause the assembler to overflow and array and trigger
undefined behaviour.

This change checks that we don't access outside the limits of the
operand array.

gas/ChangeLog:

* config/tc-arc.c (tokenize_arguments): Add checks for array
overflow.
* testsuite/gas/arc/asm-errors.s: Addition test line added.
* testsuite/gas/arc/asm-errors.err: Update expected results.

8 years agoFix build failure with GCC 4.1.
Tom Tromey [Wed, 18 May 2016 16:48:41 +0000 (10:48 -0600)]
Fix build failure with GCC 4.1.

2016-05-18  Tom Tromey  <tom@tromey.com>

* rust-lang.c (rust_subscript): Initialize "high".

8 years agoPrevent a run time segmentation fault when stripping a corrupt binary.
Nick Clifton [Wed, 18 May 2016 14:21:16 +0000 (15:21 +0100)]
Prevent a run time segmentation fault when stripping a corrupt binary.

PR 20096
* objcopy.c (copy_relocations_in_section): Also check for the
symbol pointed to by sym_ptr_ptr being NULL.

8 years agoAdd mi-threads-interrupt.exp test (PR 20039)
Simon Marchi [Wed, 18 May 2016 14:13:12 +0000 (10:13 -0400)]
Add mi-threads-interrupt.exp test (PR 20039)

Add a new test for PR 20039.  The test spawns new threads, then tries to
interrupt, continue, and interrupt again.  This use case was fixed by
commit 5fe966540d6b748f825774868463003700f0c878 in master, but gdb 7.11
is affected (so if you try it on the gdb-7.11-branch right now, the test
will fail).

New in v2, the test now handles mi-async on mode properly.  The failure
was specific to mi-async off, but I don't think it's bad to test the
same thing under async on mode.  I added a little hack when running in
async mode to work around bug 20045.

I also removed one continue/interrupt pair, as a single one was enough to
trigger the problem.

gdb/testsuite/ChangeLog:

* gdb.mi/mi-threads-interrupt.c: New file.
* gdb.mi/mi-threads-interrupt.exp: New file.

8 years agoFix double prompt output after run control MI commands with mi-async on (PR 20045)
Simon Marchi [Tue, 17 May 2016 21:07:20 +0000 (17:07 -0400)]
Fix double prompt output after run control MI commands with mi-async on (PR 20045)

When you use a run control command (-exec-run, -exec-continue,
-exec-next, ...) with mi-async on, an extra (gdb) prompt is displayed:

  -exec-continue
  ^running
  *running,thread-id="all"
  (gdb)
  (gdb)

It doesn't seem to be a big problem for front-ends, since this behavior
started in gdb 7.9 and we haven't heard anything about that.  However,
it caused me some trouble while writing a test for PR 20039 [1].

The problem comes from an extra (gdb) prompt that we write when running
in mi-async off mode to emulate a past buggy behavior.  When executing a
run control command synchronously, previous gdbs always printed a prompt
right away, even though they are not ready to accept new MI commands
until the target stops.  Only at this time should they display a prompt.
But to keep backwards compatibility apparently, we print it anyway.
Since commit 198297aaf, the condition that decides whether we should
print that "bogus" prompt or not has become true, even when running with
mi-async on.  Since we already print a prompt at the end of the
asynchronous command execution, it results in two prompts for one
command.

The proposed fix is to call target_can_async_p instead of
target_is_async_p, to make the condition:

  if (!target_can_async_p () || sync_execution)
    ... show prompt ...

That shows the prompt if we are emulating a synchronous command on top
of an asynchronous target (sync_execution) or if the target simply can't
run asynchronously (!target_can_async_p ()).

Note that this code is changed and this bug fixed by Pedro's separate
console series, but I think it would be nice to have it fixed in the
mean time.

I ran the gdb.mi directory of the testsuite with mi-async on and off, I
didn't see any regressions.

gdb/ChangeLog:

* mi/mi-main.c (mi_on_resume): Call target_can_async_p instead
of target_is_async_p.

[1] https://sourceware.org/ml/gdb-patches/2016-05/msg00075.html

8 years agoMIPS/opcodes: Correct mixed MIPS16 and microMIPS disassembly
Maciej W. Rozycki [Wed, 18 May 2016 10:22:30 +0000 (11:22 +0100)]
MIPS/opcodes: Correct mixed MIPS16 and microMIPS disassembly

Mixing MIPS16 and microMIPS code in a single binary isn't usually
supported but GAS happily produces such code if requested.  However it
is not correctly disassembled even if a symbol table is available and
function symbols are correctly anotated with the ISA mode.  This is
because the ELF-header global microMIPS ASE flag takes precedence over
MIPS16 function annotation, causing them to be treated as regular MIPS
code.

Correct the problem by respecting function symbol anotation regardless
of the ELF-header flag.

binutils/
* testsuite/binutils-all/mips/mixed-mips16-micromips.d: New test.
* testsuite/binutils-all/mips/mixed-mips16-micromips.s: New test
source.
* testsuite/binutils-all/mips/mips.exp: Run the new test.

opcodes/
* mips-dis.c (is_compressed_mode_p): Add `micromips_p' operand,
replacing references to `micromips_ase' throughout.
(_print_insn_mips): Don't use file-level microMIPS annotation to
determine the disassembly mode with the symbol table.

8 years agoUpdated Swedish translations for bfd and binutils
Nick Clifton [Wed, 18 May 2016 11:44:43 +0000 (12:44 +0100)]
Updated Swedish translations for bfd and binutils

8 years agorx: make field type enum
Trevor Saunders [Sat, 14 May 2016 08:33:53 +0000 (04:33 -0400)]
rx: make field type enum

gas/ChangeLog:

2016-05-18  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

* config/tc-rx.c (struct cpu_type): Change the type of a field from
int to enum rx_cpu_types.

8 years agochange the type of some fields to bfd_reloc_code_real_type
Trevor Saunders [Sat, 14 May 2016 06:34:23 +0000 (02:34 -0400)]
change the type of some fields to bfd_reloc_code_real_type

gas/ChangeLog:

2016-05-18  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

* config/tc-dlx.c (struct machine_it): change the type of a field from
int to bfd_reloc_code_real_type.
* config/tc-tic4x.c: Likewise.

8 years agocommit ChangeLog for previous commit
Trevor Saunders [Wed, 18 May 2016 10:17:33 +0000 (06:17 -0400)]
commit ChangeLog for previous commit

8 years agoChange type of v850_target_arch to enum bfd_architecture
Trevor Saunders [Mon, 16 May 2016 22:04:17 +0000 (18:04 -0400)]
Change type of v850_target_arch to enum bfd_architecture

gas/ChangeLog:

2016-05-18  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

* config/tc-v850.c (v850_target_arch): change type to enum
bfd_architecture.
* config/tc-v850.h (v850_target_arch): Likewise.

8 years agoFix lots of linker testsuite failures for the FT32 target.
Nick Clifton [Wed, 18 May 2016 09:11:47 +0000 (10:11 +0100)]
Fix lots of linker testsuite failures for the FT32 target.

* scripttempl/ft32.sc: Use fixed constants for memory region
lengths.  Include DWARF debug sections.
(.data .bss): Do not assign locations during relocatable links.
* testsuite/ld-elf/compressed1d.d: Skip for FT32.
* testsuite/ld-elf/sec-to-seg.exp: Likewise.
* testsuite/ld-elf/sec64k.exp: Likewise.
* testsuite/ld-elf/init-fini-array.d: XFail for FT32.
* testsuite/ld-elf/merge.d: Likewise.
* testsuite/ld-elf/orphan-region.d: Likewise.
* testsuite/ld-elf/orphan.s: Likewise.
* testsuite/ld-elf/orphan3.d: Likewise.
* testsuite/ld-elf/pr349.d: Likewise.
* testsuite/ld-elf/warn2.d: Likewise.
* testsuite/lib/ld-lib.exp (check_shared_lib_support): Note
that the FT32 does not support shared libraries.

8 years agoelf32-arm.c build breakage
Alan Modra [Wed, 18 May 2016 06:14:46 +0000 (15:44 +0930)]
elf32-arm.c build breakage

* elf32-arm.c (elf32_arm_size_stubs): Free or cache local syms
for each BFD.  Don't goto error_ret_free_local from outside loop.

8 years agoMIPS/readelf: Use the `d_val' dynamic entry member with the relevant tags
Maciej W. Rozycki [Wed, 18 May 2016 03:30:50 +0000 (04:30 +0100)]
MIPS/readelf: Use the `d_val' dynamic entry member with the relevant tags

binutils/
* readelf.c (dynamic_section_mips_val) <DT_MIPS_RLD_VERSION>
<DT_MIPS_LOCAL_GOTNO, DT_MIPS_CONFLICTNO, DT_MIPS_LIBLISTNO>
<DT_MIPS_SYMTABNO, DT_MIPS_UNREFEXTNO, DT_MIPS_HIPAGENO>
<DT_MIPS_DELTA_CLASS_NO, DT_MIPS_DELTA_INSTANCE_NO>
<DT_MIPS_DELTA_RELOC_NO, DT_MIPS_DELTA_SYM_NO>
<DT_MIPS_DELTA_CLASSSYM_NO, DT_MIPS_COMPACT_SIZE>: Use the
`d_val' rather than `d_ptr' member of the dynamic entry.

8 years agoPPC_OPERAND_SIGNOPT range.
Alan Modra [Wed, 18 May 2016 01:57:56 +0000 (11:27 +0930)]
PPC_OPERAND_SIGNOPT range.

Commit b84bf58a accidentally extended the range of allowed negative
numbers.

* config/tc-ppc.c (ppc_insert_operand): Trim PPC_OPERAND_SIGNOPT
allowed negative range.
* testsuite/gas/ppc/power9.s: Test xxspltib of -128, not -256.
* testsuite/gas/ppc/power9.d: Update.

8 years agoAutomatic date update in version.in
GDB Administrator [Wed, 18 May 2016 00:00:18 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years agoFix -exec-run not running asynchronously with mi-async on (PR gdb/18077)
Simon Marchi [Tue, 17 May 2016 20:44:57 +0000 (16:44 -0400)]
Fix -exec-run not running asynchronously with mi-async on (PR gdb/18077)

When doing -exec-run on a freshly started GDB, the only target on the
target stack at the time the dummy one.  When mi_async_p is called to
know whether the run should be async, it queries whether the current
target (dummy) supports async, and the answer is no.  The fix is to make
the code query the target that will be used for the run, which is not
necessarily the current target.

No regressions in the gdb.mi directory using the unix, native-gdbserver
and native-extended-gdbserver boards.  The test doesn't pass when
forcing maint set target-async off, obviously, since it makes mi-async
have no effect.  It doesn't seem like other tests are checking for that
eventuality, so I didn't in the new test.

gdb/ChangeLog:

* mi/mi-main.c (run_one_inferior): Use run target to determine
whether to run async or not.
(mi_cmd_exec_run): Likewise.

gdb/testsuite/ChangeLog:

* gdb.mi/mi-async-run.exp: New file.
* gdb.mi/mi-async-run.c: New file.

8 years agoRename OP_F90_RANGE to OP_RANGE.
Tom Tromey [Wed, 27 Apr 2016 16:28:56 +0000 (10:28 -0600)]
Rename OP_F90_RANGE to OP_RANGE.

This renames OP_F90_RANGE to OP_RANGE, and similarly renames the
f90_range_type enum.

2016-05-17  Tom Tromey  <tom@tromey.com>

* std-operator.def (OP_RANGE): Rename from OP_F90_RANGE.
* rust-lang.c: Don't include f-lang.h.
(rust_range, rust_compute_range, rust_subscript)
(rust_evaluate_subexp): Update.
* rust-exp.y: Don't include f-lang.h.
(ast_range, convert_ast_to_expression): Update.
* parse.c (operator_length_standard): Update.
* f-lang.h (enum f90_range_type): Move to expression.h.
* f-exp.y: Use OP_RANGE.
* expression.h (enum range_type): New enum; renamed from
f90_range_type.
* expprint.c: Don't include f-lang.h.
(print_subexp_standard, dump_subexp_body_standard): Use OP_RANGE.
* eval.c (value_f90_subarray, evaluate_subexp_standard): Update.

8 years agoAdd Rust documentation
Tom Tromey [Wed, 27 Apr 2016 01:38:56 +0000 (19:38 -0600)]
Add Rust documentation

This patch adds documentation for the new Rust support in gdb.

2016-05-17  Tom Tromey  <tom@tromey.com>

* NEWS: Add Rust item.

2016-05-17  Tom Tromey  <tom@tromey.com>

* gdb.texinfo (Supported Languages): Mention Rust.  Update menu.
(Rust): New node.

8 years agoUpdate gdb test suite for Rust
Tom Tromey [Wed, 27 Apr 2016 01:38:43 +0000 (19:38 -0600)]
Update gdb test suite for Rust

This updates the gdb test suite for Rust.

2016-05-17  Tom Tromey  <tom@tromey.com>
    Manish Goregaokar <manishsmail@gmail.com>

* lib/rust-support.exp: New file.
* lib/gdb.exp (skip_rust_tests): New proc.
(build_executable_from_specs): Handle rust.
* lib/future.exp (gdb_find_rustc): New proc.
(gdb_default_target_compile): Handle rust.
* gdb.rust/expr.exp: New file.
* gdb.rust/generics.exp: New file.
* gdb.rust/generics.rs: New file.
* gdb.rust/methods.exp: New file.
* gdb.rust/methods.rs: New file.
* gdb.rust/modules.exp: New file.
* gdb.rust/modules.rs: New file.
* gdb.rust/simple.exp: New file.
* gdb.rust/simple.rs: New file.

8 years agoAdd support for the Rust language
Tom Tromey [Wed, 27 Apr 2016 01:38:08 +0000 (19:38 -0600)]
Add support for the Rust language

This patch adds support for the Rust language.

2016-05-17  Tom Tromey  <tom@tromey.com>
    Manish Goregaokar <manishsmail@gmail.com>

* symtab.c (symbol_find_demangled_name): Handle Rust.
* symfile.c (init_filename_language_table): Treat ".rs" as Rust.
* std-operator.def (STRUCTOP_ANONYMOUS, OP_RUST_ARRAY): New
constants.
* rust-lang.h: New file.
* rust-lang.c: New file.
* rust-exp.y: New file.
* dwarf2read.c (read_file_scope): Add Rust producer sniffing.
(dwarf2_compute_name, read_func_scope, read_structure_type)
(read_base_type, read_subrange_type, set_cu_language)
(new_symbol_full, determine_prefix): Handle Rust.
* defs.h (enum language) <language_rust>: New constant.
* Makefile.in (SFILES): Add rust-exp.y, rust-lang.c.
(COMMON_OBS): Add rust-exp.o, rust-lang.o.

2016-05-17  Tom Tromey  <tom@tromey.com>

* gdb.base/default.exp (set language): Add rust.

8 years agoAdd array start and end strings to generic_val_print_decorations
Tom Tromey [Tue, 26 Apr 2016 22:45:21 +0000 (16:45 -0600)]
Add array start and end strings to generic_val_print_decorations

For Rust value-printing, I wanted to use generic_val_print_array, but
I also wanted to control the starting and ending strings.

This patch adds new strings to generic_val_print_decorations, updates
generic_val_print_array to use them, and updates all the existing
instances of generic_val_print_decorations.

2016-05-17  Tom Tromey  <tom@tromey.com>

* valprint.h (struct generic_val_print_array) <array_start,
array_end>: New fields.
* valprint.c (generic_val_print_array): Add "decorations"
parameter.  Use "array_start", "array_end".
(generic_val_print) <TYPE_CODE_ARRAY>: Update.
* p-valprint.c (p_decorations): Update.
* m2-valprint.c (m2_decorations): Update.
* f-valprint.c (f_decorations): Update.
* c-valprint.c (c_decorations): Update.

8 years agoAdd self-test framework to gdb
Tom Tromey [Wed, 20 Apr 2016 16:09:53 +0000 (10:09 -0600)]
Add self-test framework to gdb

I wanted to unit test the Rust lexer, so I added a simple unit testing
command to gdb.

The intent is that self tests will only be compiled into gdb in
development mode.  In release mode they simply won't exist.  So, this
exposes $development to C code as GDB_SELF_TEST.

In development mode, test functions are registered with the self test
module.  A test function is just a function that does some checks, and
throws an exception on failure.

Then this adds a new "maint selftest" command which invokes the test
functions, and a new dejagnu test case that invokes it.

2016-05-17  Tom Tromey  <tom@tromey.com>

* NEWS: Add "maint selftest" entry.
* selftest.h: New file.
* selftest.c: New file.
* maint.c: Include selftest.h.
(maintenance_selftest): New function.
(_initialize_maint_cmds): Add "maint selftest" command.
* configure.ac (GDB_SELF_TEST): Maybe define.
* config.in, configure: Rebuild.
* Makefile.in (SFILES): Add selftest.c.
(COMMON_OBS): Add selftest.o.

2016-05-17  Tom Tromey  <tom@tromey.com>

* gdb.texinfo (Maintenance Commands): Document "maint selftest".

2016-05-17  Tom Tromey  <tom@tromey.com>

* gdb.gdb/unittest.exp: New file.

8 years agoMake gdb expression debugging handle OP_F90_RANGE
Tom Tromey [Wed, 20 Apr 2016 14:14:16 +0000 (08:14 -0600)]
Make gdb expression debugging handle OP_F90_RANGE

print_subexp_standard and dump_subexp_body_standard did not handle
OP_F90_RANGE.  Attempting to dump an expression using this opcode
would fail.

This patch adds support for this opcode to these functions.

2016-05-17  Tom Tromey  <tom@tromey.com>

* expprint.c: Include f-lang.h.
(print_subexp_standard, dump_subexp_body_standard): Handle
OP_F90_RANGE.

8 years agoFix latent yacc-related bug in gdb/Makefile.in init.c rule
Tom Tromey [Thu, 31 Mar 2016 20:16:56 +0000 (14:16 -0600)]
Fix latent yacc-related bug in gdb/Makefile.in init.c rule

gdb's Makefile.in does not currently scan .y files to add global
initializers from these files to init.c.  However, at least ada-exp.y
tries to use this feature.

This patch fixes the problem.

2016-05-17  Tom Tromey  <tom@tromey.com>

* Makefile.in (init.c): Search .y files for initialization
functions.

8 years agoAdd DW_LANG_Rust
Tom Tromey [Mon, 16 May 2016 18:21:49 +0000 (12:21 -0600)]
Add DW_LANG_Rust

include/
* dwarf2.h (enum dwarf_source_language) <DW_LANG_Rust,
DW_LANG_Rust_old>: New constants.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@235643 138bc75d-0d04-0410-961f-82ee72b054a4

8 years agoCheck global CC in at_least_gcc_version
H.J. Lu [Tue, 17 May 2016 16:55:05 +0000 (09:55 -0700)]
Check global CC in at_least_gcc_version

at_least_gcc_version should check global CC.

* testsuite/lib/ld-lib.exp (at_least_gcc_version): Check
global CC.

8 years agoFix date in ChangeLog
H.J. Lu [Tue, 17 May 2016 16:53:44 +0000 (09:53 -0700)]
Fix date in ChangeLog

8 years agoMake ARMv8-M GAS tests pass on non ELF targets
Thomas Preud'homme [Tue, 17 May 2016 15:35:12 +0000 (16:35 +0100)]
Make ARMv8-M GAS tests pass on non ELF targets

2016-05-17  Thomas Preud'homme  <thomas.preudhomme@arm.com>

gas/
* testsuite/gas/arm/archv8m-cmse-msr-base.d: Force Thumb when
disassembling and stop skipping targets.
* testsuite/gas/arm/archv8m-cmse-msr-main.d: Likewise.
* testsuite/gas/arm/archv8m-main-dsp-4.d: Likewise.
* testsuite/gas/arm/archv8m-base.d: Also allow nops after the last
instruction for targets that have stronger alignment requirement.
* testsuite/gas/arm/archv8m-cmse-base.d: Likewise.
* testsuite/gas/arm/archv8m-cmse-main-1.d: Likewise.
* testsuite/gas/arm/archv8m-cmse-main-2.d: Likewise.
* testsuite/gas/arm/archv8m-main-dsp-1.d: Likewise.
* testsuite/gas/arm/archv8m-main-dsp-2.d: Likewise.
* testsuite/gas/arm/archv8m-main-dsp-3.d: Likewise.
* testsuite/gas/arm/archv8m-main.d: Likewise.
* testsuite/gas/arm/archv8m.s: Add label.
* testsuite/gas/arm/archv8m-cmse.s: Likewise.
* testsuite/gas/arm/archv8m-cmse-msr.s: Likewise.
* testsuite/gas/arm/archv8m-cmse-main.s: Likewise.

8 years agoPlace progmem data from AVR's libc before other progmem data.
Senthil Kumar Selvaraj [Tue, 17 May 2016 12:14:26 +0000 (13:14 +0100)]
Place progmem data from AVR's libc before other progmem data.

* scripttempl/avr.sc (text): Place .progmem.data from avr-libc
above .progmem*.
* scripttempl/avrtiny.sc (text): Likewise.

8 years agoLD/ELF: Unify STB_GNU_UNIQUE handling
Maciej W. Rozycki [Mon, 16 May 2016 07:51:26 +0000 (08:51 +0100)]
LD/ELF: Unify STB_GNU_UNIQUE handling

Take STB_GNU_UNIQUE handling scattered across targets and gather it in
the generic ELF linker.  Update test suite infrastructure accordingly.

bfd/
* elf-s390-common.c (elf_s390_add_symbol_hook): Remove
STB_GNU_UNIQUE handling.
* elf32-arc.c (elf_arc_add_symbol_hook): Likewise.
* elf32-arm.c (elf32_arm_add_symbol_hook): Likewise.
* elf32-m68k.c (elf_m68k_add_symbol_hook): Likewise.
* elf32-ppc.c (ppc_elf_add_symbol_hook): Likewise.
* elf32-sparc.c (elf32_sparc_add_symbol_hook): Likewise.
* elf64-ppc.c (ppc64_elf_add_symbol_hook): Likewise.
* elf64-sparc.c (elf64_sparc_add_symbol_hook): Likewise.
* elf64-x86-64.c (elf_x86_64_add_symbol_hook): Likewise.
* elfxx-aarch64.c (_bfd_aarch64_elf_add_symbol_hook): Likewise.
* elfxx-mips.c (_bfd_mips_elf_add_symbol_hook): Likewise.
* elf32-i386.c (elf_i386_add_symbol_hook): Remove function.
(elf_backend_add_symbol_hook): Remove macro.
* elflink.c (elf_link_add_object_symbols): Set `has_gnu_symbols'
for STB_GNU_UNIQUE symbols.

binutils/
* testsuite/lib/binutils-common.exp (supports_gnu_unique): New
procedure.
* testsuite/binutils-all/objcopy.exp: Use `supports_gnu_unique'
with the `strip-10' test.

ld/
* testsuite/ld-unique/unique.exp: Use `is_elf_format' and
`supports_gnu_unique' to qualify testing.

8 years agoUse unsuspend_all_lwps
Yao Qi [Tue, 17 May 2016 07:24:26 +0000 (08:24 +0100)]
Use unsuspend_all_lwps

This patch is to replace find_inferior (&all_threads, unsuspend_one_lwp, NULL)
with unsuspend_all_lwps (NULL), which is shorter.  They are equivalent
to each other.

gdb/gdbserver:

2016-05-17  Yao Qi  <yao.qi@linaro.org>

* linux-low.c (linux_stabilize_threads): Call unsuspend_all_lwps
instead of find_inferior.

8 years agoAutomatic date update in version.in
GDB Administrator [Tue, 17 May 2016 00:00:18 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years agoMatch shell_prompt # in batch-preserve-term-settings.exp
Yao Qi [Mon, 16 May 2016 16:32:43 +0000 (17:32 +0100)]
Match shell_prompt # in batch-preserve-term-settings.exp

batch-preserve-term-settings.exp fails if the shell prompt isn't $.  It
is # in our testing env.  In fact, the shell prompt can be anything.

The perfect solution would be "set_board_info shell_prompt" in the
host board file, and use board_info shell_prompt in
batch-preserve-term-settings.exp.  This is a little bit overkill to
me, and we still need to figure out the different prompts on different
shells.  I also tried to start shell with the prompt preset, but there is
not unique way to set shell prompt in different shells, so I give up.

It is reasonably simple to match either $ or # for the shell prompt, and
we can easily extend it to match other char, like >.

gdb/testsuite:

2016-05-16  Yao Qi  <yao.qi@linaro.org>

* gdb.base/batch-preserve-term-settings.exp: Remove variable
shell_prompt.  Update shell_prompt_re.

8 years agoV850/BFD: Call `_bfd_elf_copy_private_bfd_data' again
Maciej W. Rozycki [Mon, 16 May 2016 07:22:59 +0000 (08:22 +0100)]
V850/BFD: Call `_bfd_elf_copy_private_bfd_data' again

Correct a regression introduced with commit 685080f21003 ("Adds support
for generating notes in V850 binaries.") which replaced rather than
extending the call to `_bfd_elf_copy_private_bfd_data' with
`v850_elf_copy_private_bfd_data'.  Consequently ELFOSABI_GNU marking is
not propagated to output by `objcopy' from objects containing
STB_GNU_UNIQUE symbols.

bfd/
* elf32-v850.c (v850_elf_copy_notes): New function, factored out
from...
(v850_elf_copy_private_bfd_data): ... here.  Call the new
function and `_bfd_elf_copy_private_bfd_data'.

binutils/
* testsuite/binutils-all/objcopy.exp: Don't skip the `strip-10'
test for the V850.

8 years agom32r: make mach_table static and const
Trevor Saunders [Sat, 14 May 2016 20:31:45 +0000 (16:31 -0400)]
m32r: make mach_table static and const

It is only read in tc-m32r.c, so it might as well be static and const, and
that should help the compiler slightly.

gas/ChangeLog:

2016-05-16  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

* config/tc-m32r.c (mach_table): Make static and const.

8 years agotc-vax.c: make prototype of flonum_gen2vax match its definition
Trevor Saunders [Sat, 14 May 2016 06:34:02 +0000 (02:34 -0400)]
tc-vax.c: make prototype of flonum_gen2vax match its definition

gas/ChangeLog:

2016-05-16  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

* config/tc-vax.c (flonum_gen2vax): Adjust prototype to match
definition.

8 years agostop defining linkrelax in multiple places
Trevor Saunders [Sat, 14 May 2016 04:34:05 +0000 (00:34 -0400)]
stop defining linkrelax in multiple places

Defining linkrelax to have different values in as.c and tc-msp430.c /
tc-mn10300.c is at least rather tricky, and seems fragile, when we can just set
it in md_begin instead.

gas/ChangeLog:

2016-05-16  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

* config/tc-mn10300.c (md_begin): set linkrelax here instead of
defining it.
* config/tc-msp430.c (md_begin): Likewise.

8 years agom68hc11: make some vars type bfd_reloc_code_real_type
Trevor Saunders [Sat, 14 May 2016 19:27:26 +0000 (15:27 -0400)]
m68hc11: make some vars type bfd_reloc_code_real_type

These variables only hold values from the bfd_reloc_code_real_type enum, and
are passed to functions that expect the argument to be of type
bfd_reloc_code_real_type, so it seems to make sense that there type is
bfd_reloc_code_real_type rather than int.

gas/ChangeLog:

2016-05-16  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

* config/tc-m68hc11.c (fixup8): Change variables type from int to
bfd_reloc_code_real_type where appropriate.
(fixup16): Likewise.
(fixup8_xg): Likewise.

8 years agold/testsuite/ld-elf/flags1.d: Update the xfail list
Maciej W. Rozycki [Sun, 15 May 2016 05:49:54 +0000 (06:49 +0100)]
ld/testsuite/ld-elf/flags1.d: Update the xfail list

Update to match commit 924bc11ba455 ("Update section merge test.").

ld/
* testsuite/ld-elf/flags1.d: Update the xfail list.

8 years agoAutomatic date update in version.in
GDB Administrator [Mon, 16 May 2016 00:00:08 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years agoSH64/GAS: Fix a -Wwrite-strings build failure
Maciej W. Rozycki [Sun, 15 May 2016 22:14:52 +0000 (23:14 +0100)]
SH64/GAS: Fix a -Wwrite-strings build failure

Fix a commit 6757cf57697d ("enable -Wwrite-strings for gas") regression.

gas/
* config/tc-sh64.c (shmedia_check_limits): Constify `msg'.

8 years agold/testsuite/ld-elf/flags1.d: Update for `*-*-nacl*' xfail removal
Maciej W. Rozycki [Sun, 15 May 2016 05:39:14 +0000 (06:39 +0100)]
ld/testsuite/ld-elf/flags1.d: Update for `*-*-nacl*' xfail removal

ld/
* testsuite/ld-elf/flags1.d: Update for `*-*-nacl*' xfail
removal.

8 years agoAutomatic date update in version.in
GDB Administrator [Sun, 15 May 2016 00:00:08 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years agoRemove redundant sizeof on EXPECTED_VIEW_LENGTH
H.J. Lu [Sat, 14 May 2016 12:51:28 +0000 (05:51 -0700)]
Remove redundant sizeof on EXPECTED_VIEW_LENGTH

PR ld/20097
* testplug2.c (onall_symbols_read): Remove redundant sizeof
on EXPECTED_VIEW_LENGTH.
* testplug4.c (onall_symbols_read): Likewise.

8 years agoAutomatic date update in version.in
GDB Administrator [Sat, 14 May 2016 00:00:14 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years agoAccept valid one byte signed and unsigned values for the IMM8 operand.
Peter Bergner [Fri, 13 May 2016 20:15:00 +0000 (15:15 -0500)]
Accept valid one byte signed and unsigned values for the IMM8 operand.

opcodes/
* ppc-opc.c (IMM8): Use PPC_OPERAND_SIGNOPT.

gas/
* testsuite/gas/ppc/power9.d <xxspltib>: Add additional operand tests.
* testsuite/gas/ppc/power9.s: Likewise.

8 years agoDon't convert GOTPCREL relocation against large section
H.J. Lu [Fri, 13 May 2016 17:59:32 +0000 (10:59 -0700)]
Don't convert GOTPCREL relocation against large section

bfd/

PR ld/20093
* elf64-x86-64.c (elf_x86_64_convert_load_reloc): Don't convert
GOTPCREL relocation against large section.

ld/

PR ld/20093
* testsuite/ld-x86-64/pr20093-1.d: New file.
* testsuite/ld-x86-64/pr20093-1.s: Likewise.
* testsuite/ld-x86-64/pr20093-2.d: Likewise.
* testsuite/ld-x86-64/pr20093-2.s: Likewise.
* testsuite/ld-x86-64/x86-64.exp: Run pr20093-1 and pr20093-2.

8 years agoFix build breakage
Alan Modra [Fri, 13 May 2016 06:27:10 +0000 (15:57 +0930)]
Fix build breakage

* config/obj-coff.c (weak_uniquify): Delete unused var.

8 years agoSet dynamic tag VMA and size from dynamic section when possible
Alan Modra [Fri, 13 May 2016 02:18:56 +0000 (11:48 +0930)]
Set dynamic tag VMA and size from dynamic section when possible

Rather than searching the output for a specific named section, it's
better, where possible, to use a linker created dynamic section to set
a dynamic tag's value.  That way ld doesn't depend on the output
section name, making it possibile to map dynamic sections differently.

bfd/
* elf-m10300.c (_bfd_mn10300_elf_finish_dynamic_sections): Use
linker dynamic sections in calculating size and address of
* dynamic tags rather than using output sections.  Remove asserts.
* elf32-arm.c (elf32_arm_finish_dynamic_sections): Likewise.
* elf32-cr16.c (_bfd_cr16_elf_finish_dynamic_sections): Likewise.
* elf32-cris.c (elf_cris_finish_dynamic_sections): Likewise.
* elf32-i370.c (i370_elf_finish_dynamic_sections): Likewise.
* elf32-lm32.c (lm32_elf_finish_dynamic_sections): Likewise.
* elf32-m32r.c (m32r_elf_finish_dynamic_sections): Likewise.
* elf32-m68k.c (elf_m68k_finish_dynamic_sections): Likewise.
* elf32-metag.c (elf_metag_finish_dynamic_sections): Likewise.
* elf32-microblaze.c (microblaze_elf_finish_dynamic_sections): Likewise.
* elf32-nds32.c (nds32_elf_finish_dynamic_sections): Likewise.
* elf32-nios2.c (nios2_elf32_finish_dynamic_sections): Likewise.
* elf32-or1k.c (or1k_elf_finish_dynamic_sections): Likewise.
* elf32-s390.c (elf_s390_finish_dynamic_sections): Likewise.
* elf32-score.c (s3_bfd_score_elf_finish_dynamic_sections): Likewise.
* elf32-score7.c (s7_bfd_score_elf_finish_dynamic_sections): Likewise.
* elf32-vax.c (elf_vax_finish_dynamic_sections): Likewise.
* elf32-xtensa.c (elf_xtensa_finish_dynamic_sections): Likewise.
* elf64-alpha.c (elf64_alpha_finish_dynamic_sections): Likewise.
* elf64-s390.c (elf_s390_finish_dynamic_sections): Likewise.
* elf64-sh64.c (sh64_elf64_finish_dynamic_sections): Likewise.
* elflink.c (bfd_elf_final_link): Likewise.
* elfxx-mips.c (_bfd_mips_elf_finish_dynamic_sections): Likewise.
* elfxx-sparc.c (sparc_finish_dyn): Likewise.  Adjust error message.
* elf32-arc.c (GET_SYMBOL_OR_SECTION): Remove ASSERT arg and
don't set doit.  Look up dynobj section.
(elf_arc_finish_dynamic_sections): Adjust GET_SYMBOL_OR_SECTION
invocation and dynamic tag vma calculation.  Don't test
boolean var == TRUE.
* elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_sections): Fix
DT_JMPREL calc.
ld/
* testsuite/ld-arm/arm-elf.exp: Adjust for arm-no-rel-plt now passing.
Use different output file name for static app without .rel.plt.
* testsuite/ld-arm/arm-no-rel-plt.ld: Align .rel.dyn and .rela.dyn.
* testsuite/ld-arm/arm-no-rel-plt.out: Delete.
* testsuite/ld-arm/arm-no-rel-plt.r: New.
* testsuite/ld-arm/arm-static-app.d: Don't check file name.
* testsuite/ld-arm/arm-static-app.r: Likewise.

8 years agold -z combreloc elf_link_sort_relocs
Alan Modra [Fri, 13 May 2016 02:04:56 +0000 (11:34 +0930)]
ld -z combreloc elf_link_sort_relocs

A linker script may put .rela.plt in with other .rela.dyn relocs.
The change to elf_reloc_type_class puts any PLT relocs last.  This
patch makes the input section layout better match the sorted relocs.

* elflink.c (elf_link_sort_relocs): Wrap overlong lines.  Fix
octets_per_byte.  Put dynamic .rela.plt last in link orders.
Assign output_offset for reloc sections rather than writing
sorted relocs from block corresponding to output_offset.

8 years agouse XNEW and related macros more
Trevor Saunders [Wed, 6 Apr 2016 20:26:46 +0000 (16:26 -0400)]
use XNEW and related macros more

Its a bit shorter and simpler than raw xmalloc.

gas/ChangeLog:

2016-05-13  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

* app.c (app_push): Use XNEW and related macros.
* as.c (parse_args): Likewise.
* cgen.c (make_right_shifted_expr): Likewise.
(gas_cgen_tc_gen_reloc): Likewise.
* config/bfin-defs.h: Likewise.
* config/bfin-parse.y: Likewise.
* config/obj-coff.c (stack_init): Likewise.
(stack_push): Likewise.
(coff_obj_symbol_new_hook): Likewise.
(coff_obj_symbol_clone_hook): Likewise.
(add_lineno): Likewise.
(coff_frob_symbol): Likewise.
* config/obj-elf.c (obj_elf_section_name): Likewise.
(build_group_lists): Likewise.
* config/obj-evax.c (evax_symbol_new_hook): Likewise.
* config/obj-macho.c (obj_mach_o_indirect_symbol): Likewise.
* config/tc-aarch64.c (insert_reg_alias): Likewise.
(find_or_make_literal_pool): Likewise.
(add_to_lit_pool): Likewise.
(fill_instruction_hash_table): Likewise.
* config/tc-alpha.c (load_expression): Likewise.
(emit_jsrjmp): Likewise.
(s_alpha_ent): Likewise.
(s_alpha_end): Likewise.
(s_alpha_linkage): Likewise.
(md_begin): Likewise.
(tc_gen_reloc): Likewise.
* config/tc-arc.c (arc_insert_opcode): Likewise.
(arc_extcorereg): Likewise.
* config/tc-bfin.c: Likewise.
* config/tc-cr16.c: Likewise.
* config/tc-cris.c: Likewise.
* config/tc-crx.c (preprocess_reglist): Likewise.
* config/tc-d10v.c: Likewise.
* config/tc-frv.c (frv_insert_vliw_insn): Likewise.
(frv_tomcat_shuffle): Likewise.
* config/tc-h8300.c: Likewise.
* config/tc-i370.c (i370_macro): Likewise.
* config/tc-i386.c (lex_got): Likewise.
(md_parse_option): Likewise.
* config/tc-ia64.c (alloc_record): Likewise.
(set_imask): Likewise.
(save_prologue_count): Likewise.
(dot_proc): Likewise.
(dot_endp): Likewise.
(ia64_frob_label): Likewise.
(add_qp_imply): Likewise.
(add_qp_mutex): Likewise.
(mark_resource): Likewise.
(dot_alias): Likewise.
* config/tc-m68hc11.c: Likewise.
* config/tc-m68k.c (m68k_frob_label): Likewise.
(s_save): Likewise.
(mri_control_label): Likewise.
(push_mri_control): Likewise.
(build_mri_control_operand): Likewise.
(s_mri_else): Likewise.
(s_mri_break): Likewise.
(s_mri_next): Likewise.
(s_mri_for): Likewise.
(s_mri_endw): Likewise.
* config/tc-metag.c (create_mnemonic_htab): Likewise.
* config/tc-microblaze.c: Likewise.
* config/tc-mmix.c (s_loc): Likewise.
* config/tc-nds32.c (nds32_relax_hint): Likewise.
* config/tc-nios2.c (nios2_insn_reloc_new): Likewise.
* config/tc-rl78.c: Likewise.
* config/tc-rx.c (rx_include): Likewise.
* config/tc-sh.c: Likewise.
* config/tc-sh64.c (shmedia_frob_section_type): Likewise.
* config/tc-sparc.c: Likewise.
* config/tc-spu.c: Likewise.
* config/tc-tic6x.c (static tic6x_unwind_info *tic6x_get_unwind): Likewise.
(tic6x_start_unwind_section): Likewise.
* config/tc-tilegx.c: Likewise.
* config/tc-tilepro.c: Likewise.
* config/tc-v850.c: Likewise.
* config/tc-visium.c: Likewise.
* config/tc-xgate.c: Likewise.
* config/tc-xtensa.c (xtensa_translate_old_userreg_ops): Likewise.
(new_resource_table): Likewise.
(resize_resource_table): Likewise.
(xtensa_create_trampoline_frag): Likewise.
(xtensa_maybe_create_literal_pool_frag): Likewise.
(cache_literal_section): Likewise.
* config/xtensa-relax.c (append_transition): Likewise.
(append_condition): Likewise.
(append_value_condition): Likewise.
(append_constant_value_condition): Likewise.
(append_literal_op): Likewise.
(append_label_op): Likewise.
(append_constant_op): Likewise.
(append_field_op): Likewise.
(append_user_fn_field_op): Likewise.
(enter_opname_n): Likewise.
(enter_opname): Likewise.
(split_string): Likewise.
(parse_insn_templ): Likewise.
(clone_req_or_option_list): Likewise.
(clone_req_option_list): Likewise.
(parse_option_cond): Likewise.
(parse_insn_pattern): Likewise.
(parse_insn_repl): Likewise.
(build_transition): Likewise.
(build_transition_table): Likewise.
* dw2gencfi.c (alloc_fde_entry): Likewise.
(alloc_cfi_insn_data): Likewise.
(cfi_add_CFA_remember_state): Likewise.
(dot_cfi_escape): Likewise.
(dot_cfi_fde_data): Likewise.
(select_cie_for_fde): Likewise.
* dwarf2dbg.c (dwarf2_directive_loc): Likewise.
* ecoff.c (ecoff_add_bytes): Likewise.
(ecoff_build_debug): Likewise.
* input-scrub.c (input_scrub_push): Likewise.
(input_scrub_begin): Likewise.
(input_scrub_next_buffer): Likewise.
* itbl-ops.c (append_insns_as_macros): Likewise.
(alloc_entry): Likewise.
(alloc_field): Likewise.
* listing.c (listing_newline): Likewise.
(listing_listing): Likewise.
* macro.c (get_any_string): Likewise.
(delete_macro): Likewise.
* stabs.c (generate_asm_file): Likewise.
(stabs_generate_asm_lineno): Likewise.
* subsegs.c (subseg_change): Likewise.
(subseg_get): Likewise.
* symbols.c (define_dollar_label): Likewise.
(symbol_relc_make_sym): Likewise.
* write.c (write_relocs): Likewise.

8 years agouse xstrdup, xmemdup0 and concat more
Trevor Saunders [Mon, 28 Mar 2016 09:49:15 +0000 (05:49 -0400)]
use xstrdup, xmemdup0 and concat more

gas/ChangeLog:

2016-05-13  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

* config/obj-coff.c (obj_coff_def): Simplify string copying.
(weak_name2altname): Likewise.
(weak_uniquify): Likewise.
(obj_coff_section): Likewise.
(obj_coff_init_stab_section): Likewise.
* config/obj-elf.c (obj_elf_section_name): Likewise.
(obj_elf_init_stab_section): Likewise.
* config/obj-evax.c (evax_shorten_name): Likewise.
* config/obj-macho.c (obj_mach_o_make_or_get_sect): Likewise.
* config/tc-aarch64.c (create_register_alias): Likewise.
* config/tc-alpha.c (load_expression): Likewise.
(s_alpha_file): Likewise.
(s_alpha_section_name): Likewise.
(tc_gen_reloc): Likewise.
* config/tc-arc.c (md_assemble): Likewise.
* config/tc-arm.c (create_neon_reg_alias): Likewise.
(start_unwind_section): Likewise.
* config/tc-hppa.c (pa_build_unwind_subspace): Likewise.
(hppa_elf_mark_end_of_function): Likewise.
* config/tc-nios2.c (nios2_modify_arg): Likewise.
(nios2_negate_arg): Likewise.
* config/tc-rx.c (rx_section): Likewise.
* config/tc-sh64.c (sh64_consume_datalabel): Likewise.
* config/tc-tic30.c (tic30_find_parallel_insn): Likewise.
* config/tc-tic54x.c (tic54x_include): Likewise.
(tic54x_macro_info): Likewise.
(subsym_get_arg): Likewise.
(subsym_substitute): Likewise.
(tic54x_start_line_hook): Likewise.
* config/tc-xtensa.c (xtensa_literal_prefix): Likewise.
(xg_reverse_shift_count): Likewise.
* config/xtensa-relax.c (enter_opname_n): Likewise.
(split_string): Likewise.
* dwarf2dbg.c (get_filenum): Likewise.
(process_entries): Likewise.
* expr.c (operand): Likewise.
* itbl-ops.c (alloc_entry): Likewise.
* listing.c (listing_message): Likewise.
(listing_title): Likewise.
* macro.c (check_macro): Likewise.
* stabs.c (s_xstab): Likewise.
* symbols.c (symbol_relc_make_expr): Likewise.
* write.c (compress_debug): Likewise.

8 years agoAutomatic date update in version.in
GDB Administrator [Fri, 13 May 2016 00:00:12 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years agoHandle symbols defined/referenced only within IR
H.J. Lu [Thu, 12 May 2016 23:50:34 +0000 (16:50 -0700)]
Handle symbols defined/referenced only within IR

The plugin is called to claim symbols in an archive element from
plugin_object_p.  But those symbols aren't needed to create output.
They are defined and referenced only within IR.  get_symbols should
return resolution based on IR symbol kinds.

PR ld/20070
* Makefile.am (noinst_LTLIBRARIES): Add libldtestplug4.la.
(libldtestplug4_la_SOURCES): New.
(libldtestplug4_la_CFLAGS): Likewise.
(libldtestplug4_la_LDFLAGS): Likewise.
* Makefile.in: Regenerated.
* plugin.c (get_symbols): Return resolution based on IR symbol
kinds for symbols defined/referenced only within IR.
* testplug4.c: New file.
* ld/testsuite/ld-plugin/pr20070.d: Likewise.
* ld/testsuite/ld-plugin/pr20070a.c: Likewise.
* ld/testsuite/ld-plugin/pr20070b.c: Likewise.
* testsuite/ld-plugin/plugin.exp (plugin4_name): New.
(plugin4_path): Likewise.
Add a test for ld/20070.

8 years agoPR symtab/19999 gdb unable to resolve vars with fission+PIE
Doug Evans [Thu, 12 May 2016 16:20:57 +0000 (09:20 -0700)]
PR symtab/19999 gdb unable to resolve vars with fission+PIE

gdb/ChangeLog:

* dwarf2loc.c (dwarf2_find_location_expression): For DWO files still
add base_offset.

gdb/testsuite/ChangeLog:

* lib/dwarf.exp (build_executable_from_fission_assembler): Pass
$options when building executable.
* gdb.dwarf2/fission-loclists-pie.c: New file.
* gdb.dwarf2/fission-loclists-pie.exp: New file.

8 years agoUse correct regexp syntax in ARM PR20068 test
Nick Clifton [Thu, 12 May 2016 16:19:44 +0000 (17:19 +0100)]
Use correct regexp syntax in ARM PR20068 test

8 years agold -z combreloc reloc sorting
Alan Modra [Thu, 12 May 2016 14:29:26 +0000 (23:59 +0930)]
ld -z combreloc reloc sorting

PLT relocs don't appear in .rela.dyn, at least not when using
normal linker scripts.  However, if they do, then they ought to be
placed last rather than in the middle of other relocs.

* elf-bfd.h (elf_reloc_type_class): Put reloc_class_plt last.

8 years agoAutomatic date update in version.in
GDB Administrator [Thu, 12 May 2016 00:00:11 +0000 (00:00 +0000)]
Automatic date update in version.in

8 years agoUpdate pr20068 test to allow for big endian ARM configuration
Nick Clifton [Wed, 11 May 2016 17:04:03 +0000 (18:04 +0100)]
Update pr20068 test to allow for big endian ARM configuration

8 years agoAdd MIPS32 DSPr3 support.
Matthew Fortune [Wed, 26 Nov 2014 11:15:01 +0000 (11:15 +0000)]
Add MIPS32 DSPr3 support.

bfd/

* elfxx-mips.c (print_mips_ases): Add DSPR3.

binutils/

* readelf.c (print_mips_ases): Add DSPR3.

gas/

* config/tc-mips.c (options): Add OPTION_DSPR3 and
OPTION_NO_DSPR3.
(md_longopts): Likewise.
(md_show_usage): Add help for -mdspr3 and -mno-dspr3.
(mips_ases): Define availability for DSPr3.
(mips_ase_groups): Add ASE_DSPR3 to the DSP group.
(mips_convert_ase_flags): Map ASE_DSPR3 to AFL_ASE_DSPR3.
* doc/as.texinfo: Document -mdspr3, -mno-dspr3.  Fix -mdspr2
formatting.
* doc/c-mips.texi: Document -mdspr3, -mno-dspr3, .set dspr3 and
.set nodspr3.  Fix -mdspr2 formatting.
* testsuite/gas/mips/mips32-dspr3.d: New file.
* testsuite/gas/mips/mips32-dspr3.s: Likewise.
* testsuite/gas/mips/mips.exp: Run mips32-dspr3 test.

include/

* elf/mips.h (AFL_ASE_DSPR3): New macro.
(AFL_ASE_MASK): Update to include AFL_ASE_DSPR3.
* opcode/mips.h (ASE_DSPR3): New macro.

opcodes/

* mips-dis.c (mips_arch_choices): Add ASE_DSPR3 to mips32r6 and
mips64r6.
* mips-opc.c (D34): New macro.
(mips_builtin_opcodes): Define bposge32c for DSPr3.

8 years ago[HPPA] Attach linker created dynamic sections to stub bfd
Alan Modra [Wed, 11 May 2016 13:21:14 +0000 (22:51 +0930)]
[HPPA] Attach linker created dynamic sections to stub bfd

bfd/
* elf32-hppa.c (elf32_hppa_init_stub_bfd): New function.
(elf32_hppa_check_relocs): Don't set dynobj.
(elf32_hppa_size_stubs): Test !SEC_LINKER_CREATED for stub sections.
(elf32_hppa_build_stubs): Likewise.
* elf32-hppa.h (elf32_hppa_init_stub_bfd): Declare.
ld/
* emultempl/hppaelf.em (hppaelf_create_output_section_statements):
Call elf32_hppa_init_stub_bfd.

8 years agold --gc-sections fail with __tls_get_addr_opt
Alan Modra [Wed, 11 May 2016 12:24:05 +0000 (21:54 +0930)]
ld --gc-sections fail with __tls_get_addr_opt

When --gc-sections is active, __tls_get_addr_opt is marked as not
needed and forced local before ppc*_elf_tls_setup is run.

bfd/
PR 20060
* elf64-ppc.c (ppc64_elf_tls_setup): Clear forced_local.
* elf32-ppc.c (ppc_elf_tls_setup): Likewise.
ld/
PR 20060
* testsuite/ld-powerpc/powerpc.exp: Run new tests.
* testsuite/ld-powerpc/tlsdll.s: New.
* testsuite/ld-powerpc/tlsdll.ver: New.
* testsuite/ld-powerpc/tlsdll_32.s: New.
* testsuite/ld-powerpc/tlsopt5.d: New.
* testsuite/ld-powerpc/tlsopt5.s: New.
* testsuite/ld-powerpc/tlsopt5_32.d: New.
* testsuite/ld-powerpc/tlsopt5_32.s: New.

8 years agoEnsure that padding in the constant pool uses constant values.
Nick Clifton [Wed, 11 May 2016 11:51:04 +0000 (12:51 +0100)]
Ensure that padding in the constant pool uses constant values.

PR target/20068
* config/tc-arm.c (add_to_lit_pool): Ensure that the padding added
to the pool uses O_constant.
* testsuite/gas/arm/pr20068.s: New test.
* testsuite/gas/arm/pr20068.d: Test driver.