Commit Graph

82259 Commits

Author SHA1 Message Date
GDB Administrator d274fbe8a4 Automatic date update in version.in 2014-12-25 00:00:09 +00:00
H.J. Lu 09eb8b7bd6 Add cast to unsigned long
* pei-x86_64.c (pex64_bfd_print_pdata_section): Add cast to
	unsigned long.
2014-12-24 14:14:14 -08:00
Andrew Burgess f5be95254d AVR: Document linker relaxation related options.
Adds documentation describing the -mlink-relax and -mno-link-relax
command line options.

gas/ChangeLog:

	* doc/c-avr.texi: Document -mlink-relax and -mno-link-relax.
2014-12-24 21:28:34 +00:00
Andrew Burgess edc9e9a62f AVR: Assembler now prepares for linker relaxation by default.
Have the assembler prepare for linker relaxation by default.  This
means that users will be able to make use of linker relaxation without
having to adjust the assembler flags, this can make life easier when
compiling libraries.

Having this on by default in the assembler should make no difference to
the assembler code produced, however, some of the debug information will
be slightly less compressed.

A few tests needed to be updated as a result of this change as they
relied on linker relaxation support being off by default.

I've tightened up the definition of which sections can be relaxed on AVR
as part of this commit, the assembler used to think that all
non-debugging sections could be relaxed, when in reality only code
sections can be relaxed for AVR.  The previous definition was not
dangerous, just over cautious.  The new tighter definition allows an
extra test (gas/testsuite/gas/all/forward.d) to continue to pass.

gas/ChangeLog:

	* config/tc-avr.c (struct avr_opt_s): Change link_relax to
	no_link_relax, extend comment.
	(enum options): Add new OPTION_NO_LINK_RELAX.
	(md_longopts): Add entry for -mno-link-relax.
	(md_parse_option): Handle OPTION_NO_LINK_RELAX, and update
	OPTION_LINK_RELAX.
	(md_begin): Initialise linkrelax from no_link_relax.
	(md_show_usage): Include -mno-link-relax option.
	(relaxable_section): Only allocatable code sections can be
	relaxed.
	* config/tc-avr.h (TC_LINKRELAX_FIXUP): Define.

gas/testsuite/ChangeLog:

	* gas/all/gas.exp: Test will not pass on AVR due to linker
	relaxation support.
	* gas/avr/noreloc_withoutrelax.d: Add -mno-link-relax option.
	* gas/avr/link-relax-elf-flag-clear.d: Likewise.

ld/testsuite/ChangeLog:

	* ld/testsuite/ld-avr/relax-elf-flags-02.d: Add -mno-link-relax
	option.
	* ld/testsuite/ld-avr/relax-elf-flags-03.d: Likewise.
	* ld/testsuite/ld-avr/relax-elf-flags-04.d: Likewise.
	* ld/testsuite/ld-avr/relax-elf-flags-05.d: Likewise.
	* ld/testsuite/ld-avr/relax-elf-flags-06.d: Likewise.
2014-12-24 21:27:43 +00:00
Alexander Cherepanov 7a093a7820 This patch fixes a snafu where the -D and -U short versions of the
--enable-deterministic-archives and --disable-deteministic-archive
options were not being accepted.

	PR binutils/17671
	* objcopy.c (copy_main, strip_main): Add D and U to the list of
	accepted short versions of long options.
2014-12-24 14:50:53 +00:00
Anthony Green ed4fd7b7f3 Add support for moxie's mul.x and umul.x instructions 2014-12-24 08:38:09 -05:00
Anthony Green 0be40ae409 Add mul.x and umul.x instructions to moxie port 2014-12-24 08:38:09 -05:00
Alan Modra ca0694adf6 Don't create .eh_frame_hdr on shared lib bfd
If no object files have .eh_frame, but some shared library does, then
ld creates a .eh_frame_hdr section using the shared library bfd.  This
is silly since shared library .eh_frame sections don't contribute to
the output .eh_frame and thus no .eh_frame_hdr is needed.

Also, the bfd section list and count is cleared for shared libraries,
and a zero section count used as a flag in lang_check to omit a call
to bfd_merge_private_bfd_data for shared libraries.  If we create a
section on a shared lib bfd then ld will wrongly attempt to merge the
shared library private bfd data.

	PR 17742
	* ld/emultempl/elf32.em (gld${EMULATION_NAME}_after_open): Exclude
	shared libraries in loop looking for .eh_frame sections.
	Similarly for build-id loop.
2014-12-24 23:47:56 +10:30
Pierre Muller 854399ea9d This patch adds support for printing out the pdata section of PE objects.
* pe-x86_64.c (pex64_bfd_print_pdata): Add external
	declaration.
	(bfd_pe_print_data): Set macro to pex64_bfd_print_data.
	* pei-x86_64.c (pex64_bfd_print_pdata): Changed to
	global function. Now handles multiple .pdata sections.
	(pex_bfd_print_pdata_section): New static helper function,
	using most of old pex_bfd_print_pdata function code, but adding
	support for coff pe objects, which might have some fields
	starting at zero offset.
	(pex64_print_all_pdata_sections) : New static helper function,
	used in call to bfd_map_over_sections inside new
	pex66_bfd_print_pdata function.
	(bfd_boolean pdata_count): New static variable, used to return
	bfd_boolean value for pex64_bfd_print_pdata function.
2014-12-24 10:06:57 +00:00
Nick Clifton c361b9ac1f Reverts an "enhancement" made in a previous delta which complained of
unprocessed augmentation data at the end of a CIE.

	* dwarf.c (read_cie): Revert check for unused augmentation data -
	it was bogus.
2014-12-24 08:21:50 +00:00
Alan Modra d5111a0e03 Fix generic linker symbol output when weak is overridden by strong
Yes, I know this also affects bfd_link_hash_indirect, but output of
indirect and warning symbols looks quite broken anyway.

	* linker.c (_bfd_generic_link_output_symbols): Remove BSF_WEAK
	flag from bfd_link_hash_defined symbols.
2014-12-24 13:02:42 +10:30
Alan Modra 931804de6c Yet another DEFINED testcase
* ld-scripts/defined6.s,
	* ld-scripts/defined6.t,
	* ld-scripts/defined6.d: New test.
	* ld-scripts/defined.exp: Run it.
2014-12-24 11:56:51 +10:30
GDB Administrator 8a7fbfc0da Automatic date update in version.in 2014-12-24 00:00:10 +00:00
Andrew Stubbs 805b1c8bc6 Clarify strip docs.
binutils/
	* objcopy.c (strip_usage): Reword --remove-section description.
	* doc/binutils.texi (strip): Likewise.
2014-12-23 20:28:16 +00:00
Doug Evans 1994afbf19 Look up primitive types as symbols.
gdb/ChangeLog:

	* ada-lang.c (user_select_syms): Only fetch symtab if symbol is
	objfile-owned.
	(cache_symbol): Ignore symbols that are not objfile-owned.
	* block.c (block_objfile): New function.
	(block_gdbarch): New function.
	* block.h (block_objfile): Declare.
	(block_gdbarch): Declare.
	* c-exp.y (classify_name): Remove call to
	language_lookup_primitive_type.  No longer necessary.
	* gdbtypes.c (lookup_typename): Call lookup_symbol_in_language.
	Remove call to language_lookup_primitive_type.  No longer necessary.
	* guile/scm-symbol.c (syscm_gdbarch_data_key): New static global.
	(syscm_gdbarch_data): New struct.
	(syscm_init_arch_symbols): New function.
	(syscm_get_symbol_map): Renamed from syscm_objfile_symbol_map.
	All callers updated.  Handle symbols owned by arches.
	(gdbscm_symbol_symtab): Handle symbols owned by arches.
	(gdbscm_initialize_symbols): Initialize syscm_gdbarch_data_key.
	* language.c (language_lookup_primitive_type_1): New function.
	(language_lookup_primitive_type): Call it.
	(language_alloc_type_symbol): New function.
	(language_init_primitive_type_symbols): New function.
	(language_lookup_primitive_type_as_symbol): New function.
	* language.h (struct language_arch_info) <primitive_type_symbols>:
	New member.
	(language_lookup_primitive_type): Add function comment.
	(language_lookup_primitive_type_as_symbol): Declare.
	* printcmd.c (address_info): Handle arch-owned symbols.
	* python/py-symbol.c (sympy_get_symtab): Ditto.
	(set_symbol): Ditto.
	(sympy_dealloc): Ditto.
	* symmisc.c (print_symbol): Ditto.
	* symtab.c (fixup_symbol_section): Ditto.
	(lookup_symbol_aux): Initialize block_found.
	(basic_lookup_symbol_nonlocal): Try looking up the symbol as a
	primitive type.
	(initialize_objfile_symbol_1): New function.
	(initialize_objfile_symbol): Call it.
	(allocate_symbol): Call it.
	(allocate_template_symbol): Call it.
	(symbol_objfile): Assert symbol is objfile-owned.
	(symbol_arch, symbol_symtab, symbol_set_symtab): Ditto.
	* symtab.h (struct symbol) <owner>: Replaces member "symtab".
	(struct symbol) <is_objfile_owned>: New member.
	(SYMBOL_OBJFILE_OWNED): New macro.
	* cp-namespace.c (cp_lookup_bare_symbol): New arg langdef.
	All callers updated.  Try to find the symbol as a primitive type.
	(lookup_namespace_scope): New arg langdef.  All callers updated.
	Call cp_lookup_bare_symbol directly for simple bare symbols.
2014-12-23 07:58:14 -08:00
Andrew Burgess 9d7b48dc6e AVR/ld: Propagate link-relax elf header flag correctly.
The AVR target has an elf header flag to indicate if an object was
assembler ready for linker relaxation.  If a partial link is performed
then it is important that the link-relax flag in the output object is
set correctly, otherwise, during the final link, we might try to perform
linker relaxation on code that was not assembled suitably.

As the link-relax elf header covers the entire object file we must be
conservative when setting the flag in the output object, so, for a
partial link, any input object that does not have the link-relax flag
set will cause the output object to also not have the link-relax flag
set.

This conservative approach could be softened in future, we only need to
disable the link relax flag if an input file is not marked link-relax
ready, and the input file contains a relaxable section.  However, I've
left this optimisation for a later day.

For the final link I've overloaded the use of the link-relax elf header
flag, in a final executable, the flag now indicates if the executable
was built with linker relaxation on or not.

ld/ChangeLog:

	* emultempl/avrelf.em: Add include of elf/avr.h.
	(avr_finish): New function.
	(LDEMUL_FINISH): Added.

ld/testsuite/ChangeLog:

	* ld-avr/relax-elf-flags-01.d: New file.
	* ld-avr/relax-elf-flags-02.d: New file.
	* ld-avr/relax-elf-flags-03.d: New file.
	* ld-avr/relax-elf-flags-04.d: New file.
	* ld-avr/relax-elf-flags-05.d: New file.
	* ld-avr/relax-elf-flags-06.d: New file.
	* ld-avr/relax-elf-flags-07.d: New file.
	* ld-avr/relax-elf-flags-08.d: New file.
	* ld-avr/relax-elf-flags-a.s: New file.
	* ld-avr/relax-elf-flags-b.s: New file.
2014-12-23 15:45:11 +00:00
Andrew Burgess eac7440d80 AVR: Only set link-relax elf flag when appropriate.
The AVR target uses a bit in the elf header flags to indicate if the
object was assembled ready for linker relaxation.  Previously this flag
was always set, even when the object was not assembled ready for linker
relaxation.

This patch moves setting of the flag into the assembler, and sets it
only when the assembler is preparing the file for linker relaxation.

bfd/ChangeLog:

	* elf32-avr.c (bfd_elf_avr_final_write_processing): Don't set
	EF_AVR_LINKRELAX_PREPARED unconditionally.

gas/ChangeLog:

	* config/tc-avr.c: Add include for elf/avr.h.
	(avr_elf_final_processing): New function.
	* config/tc-avr.h (elf_tc_final_processing): Define.
	(avr_elf_final_processing): Declare

gas/testsuite/ChangeLog:

	* gas/avr/link-relax-elf-flag-clear.d: New file.
	* gas/avr/link-relax-elf-flag-set.d: New file.
	* gas/avr/link-relax-elf-flag.s: New file.
2014-12-23 15:45:11 +00:00
Doug Evans c01feb3675 symtab.h (SYMBOL_DOMAIN_BITS): New macro.
gdb/ChangeLog:

	* symtab.h (SYMBOL_DOMAIN_BITS): New macro.
	(struct symbol) <domain>: Use it.
2014-12-23 07:31:00 -08:00
Doug Evans 38bf1463f4 initialize_objfile_symbol: Renamed from initialize_symbol.
gdb/ChangeLog:

	* symtab.c (initialize_objfile_symbol): Renamed from initialize_symbol.
	All callers updated.
2014-12-23 07:28:28 -08:00
Doug Evans f606139ae8 Add langdef arg to la_lookup_symbol_nonlocal.
gdb/ChangeLog:

	* language.h (struct language_defn) <la_lookup_symbol_nonlocal>:
	New arg language_defn.  All uses updated.
2014-12-23 07:24:48 -08:00
Doug Evans 08be3fe322 Replace some symbol accessor macros with functions.
gdb/ChangeLog:

	* symtab.h (SYMBOL_SYMTAB): Delete
	(SYMBOL_OBJFILE): Delete.
	(symbol_symtab, symbol_set_symtab): Declare.
	(symbol_objfile, symbol_arch): Declare.
	* symtab.c (symbol_symtab): Replaces SYMBOL_SYMTAB.  All uses updated.
	All references to symbol->symtab redirected through here.
	(symbol_set_symtab): New function.  All assignments to SYMBOL_SYMTAB
	redirected through here.
	(symbol_arch): New function.
	(symbol_objfile): New function.  Replaces SYMBOL_OBJFILE.
	All uses updated.
	* cp-namespace.c (cp_lookup_symbol_imports_or_template): Call
	symbol_arch.
	* findvar.c (default_read_var_value): Call symbol_arch.
	* guile/scm-frame.c (gdbscm_frame_block): Call symbol_objfile.
	* jv-lang.c (add_class_symtab_symbol): Call symbol_arch.
	* printcmd.c (address_info): Call symbol_arch.
	* tracepoint.c (scope_info): Call symbol_arch.
2014-12-23 07:21:10 -08:00
Nick Clifton 4347085ad3 This patch add support for cpu marvell-whitney.
* gas/config/tc-arm.c (arm_cpus): Add core marvell-whitney.
2014-12-23 13:41:13 +00:00
Nick Clifton c4416f3035 Reformat the objdump.1 man output to avoid overlong lines. 2014-12-23 13:11:10 +00:00
Alan Modra 422f1c65c9 Report an error for script multiply defined symbols
or maybe not just yet, but this is better than a FIXME.

	* ldexp.c (update_definedness): Return false if script symbol is
	redefining a strong symbol in an object.
	(exp_fold_tree_1 <etree_assign>): Set up for reporting a multiple
	definition error, but for now leave disabled.
2014-12-23 23:36:51 +10:30
Alan Modra 12b2843a6b Use a symbol flag bit to mark linker defined symbols
Trying to use the SEC_LINKER_CREATED section flag to determine whether
a symbol is linker defined fails to work on targets like alpha that
define special SEC_COMMON sections.  These might contain symbols that
originated in an object file.

include/
	* bfdlink.h (struct bfd_link_hash_entry): Comment non_ir_ref.  Add
	linker_def.
bfd/
	* elflink.c (_bfd_elf_define_linkage_sym): Set linker_def.
	* linker.c (_bfd_generic_link_add_one_symbol): Clear linker_def
	for CDEF, DEF, DEFW, COM.
ld/
	* ldexp.c (exp_fold_tree_1 <etree_provide>): Test linker_def.
ld/testsuite/
	* ld-powerpc/sdabase.s,
	* ld-powerpc/sdabase.t,
	* ld-powerpc/sdabase.d: New test.
	* ld-powerpc/sdabase2.t,
	* ld-powerpc/sdabase2.d: New test.
	* ld-powerpc/powerpc.exp: Run them.
2014-12-23 23:36:50 +10:30
Alan Modra 4cc2bf08a4 Don't PROVIDE over top of common symbols
This:
  int end[100000];
  int main(void) { end[99999] = 0; return 0; }
should not segfault.

ld/
	* ldexp.c (exp_fold_tree_1 <etree_provide>): Leave bfd_link_hash_common
	symbols alone.
ld/testsuite/
	* ld-elf/endsym.s, *ld-elf/endsym.d: New test.
2014-12-23 23:36:50 +10:30
Alan Modra cd8e2bcf0d Correct logic for "defined by object"
The old code missed testing bfd_link_hash_undefweak, and wrongly
excluded bfd_link_hash_common symbols.  It is also clearer to invert
the set of enum bfd_link_hash_type values tested.
bfd_link_hash_indirect and bfd_link_hash_warning will never appear
here.

	* ldexp.c (update_definedness): Correct logic setting by_object.
2014-12-23 23:36:50 +10:30
Alan Modra 18d6a79d35 Move support code for linker script DEFINED to ldexp.c
This moves support code for DEFINED to ldexp.c where it is used,
losing the lang_ prefix on identifiers.  Two new functions are needed
to initialize and clean up to hash table, but other than that there
are no functional changes here.

	* ldexp.c (struct definedness_hash_entry, definedness_table)
	(definedness_newfunc, symbol_defined, update_definedness): Move
	and rename from..
	* ldlang.h (struct lang_definedness_hash_entry): ..here,..
	* ldlang.c (lang_definedness_table, lang_definedness_newfunc)
	(lang_symbol_defined, lang_update_definedness): ..and here.
	* ldexp.c (ldexp_init, ldexp_finish): New functions, extracted from..
	* ldlang.c (lang_init, lang_finish): ..here.
	* ldexp.h (ldexp_init, ldexp_finish): Declare.
	* ldlang.h (lang_symbol_defined, lang_update_definedness): Delete.
	* ldmain.c (main): Call ldexp_init and ldexp_finish.
2014-12-23 23:36:50 +10:30
Nick Clifton 175a3e5098 Updated translations for the gas and gprof tools.
* po/es.po: Updated Esperanto translation.
	* po/fr.po: Updated French translation.
	* po/uk.po: Updated Ukrainian translation.
2014-12-23 12:39:34 +00:00
GDB Administrator 1fc8204e52 Automatic date update in version.in 2014-12-23 00:00:12 +00:00
H.J. Lu 926e166ccb Cast size to long to warn
* dwarf.c (read_cie): Cast size to long to warn.
2014-12-22 15:29:21 -08:00
Nick Clifton 058037d3a1 More fixes for invalid memory accesses exposed by fuzzed binaries.
PR binutils/17531
	* dwarf.c (decode_location_expression): Check for an out of range
	value for a DW_OP_GNU_entry_value expression.
	(display_debug_lines_raw): Check for a partial
	.debug_line. section being encountered without a prior, full
	.debug.line section.
	(display_debug_lines_decoded): Likewise.  Also check for
	li_line_range being zero.
	(display_debug_pubnames_worker): Check for an invalid pn_length
	field.
	(read_cie): Add range checks.
	* elfcomm.c (setup_archive): Check for a negative longnames_size.
2014-12-22 22:44:34 +00:00
Nick Clifton 5860e3f883 More fixes for memory access violations exposed by fuzzed binaries.
PR binutils/17512
	* archive.c (do_slurp_bsd_armap): Return if the parsed_size is
	zero.
	(bfd_slurp_armap): Zero terminate the name.
	(bfd_generic_stat_arch_elt): If there is no header, fail.
	* elf32-arc.c (arc_info_to_howto_rel): Replace BFD_ASSERT with
	error message.
	* elf32-avr.c (avr_info_to_howto_rela): Likewise.
	* elf32-cr16c.c (elf_cr16c_info_to_howto_rel): Likewise.
	* elf32-cris.c (cris_info_to_howto_rela): Likewise.
	* elf32-d10v.c (d10v_info_to_howto_rel): Likewise.
	* elf32-d30v.c (d30v_info_to_howto_rel): Likewise.
	* elf32-dlx.c (dlx_rtype_to_howto): Likewise.
	* elf32-epiphany.c (epiphany_info_to_howto_rela): Likewise.
	* elf32-fr30.c (fr30_info_to_howto_rela): Likewise.
	* elf32-frv.c (frv_info_to_howto_rela): Likewise.
	* elf32-i960.c (elf32_i960_info_to_howto_rel): Likewise.
	* elf32-ip2k.c (ip2k_info_to_howto_rela): Likewise.
	* elf32-iq2000.c (iq2000_info_to_howto_rela): Likewise.
	* elf32-lm32.c (lm32_info_to_howto_rela): Likewise.
	* elf32-m32c.c (m32c_info_to_howto_rela): Likewise.
	* elf32-m32r.c (m32r_info_to_howto_rel): Likewise.
	* elf32-m68hc11.c (m68hc11_info_to_howto_rel): Likewise.
	* elf32-m68hc12.c (m68hc11_info_to_howto_rel): Likewise.
	* elf32-mep.c (mep_info_to_howto_rela): Likewise.
	* elf32-metag.c (metag_info_to_howto_rela): Likewise.
	* elf32-moxie.c (moxie_info_to_howto_rela): Likewise.
	* elf32-msp430.c (msp430_info_to_howto_rela): Likewise.
	* elf32-mt.c (mt_info_to_howto_rela): Likewise.
	* elf32-nds32.c (nds32_info_to_howto_rel): Likewise.
	* elf32-or1k.c (or1k_info_to_howto_rela): Likewise.
	* elf32-rl78.c (rl78_info_to_howto_rela): Likewise.
	* elf32-rx.c (rx_info_to_howto_rela): Likewise.
	* elf32-v850.c (v850_elf_info_to_howto_rel): Likewise.
	* elf32-visium.c (visium_info_to_howto_rela): Likewise.
	* elf32-xgate.c (xgate_info_to_howto_rel): Likewise.
	* elf32-xtensa.c (elf_xtensa_info_to_howto_rela): Likewise.
	* elf64-mmix.c (mmix_info_to_howto_rela): Likewise.
	* elf64-x86-64.c (elf_x86_64_reloc_type_lookup): Likewise.
	* elfnn-aarch64.c (elfNN_aarch64_bfd_reloc_from_type): Likewise.
	* elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Add range
	checking of reloc symbol index.
	* mach-o.c (bfd_mach_o_canonicalize_one_reloc): If no symbols have
	been provided then set the reloc's symbol to undefined.
	* reloc.c (bfd_generic_get_relocated_section_contents): Add range
	checking of the reloc to be applied.
	* versados.c (process_otr): Add more range checks.
	(versados_canonicalize_reloc): If the section is unknown, set the
	symbol to undefined.
	* vms-alpha.c (_bfd_vms_slurp_eisd): Add range checks.
	(alpha_vms_object_p): Likewise.
2014-12-22 20:59:00 +00:00
Cary Coutant e30880c2ee gold/
* powerpc.cc (Target_powerpc::relocate): Fix overflow check.
2014-12-22 10:13:37 -08:00
Doug Evans f953163fe9 cp-namespace.c (cp_lookup_symbol_via_all_imports): New function.
gdb/ChangeLog:

	* cp-namespace.c (cp_lookup_symbol_via_all_imports): New function.
	(cp_lookup_symbol_namespace): Call it.
	(cp_lookup_symbol_nonlocal): Ditto.
2014-12-22 09:29:25 -08:00
Doug Evans 4bd0864e21 cp-namespace.c (cp_lookup_symbol_via_imports): New arg "search_scope_first".
gdb/ChangeLog:

	* cp-namespace.c (cp_lookup_symbol_via_imports): New arg
	"search_scope_first".  All callers updated.
2014-12-22 09:20:50 -08:00
Doug Evans 6f27419a4d cp-namespace.c (cp_lookup_nested_symbol_1): New function.
gdb/ChangeLog:

	* cp-namespace.c (cp_lookup_nested_symbol_1): New function.
	(cp_basic_lookup_symbol): Renamed from lookup_symbol_file.  Delete
	arg "search".  All callers updated.
	(cp_lookup_bare_symbol): New function.
	(cp_search_static_and_baseclasses): New function.
	(cp_lookup_symbol_in_namespace): Rewrite, move more logic here.
	(find_symbol_in_baseclass): Simplify, call cp_lookup_nested_symbol_1.
	(cp_lookup_nested_symbol): Ditto.
2014-12-22 09:11:44 -08:00
Doug Evans d276311738 cp-namespace.c (cp_lookup_symbol_in_namespace): Simplify.
gdb/ChangeLog:

	* cp-namespace.c (cp_lookup_symbol_in_namespace): Simplify.
2014-12-22 08:44:50 -08:00
Doug Evans 791244bea2 cp-namespace.c: Whitespace cleanup.
gdb/ChangeLog:

	* cp-namespace.c: Whitespace cleanup.
2014-12-22 08:42:02 -08:00
GDB Administrator 6232c07d28 Automatic date update in version.in 2014-12-22 00:00:10 +00:00
GDB Administrator 3946f7973c Automatic date update in version.in 2014-12-21 00:00:16 +00:00
Mihail-Marian Nistor 87186c6a5c gdb/17394: cannot put breakpoint only in selected ASM file.
This patch fixes a problem when trying to insert a breakpoint on
a specific symbol defined in a specific file, eg:

    break foo.c:func

This currently works for files in C/C++/Ada, etc, but doesn't always
work for Asm files. Analysis of the problem showed that this related
to a limitation in gas, which does not generate debug info for functions/
symbols.  Thus, we have a symtab for the file ("info sources" shows
the file), but it contains no symbols.

When find_linespec_symbols is called in linespec_parse_basic, it calls
find_function_symbols, which uses add_matching_symbols_to_info to
collect all matching symbols.

That function does [pardon any mangled formatting]:

  for (ix = 0; VEC_iterate (symtab_ptr, info->file_symtabs, ix, elt); ++ix)
    {
      if (elt == NULL)
        {
          iterate_over_all_matching_symtabs (info->state, name, VAR_DOMAIN,
                                             collect_symbols, info,
                                             pspace, 1);
          search_minsyms_for_name (info, name, pspace);
        }
      else if (pspace == NULL || pspace == SYMTAB_PSPACE (elt))
        {
          /* Program spaces that are executing startup should have
             been filtered out earlier.  */
          gdb_assert (!SYMTAB_PSPACE (elt)->executing_startup);
          set_current_program_space (SYMTAB_PSPACE (elt));
          iterate_over_file_blocks (elt, name, VAR_DOMAIN,
                                    collect_symbols, info);
        }
    }

This iterates over the symtabs. In the failing use case, ELT is
non-NULL (points to the symtab for the .s file), so it calls
iterate_over_file_blocks. Herein is where the problem exists: it is
assumed that if NAME exists, it must exist in the given symtab -- a
reasonable assumption for "normal" (non-asm) cases. It never searches
minimal symbols (or in the global default symtab).

This patch fixes the problem by doing so. It is important to note that
iterating over minsyms is fairly expensive, so this patch only adds
that extra search if the language is language_asm and
iterate_over_file_blocks returns no symbols.

gdb/ChangeLog:
2014-12-20  Keith Seitz  <keiths@redhat.com>
            Mihail-Marian Nistor  <mihail.nistor@freescale.com>

        PR gdb/17394
        * linespec.c (struct collect_minsyms): Add new member `symtab'.
        (add_minsym): Handle cases where info.symtab is non-NULL.
        (search_minsyms_for_name): Add new parameter `symtab'.
        Handle limiting searches to a specific symtab.
        (add_matching_symtabs_to_info): Search through minimal symbols
        for language_asm files for which no new symbols are found.

gdb/testsuite/ChangeLog:
2014-12-20  Mihail-Marian Nistor  <mihail.nistor@freescale.com>

        PR gdb/17394
        * gdb.linespec/break-asm-file.c: New file.
        * gdb.linespec/break-asm-file.exp: New file.
        * gdb.linespec/break-asm-file0.s: New file.
        * gdb.linespec/break-asm-file1.s: New file.
2014-12-20 11:32:25 -05:00
H.J. Lu bd040da1db Change SometimesInlineFunction to "return i * i * 3;"
The debug_msg test has 2 implementations of SometimesInlineFunction:

int SometimesInlineFunction(int i) { return i; }
int SometimesInlineFunction(int i) { return i * i; }

and One Definition Rule (ODR) violation detection expects they will be
compiled into functions of different sizes.  Hower, on x86, GCC 4.7 and
newer compile them into functions of the same size and ODR violation
detection test fails.  This patch changes

int SometimesInlineFunction(int i) { return i; }

to

int SometimesInlineFunction(int i) { return i * i * 3; }

so that it will be compiled into a function of larger size.

	PR gold/14608
	* testsuite/debug_msg.cc (SometimesInlineFunction): Changed
	to "return i * i * 3;".
2014-12-20 08:05:45 -08:00
GDB Administrator 13a1997e66 Automatic date update in version.in 2014-12-20 00:00:12 +00:00
Matthew Fortune 0866e94c87 Rework the alignment check for BFD_RELOC_MIPS_18_PCREL_S3.
gas/

	* config/tc-mips.c (md_apply_fix): Apply alignment check
	to the symbol and offset rather than *valP for
	BFD_RELOC_MIPS_18_PCREL_S3.  Also update the error message
	for BFD_RELOC_MIPS_19_PCREL_S2.

gas/testsuite/

	* gas/mips/r6-64.s: Remove .align directives from LDPC
	instructions and add further tests for LDPC.
	* gas/mips/r6-64-n32.d: remove the NOPs from LDPC expected
	output and update for new tests.
	* gas/mips/r6-64-n64.d: Likewise.
	* gas/mips/ldpc-unalign.l: New file.
	* gas/mips/ldpc-unalign.s: Likewise.
	* gas/mips/mips.exp: Run ldpc-unalign test.
2014-12-19 20:24:16 +00:00
Matthew Fortune 13e322759b Fix octeon3 tests for targets with default abi != n32
gas/testsuite/

	* gas/mips/octeon3.d: Switch to use numeric register names.
2014-12-19 14:23:08 +00:00
Matthew Fortune d340a82588 Fix all failing FPXX tests for tx39-elf.
ld/testsuite/

	* ld-mips-elf/attr-gnu-4-00.d: Relax check for ISA extension.
	* ld-mips-elf/attr-gnu-4-01.d: Likewise.
	* ld-mips-elf/attr-gnu-4-02.d: Likewise.
	* ld-mips-elf/attr-gnu-4-03.d: Likewise.
	* ld-mips-elf/attr-gnu-4-08.d: Likewise.
	* ld-mips-elf/attr-gnu-4-10.d: Likewise.
	* ld-mips-elf/attr-gnu-4-11.d: Likewise.
	* ld-mips-elf/attr-gnu-4-18.d: Likewise.
	* ld-mips-elf/attr-gnu-4-20.d: Likewise.
	* ld-mips-elf/attr-gnu-4-22.d: Likewise.
	* ld-mips-elf/attr-gnu-4-28.d: Likewise.
	* ld-mips-elf/attr-gnu-4-30.d: Likewise.
	* ld-mips-elf/attr-gnu-4-33.d: Likewise.
	* ld-mips-elf/attr-gnu-4-38.d: Likewise.
	* ld-mips-elf/attr-gnu-4-44.d: Likewise.
2014-12-19 14:20:17 +00:00
Matthew Fortune 6e8ec71244 Fix undefined weak symbol reloc tests
ld/testsuite/

	* ld-mips-elf/mips-elf.exp: Update undefweak-overflow tests.
	* ld-mips-elf/undefweak-overflow-n32.d: Remove.
	* ld-mips-elf/undefweak-overflow-n64.d: Likewise.
	* ld-mips-elf/undefweak-overflow.s: Set mips64r6, noreorder and
	add a label to mark the micromips region.
	* ld-mips-elf/undefweak-overflow.d: Update expected output.
2014-12-19 14:19:42 +00:00
Yao Qi bb7e3f4d51 MIPS SDE OS ABI support
This patch is to add SDE OS ABI support in GDB, which has been used in
codesourcery gdb tree for some years.

gdb:

2014-12-19  Maciej W. Rozycki  <macro@codesourcery.com>
	    Nigel Stephens  <nigel@mips.com>
	    Chris Dearman  <chris@mips.com>
	    Luis Machado  <lgustavo@codesourcery.com>

	* Makefile.in (ALL_TARGET_OBS): Add mips-sde-tdep.o.
	(ALLDEPFILES): Add mips-sde-tdep.c.
	* mips-sde-tdep.c: New file containg SDE specific code.
	* configure.tgt (mips*-sde*-elf*): Add mips-sde-dep.o to
	gdb_target_obs.
	* defs.h (gdb_osabi): Add GDB_OSABI_SDE.
	* osabi.c (gdb_osabi_names): Add SDE.
	* NEWS: Mention the change.
2014-12-19 13:13:07 +08:00
GDB Administrator ff7609bc46 Automatic date update in version.in 2014-12-19 00:00:12 +00:00