platform/upstream/binutils.git
9 years agodaily update
Alan Modra [Thu, 6 Nov 2014 23:00:32 +0000 (09:30 +1030)]
daily update

9 years agodaily update
Alan Modra [Wed, 5 Nov 2014 23:00:28 +0000 (09:30 +1030)]
daily update

9 years agodaily update
Alan Modra [Tue, 4 Nov 2014 23:00:33 +0000 (09:30 +1030)]
daily update

9 years agoSet development to false.
Tristan Gingold [Tue, 4 Nov 2014 11:06:05 +0000 (12:06 +0100)]
Set development to false.

bfd/
2014-11-04  Tristan Gingold  <gingold@adacore.com>

* development.sh: Set development to false.

9 years agodaily update
Alan Modra [Mon, 3 Nov 2014 23:00:13 +0000 (09:30 +1030)]
daily update

9 years agoImport updated translations provided by the Translation Project:
Nick Clifton [Mon, 3 Nov 2014 12:33:35 +0000 (12:33 +0000)]
Import updated translations provided by the Translation Project:

       bfd, binutils, gprof, opcodes:
        * po/fi.po: Updated Finnish translation.

        binutils:
        * po/sv.po: Updated Swedish translation.

        gprof:
        * po/hu.po: New Hungarian translation.

9 years agoFixes a snafu checking the size of a 20-bit immediate.
Nick Clifton [Mon, 3 Nov 2014 11:17:45 +0000 (11:17 +0000)]
Fixes a snafu checking the size of a 20-bit immediate.

* config/tc-msp430.c (msp430_srcoperand): Fix range test for
20-bit values.

9 years agodaily update
Alan Modra [Sun, 2 Nov 2014 23:00:27 +0000 (09:30 +1030)]
daily update

9 years agodaily update
Alan Modra [Sat, 1 Nov 2014 23:00:13 +0000 (09:30 +1030)]
daily update

9 years agodaily update
Alan Modra [Fri, 31 Oct 2014 23:00:13 +0000 (09:30 +1030)]
daily update

9 years agoImport a patch from the mainline to fix a seg-fault in the BFD library:
Nick Clifton [Fri, 31 Oct 2014 10:24:58 +0000 (10:24 +0000)]
Import a patch from the mainline to fix a seg-fault in the BFD library:

PR binutils/17512
* ihex.c (ihex_scan): Fix typo in invocation of ihex_bad_byte.
* coffgen.c (coff_get_normalized_symtab): Prevent buffer overrun.

9 years agoImport a security patch from the mainline which changes the default behaviour
Nick Clifton [Fri, 31 Oct 2014 10:21:57 +0000 (10:21 +0000)]
Import a security patch from the mainline which changes the default behaviour
of the strings program to be --all rather then --data.  This avoids using the
BFD library by default, and so avoids exposing strings to any memory bugs
present in BFD.

* strings.c: Add new command line option --data to only scan the
initialized, loadable data secions of binaries.  Choose the
default behaviour of --all or --data based upon a configure
option.
* doc/binutils.texi (strings): Update documentation.  Include
description  of why the --data option might be unsafe.
* configure.ac: Add new option --disable-default-strings-all which
restores the old behaviour of strings using --data by default.  If
the option is not used make strings use --all by default.
* NEWS: Mention the new behaviour of strings.
* configure: Regenerate.
* config.in: Regenerate.

9 years agodaily update
Alan Modra [Thu, 30 Oct 2014 23:00:13 +0000 (09:30 +1030)]
daily update

9 years agoRemove the artificial limit on code alignment through the use of the
Dr Philipp Tomsich [Thu, 30 Oct 2014 10:51:04 +0000 (10:51 +0000)]
Remove the artificial limit on code alignment through the use of the
fixed part of a fragment for output generation only, which required
MAX_MEM_FOR_RS_ALIGN_CODE to be large enough to hold the maximum pad.

* config/tc-aarch64.h (MAX_MEM_FOR_RS_ALIGN_CODE): Define to 7.
* config/tc-aarch64.c (aarch64_handle_align): Rewrite to handle
large alignments with a constant fragment size of
MAX_MEM_FOR_RS_ALIGN_CODE.

9 years ago Fix error message strings so that they can be translated properly.
Nick Clifton [Thu, 30 Oct 2014 09:56:52 +0000 (09:56 +0000)]
 Fix error message strings so that they can be translated properly.

* readelf.c (CHECK_ENTSIZE_VALUES): Rewrite error message so that
there is a single string for translation.
(dynamic_section_mips_val): Likewise.

9 years agoFix a memory leak in the recent patch to detect loops in ELF section
Nick Clifton [Thu, 30 Oct 2014 09:37:45 +0000 (09:37 +0000)]
Fix a memory leak in the recent patch to detect loops in ELF section
string indicies.

* elf.c (bfd_section_from_shdr): Fix heap use after free memory
leak.

9 years agodaily update
Alan Modra [Wed, 29 Oct 2014 23:00:20 +0000 (09:30 +1030)]
daily update

9 years agoUpdated and New translations from the Translation Project.
Nick Clifton [Wed, 29 Oct 2014 16:37:32 +0000 (16:37 +0000)]
Updated and New translations from the Translation Project.

9 years agodaily update
Alan Modra [Tue, 28 Oct 2014 23:00:37 +0000 (09:30 +1030)]
daily update

9 years agoFixes another couple of memory errors reading corrupt binaries. This time
Nick Clifton [Tue, 28 Oct 2014 15:47:13 +0000 (15:47 +0000)]
Fixes another couple of memory errors reading corrupt binaries.  This time
detected by the address sanitizer.

PR binutils/17512
* elf.c (bfd_section_from_shdr): Allocate and free the recursion
detection table on a per-bfd basis.
* peXXigen.c (pe_print_edata): Handle binaries with a truncated
export table.

9 years agoMIPS Documentation fixes
Matthew Fortune [Tue, 21 Oct 2014 10:58:19 +0000 (11:58 +0100)]
MIPS Documentation fixes

Import from trunk.

gas/
* doc/as.texinfo: Update the MIPS FP ABI descriptions.
* doc/c-mips.texi: Spell check and correct throughout.

9 years agoMIPS/GAS: Correct file option settings with `.insn'
Maciej W. Rozycki [Tue, 21 Oct 2014 22:06:23 +0000 (23:06 +0100)]
MIPS/GAS: Correct file option settings with `.insn'

Import from trunk.

This makes sure `HAVE_CODE_COMPRESSION' evaluates correctly when the
`.insn' directive is used at the beginning of a source file before any
instructions have been produced and that ELF file header's MIPS16 and
microMIPS ASE flags are set correctly in the case where no instructions
have been produced other than with the said directive.

gas/
* config/tc-mips.c (s_insn): Set file options.

gas/testsuite/
* gas/mips/insn-opts.d: New test.
* gas/mips/insn-opts.s: New test source.
* gas/mips/mips.exp: Run the new test.

9 years agoFix bad @value references in MIPS documentation
Matthew Fortune [Fri, 17 Oct 2014 19:25:09 +0000 (20:25 +0100)]
Fix bad @value references in MIPS documentation

Import from trunk.

gas/

* doc/c-mips.texi: Fix bad @value references.

9 years agoShow information about unknown ASEs and extensions in .MIPS.abiflags
Matthew Fortune [Fri, 17 Oct 2014 10:07:17 +0000 (11:07 +0100)]
Show information about unknown ASEs and extensions in .MIPS.abiflags

Import from trunk.

bfd/
* elfxx-mips.c (print_mips_ases): Print unknown ASEs.
(print_mips_isa_ext): Print the value of an unknown extension.

binutils/

* readelf.c (print_mips_ases): Print unknown ASEs.
(print_mips_isa_ext): Print the value of an unknown extension.

include/

* elf/mips.h (AFL_ASE_MASK): Define.

9 years agoImport patches from the master branch which prevent seg-faults when parsing
Nick Clifton [Tue, 28 Oct 2014 10:50:17 +0000 (10:50 +0000)]
Import patches from the master branch which prevent seg-faults when parsing
corrupt binaries.

2014-10-28  Andreas Schwab  <schwab@suse.de>
    Nick Clifton  <nickc@redhat.com>
PR binutils/17510
* srec.c (srec_bad_byte): Increase size of buf to allow for
negative values.
(srec_scan): Use an unsigned char buffer to hold header bytes.

2014-10-27  Nick Clifton  <nickc@redhat.com>
PR binutils/17512
* elf.c (bfd_section_from_shdr): Detect and warn about ELF
binaries with a group of sections linked by the string table
indicies.
* peXXigen.c (_bfd_XXi_swap_aouthdr_in): Handle corrupt binaries
with an invalid value for NumberOfRvaAndSizes.
(pe_print_edata): Detect out of range rvas and entry counts for
the Export Address table, Name Pointer table and Ordinal table.

PR binutils/17510
* elf.c (setup_group): Improve handling of corrupt group
sections.

9 years agoRelax ppc64_elf_tls_optimize assertion
Alan Modra [Tue, 21 Oct 2014 10:14:38 +0000 (20:44 +1030)]
Relax ppc64_elf_tls_optimize assertion

The code in ppc64_elf_tls_optimize looking at the .toc is only
interested in .toc entries that are addresses.  .toc can contain more
than just an array of addresses, so if we have items that aren't
8-byte aligned, ignore them.

* elf64-ppc.c (ppc64_elf_tls_optimize): Ignore relocs against toc
entries that aren't a multiple of 8 rather than failing assertion.

9 years agoppc: enable msgclr and msgsnd on Power8
Jan Beulich [Tue, 21 Oct 2014 07:56:38 +0000 (09:56 +0200)]
ppc: enable msgclr and msgsnd on Power8

According to my reading of the spec it was an oversight for them to
not having got enabled when Power8 support got added.

9 years agoAdd gcc-4.9 libgomp symbols requiring --plt-thread-safe for power7
Alan Modra [Tue, 21 Oct 2014 06:36:01 +0000 (17:06 +1030)]
Add gcc-4.9 libgomp symbols requiring --plt-thread-safe for power7

powerpc64 ld builds plt call stubs with a read barrier to provide
thread safety on lazy plt updates, necessary on multi-threaded apps
with power7 or later weakly ordered memory.  gcc-4.9 libgomp
introduced more functions that could call pthread_create, which means
we have more functions that if referenced in an executable should
cause a default of --plt-thread-safe.

bfd/
* elf64-ppc.c (ppc64_elf_size_stubs): Add gcc-4.9 libgomp functions
to thread_starter.
gold/
* powerpc.cc (do_relax): Add gcc-4.9 libgomp functions to
thread_starter.

9 years agoPowerPC64 ELFv1 function symbol definition vs LTO and discarded sections
Alan Modra [Sat, 18 Oct 2014 11:16:48 +0000 (21:46 +1030)]
PowerPC64 ELFv1 function symbol definition vs LTO and discarded sections

When functions are emitted in comdat groups, global symbols defined in
duplicates of the group are treated as if they were undefined.  That
prevents the symbols in the discarded sections from affecting the
linker's global symbol hash table or causing duplicate symbol errors.
Annoyingly, when gcc emits a function to a comdat group, it does not
put *all* of a function's code and data in the comdat group.
Typically, constant tables, exception handling info, and debug info
are emitted to normal sections outside of the group, which is a
perennial source of linker problems due to the special handling needed
to deal with the extra-group pieces that ought to be discarded.  In
the case of powerpc64-gcc, the OPD entry for a function is not put in
the group.  Since the function symbol is defined on the OPD entry this
means we need to handle symbols in .opd specially.

To see how this affects LTO in particular, consider the linker
testcase PR ld/12942 (1).  This testcase links an LTO object file
pr12942a.o with a normal (non-LTO) object pr12942b.o.  Both objects
contain a definition for _Z4testv in a comdat group.  On loading
pr12942a.o, the linker sees a comdat group (actually linkonce section)
for _Z4testv and a weak _Z4testv defined in the IR.  On loading
pr12942b.o, the linker sees the same comdat group, and thus discards
it.  However, _Z4testv is a weak symbol defined in .opd, not part of
the group, so this weak symbol overrides the weak IR symbol.  On
(re)loading the LTO version of pr12942a.o, the linker sees another
weak _Z4testv, but this one does not override the value we have from
pr12942b.o.  The result is a linker complaint about "`_Z4testv'
... defined in discarded section `.group' of tmpdir/pr12942b.o".

* elf64-ppc.c (ppc64_elf_add_symbol_hook): If function code
section for function symbols defined in .opd is discarded, let
the symbol appear to be undefined.
(opd_entry_value): Ensure the result section is that for the
function code section in the same object as the OPD entry.

9 years agoFix PR17493, attempted output of *GAS `reg' section* symbol
Alan Modra [Sat, 18 Oct 2014 00:40:53 +0000 (11:10 +1030)]
Fix PR17493, attempted output of *GAS `reg' section* symbol

The write.c change is to make gas report an error if reg_section
symbols should leak in future.  The tc-i386.c change is the real fix.

Note that the error isn't the most helpful, "redefined symbol cannot
be used on reloc", but I'm not inclined to improve what is really an
internal gas error.  reg_section symbols shouldn't leak..

gas/
PR 17493
* write.c (adjust_reloc_syms): Don't allow symbols in reg_section
to be reduced to reg_section section symbol.
* gas/config/tc-i386.c (i386_finalize_immediate): Reject all
reg_section immediates.
gas/testsuite/
* gas/i386/inval-equ-2.l: Adjust.

9 years agoFix 17492, ld segfault with --oformat=binary
Alan Modra [Thu, 16 Oct 2014 10:46:07 +0000 (21:16 +1030)]
Fix 17492, ld segfault with --oformat=binary

PR 17492
* elf32-arm.c (elf32_arm_add_symbol_hook): Only set has_gnu_symbols
on ELF output bfd.
* elf32-i386.c (elf_i386_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.
* elf-s390-common.c (elf_s390_add_symbol_hook): Likewise.  Handle
STB_GNU_UNIQUE too.

9 years agoPR17488, powerpc64-linux-ld segfault
Alan Modra [Wed, 15 Oct 2014 23:08:09 +0000 (09:38 +1030)]
PR17488, powerpc64-linux-ld segfault

For binary ouput, we don't have an ELF bfd output so can't access
elf_elfheader.  The elf64-ppc.c changes are really just a tidy,
triggered by looking at all places where the abiversion bits are
accessed.

bfd/
* elf64-ppc.c (ppc64_elf_before_check_relocs): Do .opd processing
even when output is not ppc64 ELF.  Remove redundant tests on
type of input bfd.
ld/
PR 17488
* emultempl/ppc64elf.em (gld${EMULATION_NAME}_finish): Don't attempt
to access ELF header e_flags when not ppc64 ELF output.

9 years agoMerge bfd_find_nearest_line variants
Alan Modra [Wed, 15 Oct 2014 11:22:20 +0000 (21:52 +1030)]
Merge bfd_find_nearest_line variants

When bfd_find_nearest_line_discriminator was added, not enough care
was taken to ensure all targets had a proper definition of the function.
This patch cures that by merging bfd_find_nearest_line_discriminator
and bfd_find_nearest_line target implementations.

PR 17481
* aoutx.h (NAME (aout, find_nearest_line)): Add "discriminator_ptr"
param, group "section" and "offset" params.  Zero discriminator.
* bfd.c (bfd_find_nearest_line): Implement with new
_bfd_find_nearest_line.
(bfd_find_nearest_line_discriminator): Likewise.
* coff-i386.c (_bfd_generic_find_nearest_line_discriminator): Don't
define.
* coff-rs6000.c (xcoff_find_nearest_line,
xcoff_find_nearest_line_discriminator): Delete.
(_bfd_xcoff_find_nearest_line): Don't define.
(_bfd_xcoff_find_nearest_line): Define as coff_find_nearest_line.
* coff-x86_64.c (_bfd_generic_find_nearest_line_discriminator): Don't
define.
* coff64-rs6000.c (rs6000_xcoff64_vec, rs6000_xcoff64_aix_vec): Adjust.
* coffgen.c (coff_find_nearest_line_with_names): Reorder params,
adjust _bfd_dwarf2_find_nearest_line call.
(coff_find_nearest_line): Add "discriminator_ptr" param, reorder
others.  Set discriminator.  Adjust call.
(coff_find_nearest_line_discriminator): Delete.
* dwarf1.c (_bfd_dwarf1_find_nearest_line): Reorder params.
* dwarf2.c (find_line): Rename to..
(_bfd_dwarf2_find_nearest_line): ..this, reordering params.
Simplify setting of do_line.  Delete old function.
(_bfd_dwarf2_find_line): Delete.
* ecoff.c (_bfd_ecoff_find_nearest_line): Reorder params, add
discriminator_ptr and set it.
* elf-bfd.h (_bfd_elf_find_nearest_line): Update prototype.
(_bfd_elf_find_nearest_line_discriminator): Delete.
(_bfd_elf_find_line_discriminator): Delete.
(_bfd_generic_find_nearest_line_discriminator): Don't define.
* elf.c (elf_find_function): Reorder params.
(_bfd_elf_find_nearest_line): Reorder params, add discriminator_ptr.
Adjust calls.
(_bfd_elf_find_nearest_line_discriminator): Delete.
(_bfd_elf_find_line): Adjust call.
* elf32-arm.c (arm_elf_find_function): Reorder params.
(elf32_arm_find_nearest_line): Reorder params, add discriminator_ptr.
Adjust calls.
* elf64-alpha.c (elf64_alpha_find_nearest_line): Similarly.
* elfnn-aarch64.c (aarch64_elf_find_function): Reorder params.
(elfNN_aarch64_find_nearest_line): Reorder params, add
discriminator_ptr.  Adjust calls.
* elfxx-mips.c (_bfd_mips_elf_find_nearest_line): Similarly.
* elfxx-mips.h (_bfd_mips_elf_find_nearest_line): Update prototype.
* libaout.h (NAME (aout, find_nearest_line)): Update prototype.
* libbfd-in.h (_bfd_nosymbols_find_nearest_line): Update.
(_bfd_dwarf1_find_nearest_line): Likewise.
(_bfd_dwarf2_find_nearest_line): Likewise.
(_bfd_dwarf2_find_line): Delete.
(_bfd_generic_find_nearest_line_discriminator): Delete.
* libbfd.c (_bfd_generic_find_nearest_line_discriminator): Delete.
* libcoff-in.h (coff_find_nearest_line): Update prototype.
(coff_find_nearest_line_discriminator): Delete.
(coff_find_nearest_line_with_names): Update prototype.
* libecoff.h (_bfd_ecoff_find_nearest_line): Update prototype.
* mach-o.c (bfd_mach_o_find_nearest_line): Reorder params, add
discriminator_ptr.  Adjust calls.
* mach-o.h (bfd_mach_o_find_nearest_line): Update prototype.
* pdp11.c (NAME (aout, find_nearest_line)): Reorder params, add
discriminator_ptr and set.
* som.c (som_find_nearest_line): Similarly.
* targets.c (BFD_JUMP_TABLE_SYMBOLS): Delete entry for
_bfd_find_nearest_line_discriminator.
(struct bfd_target <_bfd_find_nearest_line>): Adjust prototype.
(struct bfd_target <_bfd_find_nearest_line_discriminator>): Delete.
* vms-alpha.c (_bfd_vms_find_nearest_dst_line): Rename to..
(_bfd_vms_find_nearest_line): ..this.  Reorder params, add
"discriminator" and set.
(_bfd_vms_find_nearest_line_discriminator): Delete.
(_bfd_generic_find_nearest_line_discriminator): Don't define.
(alpha_vms_find_nearest_line): Update define.
* bfd-in2.h: Regenerate.
* libbfd.h: Regenerate.
* libcoff.h: Regenerate.

9 years agoDefine bfd_find_line entry of BFD_JUMP_TABLE_SYMBOLS using NAME
Alan Modra [Wed, 15 Oct 2014 05:10:45 +0000 (15:40 +1030)]
Define bfd_find_line entry of BFD_JUMP_TABLE_SYMBOLS using NAME

In https://www.sourceware.org/ml/binutils/2005-06/msg00082.html
HJ implemented bfd_find_line for DWARF2, but cheated a little in not
using the usual NAME##_find_line, saving quite a lot of boring
editing.  However that shortcut probably contributed to
bfd_find_nearest_line_discriminator being implemented the same way,
and missing support for some targets.

* targets.c (BFD_JUMP_TABLE_SYMBOLS): Use NAME##_find_line.
* aout-adobe.c (aout_32_find_line): Define.
(aout_32_bfd_make_debug_symbol, aout_32_bfd_reloc_type_lookup,
aout_32_bfd_reloc_name_lookup): Define using _bfd_nosymbols define.
* aout-target.h (MY_find_line): Define.
* aout-tic30.c (MY_find_line): Define.
* binary.c (binary_find_line): Define.
* bout.c (aout_32_find_line): Define.
* coff-rs6000.c (_bfd_xcoff_find_line): Define.
* coff64-rs6000.c (rs6000_xcoff64_vec): Use coff_find_line.
(rs6000_xcoff64_aix_vec): Likewise.
* elf-bfd.h (_bfd_generic_find_line): Don't define.
* elfxx-target.h (bfd_elfNN_find_line): Define.
* i386msdos.c (msdos_find_line): Define.
* i386os9k.c (aout_32_find_line): Define.
* ieee.c (ieee_find_nearest_line, ieee_find_inliner_info): Delete func.
(ieee_find_nearest_line, ieee_find_line,
ieee_find_inliner_info): Define.
* ihex.c (ihex_find_line): Define.
* libbfd-in.h (_bfd_nosymbols_find_line): Define.
(_bfd_generic_find_line): Don't define.
* libbfd.c (_bfd_generic_find_line): Delete.
* libcoff-in.h (coff_find_line): Define.
* libecoff.h (_bfd_ecoff_find_line): Define.
* mach-o.h (bfd_mach_o_find_line): Define.
* mmo.c (mmo_find_line): Define.
* nlm-target.h (nlm_find_line): Define.
* oasys.c (oasys_find_nearest_line, oasys_find_inliner_info): Delete.
(oasys_find_nearest_line, oasys_find_line,
oasys_find_inliner_info): Define.
* pef.c (bfd_pef_find_line): Define.
* plugin.c (bfd_plugin_find_line): Define.
* ppcboot.c (ppcboot_find_line): Define.
* som.c (som_find_line): Define.
* srec.c (srec_find_line): Define.
* tekhex.c (tekhex_find_line): Define.
* versados.c (versados_find_line): Define.
* vms-alpha.c (alpha_vms_find_line): Define.
* xsym.c (bfd_sym_find_line): Define.
* bfd-in2.h: Regenerate.
* libbfd.h: Regenerate.
* libcoff.h: Regenerate.

9 years agoChangeLog typo fix
Alan Modra [Tue, 14 Oct 2014 23:21:53 +0000 (09:51 +1030)]
ChangeLog typo fix

9 years agoFix memory overflow issue about strncat
Chen Gang [Tue, 14 Oct 2014 23:18:47 +0000 (09:48 +1030)]
Fix memory overflow issue about strncat

If src contains n or more bytes, strncat() writes n+1 bytes to dest
(n from src plus the terminating null byte).   Therefore, the size of
dest must be at least strlen(dest)+n+1.

* config/tc-tic4x.c (md_assemble): Correct strncat size.

9 years agodaily update
Alan Modra [Mon, 27 Oct 2014 23:00:13 +0000 (09:30 +1030)]
daily update

9 years agodaily update
Alan Modra [Sun, 26 Oct 2014 23:00:12 +0000 (09:30 +1030)]
daily update

9 years agodaily update
Alan Modra [Sat, 25 Oct 2014 23:00:11 +0000 (09:30 +1030)]
daily update

9 years agodaily update
Alan Modra [Fri, 24 Oct 2014 23:00:35 +0000 (09:30 +1030)]
daily update

9 years ago[AArch64] Cortex-A53 erratum 835769 linker workaround
Jiong Wang [Fri, 24 Oct 2014 11:23:40 +0000 (12:23 +0100)]
[AArch64] Cortex-A53 erratum 835769 linker workaround

2014-10-24  Tejas Belagod  <tejas.belagod@arm.com>

    bfd/
     * bfd-in.h (bfd_elf64_aarch64_set_options): Add a parameter.
     * bfd-in2.h (bfd_elf64_aarch64_set_options): Likewise.
     * elfnn-aarch64.c (aarch64_erratum_835769_stub): New.
     (elf_aarch64_stub_type): Add new type
     aarch64_stub_erratum_835769_veneer.
     (elf_aarch64_stub_hash_entry): New fields for erratum 835769.
     (aarch64_erratum_835769_fix): New data struct to record erratum
     835769.
     (elf_aarch64_link_hash_table: Global flags for 835769.
     (aarch64_build_one_stub): Add case for 835769.
     (aarch64_size_one_stub): Likewise.
     (aarch64_mem_op_p, aarch64_mlxl_p,
     aarch64_erratum_sequence,erratum_835769_scan):
     New. Decode and scan functions for erratum 835769.
     (elf_aarch64_create_or_find_stub_sec): New.
     (elfNN_aarch64_size_stubs): Look for erratum 835769 and record
     them.
     (bfd_elfNN_aarch64_set_options: Set global flag for 835769.
     (erratum_835769_branch_to_stub_data,
     make_branch_to_erratum_835769_stub):New. Connect up all the
     erratum stubs to occurances by branches.
     (elfNN_aarch64_write_section): New hook.
     (aarch64_map_one_stub): Output erratum stub symbol.
     (elfNN_aarch64_size_dynamic_sections): Init mapping symbol
     information for erratum 835769.
     (elf_backend_write_section): Define.

    ld/
     * emultempl/aarch64elf.em: Add command-line option for erratum
     835769.

    ld/testsuite/
     * ld-aarch64/aarch64-elf.exp (aarch64elftests): Drive erratum
     835769 tests.
     * ld-aarch64/erratum835769.d: New.
     * ld-aarch64/erratum835769.s: New.

9 years agodaily update
Alan Modra [Thu, 23 Oct 2014 23:00:26 +0000 (09:30 +1030)]
daily update

9 years agodaily update
Alan Modra [Wed, 22 Oct 2014 23:00:28 +0000 (09:30 +1030)]
daily update

9 years agodaily update
Alan Modra [Tue, 21 Oct 2014 23:00:12 +0000 (09:30 +1030)]
daily update

9 years agodaily update
Alan Modra [Mon, 20 Oct 2014 23:00:28 +0000 (09:30 +1030)]
daily update

9 years agodaily update
Alan Modra [Sun, 19 Oct 2014 23:00:15 +0000 (09:30 +1030)]
daily update

9 years agodaily update
Alan Modra [Sat, 18 Oct 2014 23:00:25 +0000 (09:30 +1030)]
daily update

9 years agodaily update
Alan Modra [Fri, 17 Oct 2014 23:00:13 +0000 (09:30 +1030)]
daily update

9 years agoBackport "Fix sysroot-tests, adding --print-sysroot" from master
Hans-Peter Nilsson [Fri, 17 Oct 2014 11:26:56 +0000 (13:26 +0200)]
Backport "Fix sysroot-tests, adding --print-sysroot" from master

9 years agoRegenerate configure (after change of version)
Tristan Gingold [Wed, 15 Oct 2014 08:15:29 +0000 (10:15 +0200)]
Regenerate configure (after change of version)

binutils/
2014-10-15  Tristan Gingold  <gingold@adacore.com>

* configure: Regenerate.

gas/
2014-10-15  Tristan Gingold  <gingold@adacore.com>

* configure: Regenerate.

ld/
2014-10-15  Tristan Gingold  <gingold@adacore.com>

* configure: Regenerate.

opcodes/
2014-10-15  Tristan Gingold  <gingold@adacore.com>

* configure: Regenerate.

9 years agosrc-release.sh: configure using --target.
Tristan Gingold [Wed, 15 Oct 2014 07:48:50 +0000 (09:48 +0200)]
src-release.sh: configure using --target.

        * src-release.sh (do_proto_toplev): Configure with --target.

9 years agoBackport "="-ldscript-path-prefix changes from master.
Hans-Peter Nilsson [Wed, 15 Oct 2014 01:54:43 +0000 (03:54 +0200)]
Backport "="-ldscript-path-prefix changes from 

9 years agogprof: Regenerate configure
Andreas Schwab [Tue, 14 Oct 2014 18:23:24 +0000 (20:23 +0200)]
gprof: Regenerate configure

* configure: Regenerate.

9 years agobfd: bump version on the 2_25 branch
Tristan Gingold [Tue, 14 Oct 2014 08:18:23 +0000 (10:18 +0200)]
bfd: bump version on the 2_25 branch

bfd/
2014-10-14  Tristan Gingold  <gingold@adacore.com>

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

9 years agoAdd NEWS markers for 2.25.
Tristan Gingold [Tue, 14 Oct 2014 07:49:47 +0000 (09:49 +0200)]
Add NEWS markers for 2.25.

binutils/
2014-10-14  Tristan Gingold  <gingold@adacore.com>

* NEWS: Add marker for 2.25.

gas/
2014-10-14  Tristan Gingold  <gingold@adacore.com>

* NEWS: Add marker for 2.25.

ld/
2014-10-14  Tristan Gingold  <gingold@adacore.com>

* NEWS: Add marker for 2.25.

9 years agoAvoid undefined behaviour with signed expressions
Alan Modra [Tue, 14 Oct 2014 03:06:20 +0000 (13:36 +1030)]
Avoid undefined behaviour with signed expressions

PR 17453
bfd/
* libbfd.c (COERCE16, COERCE32, COERCE64): Use unsigned types.
(EIGHT_GAZILLION): Delete.
binutils/
* dwarf.c (read_leb128): Avoid signed overflow.
(read_debug_line_header): Likewise.
gas/
* config/tc-i386.c (fits_in_signed_long): Use unsigned param and
expression to avoid signed overflow.
(fits_in_signed_byte, fits_in_unsigned_byte, fits_in_unsigned_word,
fits_in_signed_word, fits_in_unsigned_long): Similarly.
* expr.c (operand <'-'>): Avoid signed overflow.
* read.c (s_comm_internal): Likewise.

9 years agoCorrect fscanf char field count
Alan Modra [Tue, 14 Oct 2014 03:00:57 +0000 (13:30 +1030)]
Correct fscanf char field count

%<number>s as an fscanf format does not include the trailing NULL.
PATH_MAX does include the trailing NULL.

PR 17453
* readelf.c (process_program_headers): Correct fscanf format used
for interpreter.

9 years agosparc-aout and sparc-coff breakage
Alan Modra [Mon, 13 Oct 2014 12:27:58 +0000 (22:57 +1030)]
sparc-aout and sparc-coff breakage

* config/tc-sparc.c (sparc_md_end): Fix unused variable warnings.

9 years agodaily update
Alan Modra [Mon, 13 Oct 2014 23:01:01 +0000 (09:31 +1030)]
daily update

9 years agoChange name of file name test in py-objfile.exp.
Doug Evans [Mon, 13 Oct 2014 21:50:32 +0000 (14:50 -0700)]
Change name of file name test in py-objfile.exp.

Tests should each have their own name.

gdb/testsuite/ChangeLog:

* gdb.python/py-objfile.exp: Change name of file name test.

9 years agoFix dw2-op-out-param.S CU offset values.
Doug Evans [Mon, 13 Oct 2014 21:05:34 +0000 (14:05 -0700)]
Fix dw2-op-out-param.S CU offset values.

This test will pass if the CU is the first CU in the binary.
If libc debugging info is installed it may not be, in which case
the CU offset values are wrong.

gdb/testsuite/ChangeLog:

* gdb.dwarf2/dw2-op-out-param.S: Make DW_FORM_ref4 values be the offset
from the start of the CU.

9 years agofix file paths in previous commit
Doug Evans [Mon, 13 Oct 2014 20:33:09 +0000 (13:33 -0700)]
fix file paths in previous commit

9 years agoRemove some code duplication in py-objfile.c, py-progspace.c.
Doug Evans [Mon, 13 Oct 2014 19:24:54 +0000 (12:24 -0700)]
Remove some code duplication in py-objfile.c, py-progspace.c.

gdb/ChangeLog:

* py-objfile.c (objfpy_initialize): New function.
(objfpy_new, objfile_to_objfile_object): Call it.
* py-progspace.c (pspy_initialize): New function.
(pspy_new, pspace_to_pspace_object): Call it.

9 years agoRun eh_frame optimisation for relocatable link
Alan Modra [Mon, 13 Oct 2014 04:48:21 +0000 (15:18 +1030)]
Run eh_frame optimisation for relocatable link

The idea here is to drop .eh_frame FDEs corresponding to dropped
comdat group sections or linkonce sections, but not perform changes in
encoding.

bfd/
PR 17467
* elf-eh-frame.c (ENSURE_NO_RELOCS): Don't stop at first NONE reloc.
(_bfd_elf_parse_eh_frame): When relocatable output, don't set
flags enabling conversion of CIEs and FDEs to use relative encoding.
(find_merged_cie): Similarly.
(_bfd_elf_write_section_eh_frame): Don't edit FDEs when
relocatable, except for CIE pointer.
* elflink.c (bfd_elf_reloc_symbol_deleted_p): Return true for
relocs against symbols in dropped comdat group sections.
(bfd_elf_discard_info): Do some eh_frame optimisation when
relocatable.
ld/
* ldlang.c (lang_add_section): Set up map_head.s and map_tail.s when
relocatable.

9 years agoFix "save breakpoints" for "catch" command
Jan Kratochvil [Mon, 13 Oct 2014 11:39:48 +0000 (13:39 +0200)]
Fix "save breakpoints" for "catch" command

gdb/ChangeLog
2014-10-13  Miroslav Franc  <mfranc@redhat.com>
    Jan Kratochvil  <jan.kratochvil@redhat.com>

Fix "save breakpoints" for "catch" command.
* break-catch-sig.c (signal_catchpoint_print_recreate): Add trailing
newline.

gdb/testsuite/ChangeLog
2014-10-13  Jan Kratochvil  <jan.kratochvil@redhat.com>
    Yao Qi  <yao@codesourcery.com>

Fix "save breakpoints" for "catch" command.
* gdb.base/catch-signal.exp: Add gdb_breakpoint "main".
Remove -nonewline.  Match also the added "main" line.

9 years agodaily update
Alan Modra [Sun, 12 Oct 2014 23:00:41 +0000 (09:30 +1030)]
daily update

9 years agoFix "save breakpoints" for "disable $bpnum" command.
Jan Kratochvil [Sun, 12 Oct 2014 19:52:39 +0000 (21:52 +0200)]
Fix "save breakpoints" for "disable $bpnum" command.

gdb/ChangeLog
2014-10-12  Miroslav Franc  <mfranc@redhat.com>

Fix "save breakpoints" for "disable $bpnum" command.
* breakpoint.c (save_breakpoints): Add $bpnum for disable.

gdb/testsuite/ChangeLog
2014-10-12  Jan Kratochvil  <jan.kratochvil@redhat.com>

Fix "save breakpoints" for "disable $bpnum" command.
* gdb.base/save-bp.c (main): Add label.
* gdb.base/save-bp.exp: Add 8th disabled breakpoint.  Match it.

9 years agoUse gdb_test_sequence in gdb.base/save-bp.exp.
Jan Kratochvil [Sun, 12 Oct 2014 19:47:13 +0000 (21:47 +0200)]
Use gdb_test_sequence in gdb.base/save-bp.exp.

But IMO it is a functionality regression as:

 * gdb_test_sequence permits arbitary number of lines of text between those
   lines being matched.  Former regex string did not allow it.
   This may make a difference if GDB regresses by printing some unexpected
   line after the breakpoint info line (like a "silent" line).

>  * \[\r\n\]+ can be used to anchor the beginning of the pattern, in the sense
>    of Perl regex ^ /m match.  At least I have found such cases in existing
>    *.exp files so I used that.  Using ^ really does not work.
>
>    But I am not aware how to do Perl regex $ /m match.  Using $ really does
>    not work.  But this means that for example the trailing
>      ( \\((host|target) evals\\))?
>    on the line
>      "\[\r\n\]+\[ \t\]+stop only if i == 1( \\((host|target) evals\\))?"
>    originally made sense there but now it can be removed as it has no longer
>    any functionality there - it will match now any trailing line garbage.

by Yao Qi:

In this test case, ( \\((host|target) evals\\))? isn't needed in the
pattern.  What we test here is to save breakpoints into file and restore
them from file.  The contents saved in file are:

break save-bp.c:31
  condition $bpnum i == 1

the information about the place where the condition is evaluated isn't
saved, so we don't need to check.  Breakpoint save and restore has
nothing to do with where the condition is evaluated (host or target).  I
am fine to leave it here now.

gdb/testsuite/ChangeLog
2014-10-09  Jan Kratochvil  <jan.kratochvil@redhat.com>

* gdb.base/save-bp.exp (info break): Use gdb_test_sequence.

9 years agodaily update
Alan Modra [Sat, 11 Oct 2014 23:00:42 +0000 (09:30 +1030)]
daily update

9 years agoSync libiberty with upstream GCC.
Iain Buclaw [Sat, 11 Oct 2014 09:29:10 +0000 (10:29 +0100)]
Sync libiberty with upstream GCC.

include/ChangeLog
* libiberty.h (PEX_STDOUT_APPEND): New flag.
(PEX_STDERR_APPEND): Likewise.

* demangle.h (DMGL_DLANG): New macro.
(DMGL_STYLE_MASK): Add DMGL_DLANG.
(demangling_styles): Add dlang_demangling.
(DLANG_DEMANGLING_STYLE_STRING): New macro.
(DLANG_DEMANGLING): New macro.
(dlang_demangle): New prototype.

* longlong.h: Add __udiv_w_sdiv prototype.

libiberty/ChangeLog
* cp-demangle.c (d_substitution): Handle abi tags on abbreviation.

* pex-common.h (struct pex_funcs): Add new parameter for open_write field.
* pex-unix.c (pex_unix_open_write): Add support for new parameter.
* pex-djgpp.c (pex_djgpp_open_write): Likewise.
* pex-win32.c (pex_win32_open_write): Likewise.
* pex-common.c (pex_run_in_environment): Likewise.

* Makefile.in (CFILES): Add d-demangle.c.
(REQUIRED_OFILES): Add d-demangle.o.
* cplus-dem.c (libiberty_demanglers): Add dlang_demangling case.
(cplus_demangle): Likewise.
* d-demangle.c: New file.
* testsuite/Makefile.in (really-check): Add check-d-demangle.
* testsuite/d-demangle-expected: New file.

* simple-object-elf.c (simple_object_elf_write_ehdr): Correctly
handle objects with more than SHN_LORESERVE sections.
(simple_object_elf_write_shdr): Add sh_link parameter.
(simple_object_elf_write_to_file): Correctly handle objects with
more than SHN_LORESERVE sections.

* cp-demangle.c (d_dump): Only access field from s_fixed part of
the union for DEMANGLE_COMPONENT_FIXED_TYPE.
(d_count_templates_scopes): Likewise.

* testsuite/demangler-fuzzer.c: New file.
* testsuite/Makefile.in (fuzz-demangler): New rule.
(demangler-fuzzer): Likewise.
(mostlyclean): Clean up demangler fuzzer.

9 years agoEnable qTStatus packet in case it is disabled
Yao Qi [Wed, 8 Oct 2014 03:25:31 +0000 (11:25 +0800)]
Enable qTStatus packet in case it is disabled

Nowadays, we are using command "tstatus" to send a packet to GDBserver
in order to check the connection.  However, on the target doesn't
support tracepoint, the following error is emitted before sending any
packet to GDBserver.

tstatus^M
Trace can not be run on this target.^M
(gdb) FAIL: gdb.server/server-kill.exp: tstatus

qTStatus is disabled after receiving the empty reply during connecting
to the remote target.  When the test executes command "tstatus" again,
remote_get_trace_status returns -1 at the very beginning, and no RSP
packet is sent out.

This patch is to enable qTStatus packet again.

gdb/testsuite:

2014-10-11  Yao Qi  <yao@codesourcery.com>

* gdb.server/server-kill.exp: Execute command
"set remote trace-status-packet on" before "tstatus".

9 years agoGet GDBserver pid on remote target
Yao Qi [Tue, 30 Sep 2014 13:08:15 +0000 (21:08 +0800)]
Get GDBserver pid on remote target

Hi,
We see the following fail in the real remote testing...

(gdb) Executing on target: kill -9 29808    (timeout = 300)
spawn [open ...]^M
sh: 1: kill: No such process

The test tries to kill gdbserver in this way:

set server_pid [exp_pid -i [board_info target fileid]]
remote_exec target "kill -9 $server_pid"

in native testing, we'll get the pid of spawned gdbserver, however, in
remote testing, we'll get the pid of ssh session, since we start
gdbserver on the remote target through ssh.  The pid on build doesn't
exist on target.

In this patch, we tweak server-kill.c to get the parent pid, which is
the pid of GDBserver.  GDB gets it and kill GDBserver on target.

gdb/testsuite:

2014-10-11  Yao Qi  <yao@codesourcery.com>

* gdb.server/server-kill.c: Include sys/types.h and unistd.h.
(main): Call getppid.
* gdb.server/server-kill.exp: Set breakpoint on line "i = 0;"
and continue to it.  Read variable "server_pid".

9 years agoClean up server-kill.exp
Yao Qi [Wed, 8 Oct 2014 02:04:22 +0000 (10:04 +0800)]
Clean up server-kill.exp

This patch is to remove some lines which looks unnecessary.  These
lines were added when server-kill.exp was added.  In the version 1,
https://sourceware.org/ml/gdb-patches/2013-03/msg00691.html the test
calls runto_main and delete breakpoint on main,

+if ![runto_main] {
+    return -1
+}
+
+# Otherwise the breakpoint at 'main' would not cause insert
breakpoints during
+# first step.
+delete_breakpoints

However, in the version 2
https://sourceware.org/ml/gdb-patches/2013-03/msg00854.html runto_main
is removed but delete_breakpoints is still there.  AFAICS, the line of
delete_breakpoints can be removed too.

gdb/testsuite:

2014-10-11  Yao Qi  <yao@codesourcery.com>

* gdb.server/server-kill.exp: Remove "delete_breakpoints".

9 years agoNo longer pull thread list explicitly
Yao Qi [Wed, 8 Oct 2014 14:26:27 +0000 (22:26 +0800)]
No longer pull thread list explicitly

As the result of the patch below, GDB updates thread list when a stop is
presented to user.  The tests don't have to fetch thread list explicitly.

  [PATCH 3/3] Fix non-stop regressions caused by "breakpoints always-inserted off" changes
  https://sourceware.org/ml/gdb-patches/2014-09/msg00734.html

This patch is to remove the test code updating thread list.

Run these three tests many times on arm-linux-gnueabi and x86-linux.
No regressions.

gdb/testsuite:

2014-10-11  Yao Qi  <yao@codesourcery.com>

* gdb.threads/thread-find.exp: Don't execute command
"info threads".
* gdb.threads/attach-into-signal.exp (corefunc): Likewise.
* gdb.threads/linux-dp.exp: Don't check the condition
$threads_created equals to zero.

9 years agodaily update
Alan Modra [Fri, 10 Oct 2014 23:00:49 +0000 (09:30 +1030)]
daily update

9 years agoDelete IRIX support
Pedro Alves [Fri, 10 Oct 2014 17:18:52 +0000 (18:18 +0100)]
Delete IRIX support

This does most of the mechanical removal.  IOW, the easy part.

This doesn't touch procfs.c as that'd be a harder excision,
potentially affecting Solaris.

mips-tdep.c is left alone.  E.g., I didn't delete the GDB_OSABI_IRIX
enum value, nor references to it in mips-tdep.c.  Some comments
mentioning IRIX ABIs may still be relevant and I wouldn't know what to
do with them. in That can always be done on a separate pass,
preferably by someone who can test on MIPS.

I didn't remove a reference to IRIX in testsuite/lib/future.exp, as I
believe that code is imported from DejaGNU.

Built and tested on x86_64 Fedora 20, with --enable-targets=all.

Tested that building for --target=mips-sgi-irix6 on x86_64 Fedora 20
fails with:

 checking for default auto-load directory... $debugdir:$datadir/auto-load
 checking for default auto-load safe-path... $debugdir:$datadir/auto-load
 *** Configuration mips-sgi-irix6 is obsolete.
 *** Support has been REMOVED.
 make[1]: *** [configure-gdb] Error 1
 make[1]: Leaving directory `/home/pedro/gdb/mygit/build-irix'
 make: *** [all] Error 2

gdb/
2014-10-10  Pedro Alves  <palves@redhat.com>

* Makefile.in (ALL_TARGET_OBS): Remove mips-irix-tdep.o and solib-irix.o.
(ALLDEPFILES): Remove mips-irix-tdep.c and solib-irix.c.
(HFILES_NO_SRCDIR): Remove solib-irix.h.
* NEWS: Mention that support for mips-sgi-irix5* mips-sgi-irix6*
and been removed.
* config/mips/irix5.mh, config/mips/irix6.mh: Delete files.
* configure.ac: Remove references to IRIX.
* configure.host: Add *-*-irix* to the obsolete hosts section.
Remove all other references to irix.
* irix5-nat.c, mips-irix-tdep.c, solib-irix.c, solib-irix.h:
Delete files.

gdb/testsuite/
2014-10-10  Pedro Alves  <palves@redhat.com>

* gdb.base/bigcore.exp: Remove references to IRIX.
* gdb.base/funcargs.exp: Likewise.
* gdb.base/interrupt.exp: Likewise.
* gdb.base/mips_pro.exp: Likewise.
* gdb.base/nodebug.exp: Likewise.
* gdb.base/setvar.exp: Likewise.
* lib/gdb.exp (gdb_compile_shlib): Remove mips-sgi-irix* case.

9 years agoMicroblaze: Reject invalid target descriptions
Ajit Kumar Agarwal [Fri, 10 Oct 2014 17:07:06 +0000 (18:07 +0100)]
Microblaze: Reject invalid target descriptions

We currently validate the target description, but then forget to
reject it if found invalid.

Tested that incorrect descriptions are rejected and GDB warns about
them.

Tested the Microblaze Design with and without stack-protect registers.
The gdb command "info registers" displayed the register correctly.  If
a stack protect design is not selected, only core registers are
displayed.  When the stack-protect registers are selected in the
design, the core registers along with stack-protect registers are
displayed.

gdb/
2014-10-10  Ajit Agarwal  <ajitkum@xilinx.com>

* microblaze-tdep.c (microblaze_gdbarch_init): If the description
isn't valid, release the tdesc arch data and return NULL.

9 years agoCache the vsyscall/vDSO range per-inferior
Pedro Alves [Fri, 10 Oct 2014 14:57:14 +0000 (15:57 +0100)]
Cache the vsyscall/vDSO range per-inferior

We're now doing a vsyscall/vDSO address range lookup whenever we fetch
shared libraries, either through an explicit "info shared", or when
the target reports new libraries have been loaded, in order to filter
out the vDSO from glibc's DSO list.  Before we started doing that, GDB
would only ever lookup the vsyscall's address range once in the
process's lifetime.

Looking up the vDSO address range requires an auxv lookup (which is
already cached, so no problem), but also reading the process's
mappings from /proc to find out the vDSO's mapping's size.  That
generates extra RSP traffic when remote debugging.  Particularly
annoying when the process's mappings grow linearly as more libraries
are mapped in, and we went through the trouble of making incremental
DSO list updates work against gdbserver (when the probes-based dynamic
linker interface is available).

The vsyscall/vDSO is mapped by the kernel when the process is
initially mapped in, and doesn't change throughout the process's
lifetime, so we can cache its address range.

Caching at this level brings GDB back to one and only one vsyscall
address range lookup per process.

Tested on x86_64 Fedora 20.

gdb/
2014-10-10  Pedro Alves  <palves@redhat.com>

* linux-tdep.c: Include observer.h.
(linux_inferior_data): New global.
(struct linux_info): New structure.
(invalidate_linux_cache_inf, linux_inferior_data_cleanup)
(get_linux_inferior_data): New functions.
(linux_vsyscall_range): Rename to ...
(linux_vsyscall_range_raw): ... this.
(linux_vsyscall_range): New function; handles caching.
(_initialize_linux_tdep): Register linux_inferior_data.  Install
inferior_exit and inferior_appeared observers.

9 years agoPR symtab/14466: Work around PR libc/13097 "linux-vdso.so.1"
Pedro Alves [Fri, 10 Oct 2014 14:57:13 +0000 (15:57 +0100)]
PR symtab/14466: Work around PR libc/13097 "linux-vdso.so.1"

With upstream glibc, GDB prints:

  warning: Could not load shared library symbols for linux-vdso.so.1.
  Do you need "set solib-search-path" or "set sysroot"?

A bug's been filed for glibc a few years back:

  http://sourceware.org/bugzilla/show_bug.cgi?id=13097

but it's still not resolved.  It's not clear whether there's even
consensus that this is indeed a glibc bug.  It would actually be nice
if GDB also listed the vDSO in the shared library list, but there are
some design considerations with that:

 - the vDSO is mapped by the kernel, not userspace, therefore we
   should load its symbols right from the process's start of life,
   even before glibc / the userspace loader sets up the initial DSO
   list.  The program might even be using a custom loader or no
   loader.

 - that kind of hints at that solib.c should handle retrieving shared
   library lists from more than one source, and that symfile-mem.c's
   loading of the vDSO would be converted to load and relocate the
   vDSO's bfd behind the target_so_ops interface.

 - and then, once glibc links in the vDSO to its DSO list, we'd need
   to either:

    a) somehow hand over the vDSO from one target_so_ops to the other

    b) simply keep hiding glibc's entry.

And then b) seems the simplest.

With that in mind, this patch simply discards the vDSO from glibc's
reported shared library list.

We can match the vDSO address range with the addresses found iterating
the dynamic linker list, to tell which dynamic linker entry is the
vDSO.

Tested on x86_64 Fedora 20.

gdb/
2014-10-10  Jan Kratochvil  <jan.kratochvil@redhat.com>
    Pedro Alves  <palves@redhat.com>

PR symtab/14466
* solib-svr4.c (svr4_read_so_list): Rename to ...
(svr4_current_sos_1): ... this and change the function comment.
(svr4_current_sos): New function.

gdb/testsuite/
2014-10-10  Jan Kratochvil  <jan.kratochvil@redhat.com>
    Pedro Alves  <palves@redhat.com>

PR symtab/14466
* gdb.base/vdso-warning.c: New file.
* gdb.base/vdso-warning.exp: New file.

9 years agoSplit vDSO range lookup to a gdbarch hook
Pedro Alves [Fri, 10 Oct 2014 14:57:13 +0000 (15:57 +0100)]
Split vDSO range lookup to a gdbarch hook

We have a case in solib-svr4.c where we could reuse symfile-mem.c's
vDSO range lookup.  Since symfile-mem.c is not present in all
configurations solib-svr4.c is, move that lookup to a gdbarch hook.

This has the minor (good) side effect that we stop even trying the
target_auxv_search lookup against targets that don't have a concept of
a vDSO, in case symfile-mem.c happens to be linked in the build
(--enable-targets=all).

Tested on x86_64 Fedora 20.

gdb/
2014-10-10  Pedro Alves  <palves@redhat.com>

* arch-utils.c (default_vsyscall_range): New function.
* arch-utils.h (default_vsyscall_range): New declaration.
* gdbarch.sh (vsyscall_range): New hook.
* gdbarch.h, gdbarch.c: Regenerate.
* linux-tdep.c (linux_vsyscall_range): New function.
(linux_init_abi): Install linux_vsyscall_range as
vsyscall_range gdbarch hook.
* memrange.c (address_in_mem_range): New function.
* memrange.h (address_in_mem_range): New declaration.
* symfile-mem.c (find_vdso_size): Delete function.
(add_vsyscall_page): Use gdbarch_vsyscall_range.

9 years agoinfrun.c:normal_stop: Fix typo in comment
Pedro Alves [Fri, 10 Oct 2014 12:50:05 +0000 (13:50 +0100)]
infrun.c:normal_stop: Fix typo in comment

gdb/
2014-10-10  Pedro Alves  <palves@redhat.com>

* infrun.c (normal_stop): Fix typo in comment.

9 years agodaily update
Alan Modra [Thu, 9 Oct 2014 23:00:36 +0000 (09:30 +1030)]
daily update

9 years agoPR tdep/9390: Fix typo on xstorxstormy16-tdep.c
Sergio Durigan Junior [Thu, 9 Oct 2014 17:45:09 +0000 (13:45 -0400)]
PR tdep/9390: Fix typo on xstorxstormy16-tdep.c

This patch fixes the bug described in PR tdep/9390, which is about a
wrong check in the following code:

    ...

    /* optional copying of args in r2-r7 to r10-r13.  */
    /* Probably only in optimized case but legal action for prologue.  */
    else if ((inst & 0xff00) == 0x4600 /* 46SD   mov rD, rS */
     && (inst & 0x00f0) >= 0x0020 && (inst & 0x00f0) <= 0x0070
     && (inst & 0x000f) >= 0x00a0 && (inst & 0x000f) <= 0x000d)
                ^^^^^^^^^^^^^^^^^^^^^^^^^
    ...

This condition will never trigger, and the fix proposed in the bug
(which made sense to me) was to test against 0x000a.  I tried finding
documentation about this target, but couldn't find anything.  I don't
even know if it is still used, but decided to submit the fix anyway.

Tested on my x86_64 Fedora 20 GNU/Linux.

gdb/ChangeLog:
2014-09-16  Sergio Durigan Junior  <sergiodj@redhat.com>

PR tdep/9390
* xstorxstormy16-tdep.c (xstormy16_analyze_prologue): Fix possible
typo when using logical AND to determine instruction type.

9 years agoThis is a series of patches that add support for the SPARC M7 cpu to
Jose E. Marchesi [Thu, 9 Oct 2014 12:16:53 +0000 (13:16 +0100)]
This is a series of patches that add support for the SPARC M7 cpu to
binutils.  They were discussed and approved here:

  https://sourceware.org/ml/binutils/2014-10/msg00038.html

9 years agoRemove unused local variable
Yao Qi [Wed, 8 Oct 2014 11:25:59 +0000 (19:25 +0800)]
Remove unused local variable

As a result of commit b57bacec, local variable 'printed' is no longer
used.  This patch is to remove it.

gdb:

2014-10-09  Yao Qi  <yao@codesourcery.com>

* infrun.c (handle_signal_stop): Remove local variable 'printed'.

9 years agodaily update
Alan Modra [Wed, 8 Oct 2014 23:00:35 +0000 (09:30 +1030)]
daily update

9 years agoAdd Yao Qi as global maintainer
Stan Shebs [Wed, 8 Oct 2014 18:23:16 +0000 (11:23 -0700)]
Add Yao Qi as global maintainer

gdb/ChangeLog:

2014-10-08  Stan Shebs  <stan@codesourcery.com>

    * MAINTAINERS (GLOBAL MAINTAINERS): Add Yao Qi.

9 years agoinclude/elf/aarch64.h: Add reloc numbers from ABI release 1.0
Will Newton [Tue, 30 Sep 2014 11:17:32 +0000 (12:17 +0100)]
include/elf/aarch64.h: Add reloc numbers from ABI release 1.0

Add the relocation numbers defined in ABI release 1.0 but missing
from the current header. This will allow tools like objdump to dump
objects that use these relocations.

include/elf/ChangeLog:

2014-10-08  Will Newton  <will.newton@linaro.org>

* aarch64.h: Sync up relocations with ABI release 1.0.

9 years agoDo not include unnecessary files in fbsd-tdep.c
Gary Benson [Wed, 8 Oct 2014 08:52:38 +0000 (09:52 +0100)]
Do not include unnecessary files in fbsd-tdep.c

This commit makes fbsd-tdep.c not include string.h or gdb_assert.h
as both are already included by defs.h.

gdb/ChangeLog:

* fbsd-tdep.c: Do not include string.h or gdb_assert.h.

9 years agoInclude common-exceptions.h in common-defs.h
Gary Benson [Wed, 8 Oct 2014 08:33:22 +0000 (09:33 +0100)]
Include common-exceptions.h in common-defs.h

This commit includes common-exceptions.h in common-defs.h and removes
all other inclusions.

gdb/ChangeLog:

* common/common-defs.h: Include common-exceptions.h.
* exceptions.h: Do not include common-exceptions.h.

gdb/gdbserver/ChangeLog:

* server.h: Do not include common-exceptions.h.

9 years agoInclude cleanups.h in common-defs.h
Gary Benson [Wed, 8 Oct 2014 08:33:22 +0000 (09:33 +0100)]
Include cleanups.h in common-defs.h

This commit includes cleanups.h in common-defs.h and removes all other
inclusions.

gdb/ChangeLog:

* common/common-defs.h: Include cleanups.h.
* common/common-exceptions.c: Do not include cleanups.h.
* utils.h: Likewise.

gdb/gdbserver/ChangeLog:

* server.h: Do not include cleanups.h.

9 years agoRemove spurious exceptions.h inclusions
Gary Benson [Wed, 8 Oct 2014 08:33:22 +0000 (09:33 +0100)]
Remove spurious exceptions.h inclusions

defs.h includes utils.h, and utils.h includes exceptions.h.  All GDB
.c files include defs.h as their first line, so no file other than
utils.h needs to include exceptions.h.  This commit removes all such
inclusions.

gdb/ChangeLog:

* ada-lang.c: Do not include exceptions.h.
* ada-valprint.c: Likewise.
* amd64-tdep.c: Likewise.
* auto-load.c: Likewise.
* block.c: Likewise.
* break-catch-throw.c: Likewise.
* breakpoint.c: Likewise.
* btrace.c: Likewise.
* c-lang.c: Likewise.
* cli/cli-cmds.c: Likewise.
* cli/cli-interp.c: Likewise.
* cli/cli-script.c: Likewise.
* completer.c: Likewise.
* corefile.c: Likewise.
* corelow.c: Likewise.
* cp-abi.c: Likewise.
* cp-support.c: Likewise.
* cp-valprint.c: Likewise.
* darwin-nat.c: Likewise.
* dwarf2-frame-tailcall.c: Likewise.
* dwarf2-frame.c: Likewise.
* dwarf2loc.c: Likewise.
* dwarf2read.c: Likewise.
* eval.c: Likewise.
* event-loop.c: Likewise.
* event-top.c: Likewise.
* f-valprint.c: Likewise.
* frame-unwind.c: Likewise.
* frame.c: Likewise.
* gdbtypes.c: Likewise.
* gnu-v2-abi.c: Likewise.
* gnu-v3-abi.c: Likewise.
* guile/scm-auto-load.c: Likewise.
* guile/scm-breakpoint.c: Likewise.
* guile/scm-cmd.c: Likewise.
* guile/scm-frame.c: Likewise.
* guile/scm-lazy-string.c: Likewise.
* guile/scm-param.c: Likewise.
* guile/scm-symbol.c: Likewise.
* guile/scm-type.c: Likewise.
* hppa-hpux-tdep.c: Likewise.
* i386-tdep.c: Likewise.
* inf-loop.c: Likewise.
* infcall.c: Likewise.
* infcmd.c: Likewise.
* infrun.c: Likewise.
* interps.c: Likewise.
* interps.h: Likewise.
* jit.c: Likewise.
* linespec.c: Likewise.
* linux-nat.c: Likewise.
* linux-thread-db.c: Likewise.
* m32r-rom.c: Likewise.
* main.c: Likewise.
* memory-map.c: Likewise.
* mi/mi-cmd-break.c: Likewise.
* mi/mi-cmd-stack.c: Likewise.
* mi/mi-interp.c: Likewise.
* mi/mi-main.c: Likewise.
* monitor.c: Likewise.
* nto-procfs.c: Likewise.
* objc-lang.c: Likewise.
* p-valprint.c: Likewise.
* parse.c: Likewise.
* ppc-linux-tdep.c: Likewise.
* printcmd.c: Likewise.
* probe.c: Likewise.
* python/py-auto-load.c: Likewise.
* python/py-breakpoint.c: Likewise.
* python/py-cmd.c: Likewise.
* python/py-finishbreakpoint.c: Likewise.
* python/py-frame.c: Likewise.
* python/py-framefilter.c: Likewise.
* python/py-function.c: Likewise.
* python/py-gdb-readline.c: Likewise.
* python/py-inferior.c: Likewise.
* python/py-infthread.c: Likewise.
* python/py-lazy-string.c: Likewise.
* python/py-linetable.c: Likewise.
* python/py-param.c: Likewise.
* python/py-prettyprint.c: Likewise.
* python/py-symbol.c: Likewise.
* python/py-type.c: Likewise.
* python/py-value.c: Likewise.
* python/python-internal.h: Likewise.
* python/python.c: Likewise.
* record-btrace.c: Likewise.
* record-full.c: Likewise.
* regcache.c: Likewise.
* remote-fileio.c: Likewise.
* remote-mips.c: Likewise.
* remote.c: Likewise.
* rs6000-aix-tdep.c: Likewise.
* rs6000-nat.c: Likewise.
* skip.c: Likewise.
* solib-darwin.c: Likewise.
* solib-dsbt.c: Likewise.
* solib-frv.c: Likewise.
* solib-ia64-hpux.c: Likewise.
* solib-spu.c: Likewise.
* solib-svr4.c: Likewise.
* solib.c: Likewise.
* spu-tdep.c: Likewise.
* stack.c: Likewise.
* stap-probe.c: Likewise.
* symfile-mem.c: Likewise.
* symmisc.c: Likewise.
* target.c: Likewise.
* thread.c: Likewise.
* top.c: Likewise.
* tracepoint.c: Likewise.
* tui/tui-interp.c: Likewise.
* typeprint.c: Likewise.
* utils.c: Likewise.
* valarith.c: Likewise.
* valops.c: Likewise.
* valprint.c: Likewise.
* value.c: Likewise.
* varobj.c: Likewise.
* windows-nat.c: Likewise.
* xml-support.c: Likewise.

9 years agodaily update
Alan Modra [Tue, 7 Oct 2014 23:00:35 +0000 (09:30 +1030)]
daily update

9 years agodaily update
Alan Modra [Mon, 6 Oct 2014 23:00:33 +0000 (09:30 +1030)]
daily update

9 years agodaily update
Alan Modra [Sun, 5 Oct 2014 23:00:41 +0000 (09:30 +1030)]
daily update

9 years agoMIPS: Rewrite `add_offset_16' to match its name
Maciej W. Rozycki [Sun, 5 Oct 2014 22:37:53 +0000 (23:37 +0100)]
MIPS: Rewrite `add_offset_16' to match its name

A helper function called `add_offset_16' is used by
`extended_mips16_next_pc' to calculate branch destinations.  Weirdly
enough the helper does not do what the name suggests and rather than
doing its work for a 16-bit immediate branch offset it makes its
calculations on a 26-bit immediate target used by JAL and JALX
instructions.  Furthermore the JAL/JALX calculation is only needed once
by `extended_mips16_next_pc' while a 16-bit branch offset calculation
is made inline several times across `extended_mips16_next_pc'.

This change therefore replaces the contents of `add_offset_16' with the
16-bit branch offset calculation and updates `extended_mips16_next_pc'
accordingly.

* mips-tdep.c (add_offset_16): Rewrite to implement what the
name implies.
(extended_mips16_next_pc): Update accordingly.

9 years agoMIPS: Correct heuristic prologue termination conditions
Maciej W. Rozycki [Sun, 5 Oct 2014 21:39:52 +0000 (22:39 +0100)]
MIPS: Correct heuristic prologue termination conditions

This change addresses a regression in gdb.dwarf2/dw2-skip-prologue.exp
across MIPS16 multilibs:

(gdb) file .../gdb.dwarf2/dw2-skip-prologue
Reading symbols from .../gdb.d/gdb.dwarf2/dw2-skip-prologue...done.
(gdb) delete breakpoints
(gdb) info breakpoints
No breakpoints or watchpoints.
(gdb) break main
warning: Breakpoint address adjusted from 0x00400725 to 0x00400721.
Breakpoint 1 at 0x400721
(gdb) set remotetimeout 5
(gdb) kill
The program is not being run.
(gdb)
[...]
target remote ...:2345
Reading symbols from .../mips16/lib/ld.so.1...done.
warning: Breakpoint address adjusted from 0x00400725 to 0x00400721.
warning: Breakpoint address adjusted from 0x00400725 to 0x00400721.
0x2aaa8e81 in __start () from .../mips16/lib/ld.so.1
(gdb) continue
Continuing.
warning: Breakpoint address adjusted from 0x00400725 to 0x00400721.
warning: Breakpoint 1 address previously adjusted from 0x00400725 to
0x00400721.
Breakpoint 1, 0x00400721 in main ()
(gdb) break func
Breakpoint 2 at 0x4006a1: func. (2 locations)
(gdb) continue
Continuing.
warning: GDB can't find the start of the function at 0x4006dd.

    GDB is unable to find the start of the function at 0x4006dd
and thus can't determine the size of that function's stack frame.
This means that GDB may be unable to access that stack frame, or
the frames below it.
    This problem is most likely caused by an invalid program counter or
stack pointer.
    However, if you think GDB should simply search farther back
from 0x4006dd for code which looks like the beginning of a
function, you can increase the range of the search using the `set
heuristic-fence-post' command.

Program received signal SIGBUS, Bus error.
0x0040072b in main ()
(gdb) FAIL: gdb.dwarf2/dw2-skip-prologue.exp: continue to breakpoint: func

-- notice the breakpoint adjustment messages that are already a bad
sign.  These happen when a breakpoint is requested in a branch delay
slot and are not supposed to happen unless explicitly requested with an
address pointing to a branch delay slot instruction.  No symbol or line
debug information is supposed to direct GDB to place a breakpoint in a
delay slot.

Here's how `main' looks like:

00400718 <main>:
  400718: 64f5       save 40,ra,s0-s1
  40071a: 1a00 01a8  jal 4006a0 <func>
  40071e: 0104       addiu s1,sp,16
  400720: 1a00 01b7  jal 4006dc <func+0x3c>
  400724: 6702       move s0,v0
  400726: e049       addu v0,s0,v0
  400728: 65b9       move sp,s1
  40072a: 6473       restore 24,ra,s0-s1
  40072c: e8a0       jrc ra
  40072e: 6500       nop

-- so 0x400725 is the MIPS16 instruction address of the first MOVE
instruction seen above, in a delay slot of the preceding JAL instruction
indeed.  This test case arranges for `main' to have no debug information
so it is one of the heuristic prologue scanners, `mips16_scan_prologue'
specifically in this case, that is responsible for finding the right
location for the breakpoint to place.

In this case the prologue really ends with the ADDIU instruction,
reordered into the delay slot of the first JAL instruction.  Of course
we can't place the breakpoint for `main' after it as by doing so we'll
let `func' to be called before hitting this breakpoint.  So the
breakpoint has to go at the JAL instruction instead, or 0x40071b.

To make a general case out of it we must never consider any jump or
branch instruction to be a part of a function's prologue.  In the
presence of a jump or branch at the beginning of a function the furthest
instruction examined for the purpose of constructing frame information
can be one in the delay slot of that jump or branch if present, and
otherwise -- that is when the jump or branch is compact and has no delay
slot -- the instruction immediately preceding the jump or branch.

This change implements that approach across prologue scanners for the
three instruction ISAs.  In implementing it I have factored out code
from the existing `*_instruction_has_delay_slot' handlers to be shared
and a side effect for the microMIPS implementation is it now always
fetches the second 16-bit halfword of 32-bit instructions even if it
eventually is not going to be needed.  I think it's an acceptable
tradeoff for the purpose of code sharing.

To make things more consistent I also carried logic from
`micromips_scan_prologue' over to the other two scanners to accept (and
ignore) a single non-prologue non-control transfer instruction reordered
by the compiler into the prologue.  While doing this I simplified the
exit path from the scan loop such that `end_prologue_addr' is set only
once.  This made some concerns expressed in comments no longer
applicable, although even before they were not valid.

I have not fixed the logic around `load_immediate_bytes' in
`mips32_scan_prologue' though, it remains broken, although I took care
not to break it more.  An approach similar to one taken for handling
larger stack adjustments in `micromips_scan_prologue' will have to be
eventually implemented here.

For regression testing I used my usual choice of the mips-linux-gnu
target and the following multilibs:

-EB
-EB -msoft-float
-EB -mips16
-EB -mips16 -msoft-float
-EB -mmicromips
-EB -mmicromips -msoft-float
-EB -mabi=n32
-EB -mabi=n32 -msoft-float
-EB -mabi=64
-EB -mabi=64 -msoft-float

and the -EL variants of same.

That removed gdb.dwarf2/dw2-skip-prologue.exp failures across MIPS16
multilibs, the test log now shows:

(gdb) file .../gdb.dwarf2/dw2-skip-prologue
Reading symbols from .../gdb.d/gdb.dwarf2/dw2-skip-prologue...done.
(gdb) delete breakpoints
(gdb) info breakpoints
No breakpoints or watchpoints.
(gdb) break main
Breakpoint 1 at 0x40071b
(gdb) set remotetimeout 5
(gdb) kill
The program is not being run.
(gdb)
[...]
target remote ...:2345
Reading symbols from .../mips16/lib/ld.so.1...done.
0x2aaa8e81 in __start () from .../mips16/lib/ld.so.1
(gdb) continue
Continuing.

Breakpoint 1, 0x0040071b in main ()
(gdb) break func
Breakpoint 2 at 0x4006a1: func. (2 locations)
(gdb) continue
Continuing.

Breakpoint 2, func (param=0) at main.c:5
5    This program is free software; you can redistribute it and/or modify
(gdb) PASS: gdb.dwarf2/dw2-skip-prologue.exp: continue to breakpoint: func

-- so things look like intended.

That also did regress, again across MIPS16 multilibs, another test case,
gdb.base/step-symless.exp:

(gdb) file .../gdb.d/gdb.base/step-symless
Reading symbols from .../gdb.base/step-symless...done.
(gdb) delete breakpoints
(gdb) info breakpoints
No breakpoints or watchpoints.
(gdb) break main
Breakpoint 1 at 0x4006d3
(gdb) set remotetimeout 5
(gdb) kill
The program is not being run.
(gdb)
[...]
target remote ...:2345
Reading symbols from .../mips16/lib/ld.so.1...done.
0x2aaa8e81 in __start () from .../mips16/lib/ld.so.1
(gdb) continue
Continuing.

Breakpoint 1, 0x004006d3 in main ()
(gdb) break symful
Breakpoint 2 at 0x4006a5
(gdb) step
Single stepping until exit from function main,
which has no line number information.
warning: GDB can't find the start of the function at 0x4006b9.

    GDB is unable to find the start of the function at 0x4006b9
and thus can't determine the size of that function's stack frame.
This means that GDB may be unable to access that stack frame, or
the frames below it.
    This problem is most likely caused by an invalid program counter or
stack pointer.
    However, if you think GDB should simply search farther back
from 0x4006b9 for code which looks like the beginning of a
function, you can increase the range of the search using the `set
heuristic-fence-post' command.
0x004006b9 in ?? ()
(gdb) FAIL: gdb.base/step-symless.exp: step

-- but that is actually a good sign.  Here `main', again, has no debug
information and code involved looks like:

004006a0 <symful>:
  4006a0: 6491       save 8,s1
  4006a2: 673d       move s1,sp
  4006a4: b204       lw v0,4006b4 <symful+0x14>
  4006a6: 9a40       lw v0,0(v0)
  4006a8: 4261       addiu v1,v0,1
  4006aa: b203       lw v0,4006b4 <symful+0x14>
  4006ac: da60       sw v1,0(v0)
  4006ae: 65b9       move sp,s1
  4006b0: 6411       restore 8,s1
  4006b2: e8a0       jrc ra
  4006b4: 0041       addiu s0,sp,260
  4006b6: 0860       la s0,400834 <__libc_start_main@mips16plt+0x54>
  4006b8: 6491       save 8,s1
  4006ba: 673d       move s1,sp
  4006bc: b204       lw v0,4006cc <symful+0x2c>
  4006be: 9a40       lw v0,0(v0)
  4006c0: 4261       addiu v1,v0,1
  4006c2: b203       lw v0,4006cc <symful+0x2c>
  4006c4: da60       sw v1,0(v0)
  4006c6: 65b9       move sp,s1
  4006c8: 6411       restore 8,s1
  4006ca: e8a0       jrc ra
  4006cc: 0041       addiu s0,sp,260
  4006ce: 0860       la s0,40084c <__libc_start_main@mips16plt+0x6c>

004006d0 <main>:
  4006d0: 64d4       save 32,ra,s1
  4006d2: 1a00 01ae  jal 4006b8 <symful+0x18>
  4006d6: 0104       addiu s1,sp,16
  4006d8: 1a00 01a8  jal 4006a0 <symful>
  4006dc: 6500       nop
  4006de: 6740       move v0,zero
  4006e0: 65b9       move sp,s1
  4006e2: 6452       restore 16,ra,s1
  4006e4: e8a0       jrc ra
  4006e6: 6500       nop
  4006e8: 6500       nop
  4006ea: 6500       nop
  4006ec: 6500       nop
  4006ee: 6500       nop

-- and the original log:

(gdb) file .../gdb.base/step-symless
Reading symbols from .../gdb.base/step-symless...done.
(gdb) delete breakpoints
(gdb) info breakpoints
No breakpoints or watchpoints.
(gdb) break main
warning: Breakpoint address adjusted from 0x004006dd to 0x004006d9.
Breakpoint 1 at 0x4006d9
(gdb) set remotetimeout 5
(gdb) kill
The program is not being run.
(gdb)
[...]
target remote ...:2345
Reading symbols from .../mips16/lib/ld.so.1...done.
warning: Breakpoint address adjusted from 0x004006dd to 0x004006d9.
warning: Breakpoint address adjusted from 0x004006dd to 0x004006d9.
0x2aaa8e81 in __start () from .../mips16/lib/ld.so.1
(gdb) continue
Continuing.
warning: Breakpoint address adjusted from 0x004006dd to 0x004006d9.
warning: Breakpoint 1 address previously adjusted from 0x004006dd to
0x004006d9.
Breakpoint 1, 0x004006d9 in main ()
(gdb) break symful
Breakpoint 2 at 0x4006a5
(gdb) step
Single stepping until exit from function main,
which has no line number information.

Breakpoint 2, 0x004006a5 in symful ()
(gdb) PASS: gdb.base/step-symless.exp: step

So the breakpoint at `main' was actually set at an instruction after the
call to `symful+0x18' aka `symless' and the test only passed because
single-stepping through `symless' wasn't actually done at all.  With
this change in place this test fails for MIPS16 multilibs consistently
with all the other multilibs where it already failed in this manner
previously.

* mips-tdep.c (mips16_instruction_is_compact_branch): New
function.
(micromips_instruction_is_compact_branch): Likewise.
(mips16_scan_prologue): Terminate scanning upon seeing a branch
or a compact jump, reaching a jump delay slot, or seeing a
second non-prologue instruction.
(micromips_scan_prologue): Also terminate scanning upon seeing a
compact branch or jump, or reaching a branch or jump delay slot.
(mips32_scan_prologue): Terminate scanning upon reaching a branch
or jump delay slot, or seeing a second non-prologue instruction.
(mips32_instruction_has_delay_slot): Retain instruction
examination code only, update arguments accordingly and move
instruction fetch pieces to...
(mips32_insn_at_pc_has_delay_slot): ... this new function.
(micromips_instruction_has_delay_slot): Likewise and to...
(micromips_insn_at_pc_has_delay_slot): ... this new function.
(mips16_instruction_has_delay_slot): Likewise and to...
(mips16_insn_at_pc_has_delay_slot): ... this new function.
(mips_single_step_through_delay): Update accordingly.
(mips_adjust_breakpoint_address): Likewise.

9 years agoMIPS: Correct MUSTBE32 interpretation in delay slot handling
Maciej W. Rozycki [Sun, 5 Oct 2014 20:50:47 +0000 (21:50 +0100)]
MIPS: Correct MUSTBE32 interpretation in delay slot handling

This change addresses `micromips_instruction_has_delay_slot' and
`mips16_instruction_has_delay_slot' that both incorrectly interpret
their MUSTBE32 argument.  Their callers assume that when the flag is
clear these functions will return 1 when any non-compact jump or branch
instruction is present at ADDR, while in fact they will only return 1
for 16-bit such instructions only.  This change makes the implementation
match the expectations.

* mips-tdep.c (micromips_instruction_has_delay_slot): When
!mustbe32 also return 1 for 32-bit instructions.
(mips16_instruction_has_delay_slot): Likewise.  Add an
explanatory comment.

9 years agodaily update
Alan Modra [Sat, 4 Oct 2014 23:00:54 +0000 (09:30 +1030)]
daily update

9 years agoDiscard zero address range eh_frame FDEs
Alan Modra [Sat, 4 Oct 2014 06:23:58 +0000 (15:53 +0930)]
Discard zero address range eh_frame FDEs

These are useless because they can't match any address.  In fact,
worse than useless because the .eh_frame_hdr lookup table matching
addresses to FDEs does not contain information about the FDE range.
The table is sorted by address;  Range is inferred by the address
delta from one entry to the next.  So if a zero address range FDE is
followed by a normal non-zero range FDE for the same address,
everything is good.  However, the qsort could just as easily sort the
FDEs in the other order, in which case the normal FDE would
effectively be seen to have a zero range.

bfd/
PR 17447
* elf-bfd.h (struct eh_cie_fde): Comment re NULL u.fde.cie_inf.
* elf-eh-frame.c (_bfd_elf_parse_eh_frame): Mark zero address
range FDEs for discarding.
(vma_compare): Sort on range after address.
(_bfd_elf_gc_mark_fdes): Test for NULL u.fde.cie_inf.
(_bfd_elf_discard_section_eh_frame): Likewise.  Write "FDE" in
error message rather than "fde".
(_bfd_elf_write_section_eh_frame_hdr): Write "PC" and "FDE" in
error message.
ld/testsuite/
* ld-elf/eh1.s: Don't create FDEs with zero address ranges.
* ld-elf/eh3.s: Likewise.
* ld-elf/eh1.d, * ld-elf/eh2.d, * ld-elf/eh3.d: Adjust.
* ld-mips-elf/eh-frame1-n32.d: Warning match update.
* ld-mips-elf/eh-frame1-n64.d: Likewise.
* ld-mips-elf/eh-frame2-n32.d: Likewise.
* ld-mips-elf/eh-frame2-n64.d: Likewise.