Work around GCC bug 63748

A recent change to eval.c triggered a GCC bug that causes a false positive
"may be used uninitialized" warning in evaluate_subexp_standard.  This seems
to be triggered by a specific CFG constructed via setjmp and gotos.

While the GCC bug is in the process of being fixed, there are released
compiler versions (in particular GCC 4.9) in the field that show this
problem.  In order to allow compiling GDB with one of those compilers,
this commit slightly reworks the CFG (in an equivalent way) of the
affected function, so that the GCC bug is no longer triggered.

gdb/ChangeLog:

	* eval.c (evaluate_subexp_standard): Work around GCC bug 63748.
More fixes for problems exposed by valgrind and the address sanitizer
when displaying the contents of corrupt files.

	PR binutils/17521
	* coff-i386.c (NUM_HOWTOS): New define.
	(RTYPE2HOWTO): Use it.
	(coff_i386_rtype_to_howto): Likewise.
	(coff_i386_reloc_name_lookup): Likewise.
	(CALC_ADDEND): Check that reloc r_type field is valid.
	* coff-x86_64.c (NUM_HOWTOS): New define.
	(RTYPE2HOWTO): Use it.
	(coff_amd64_rtype_to_howto): Likewise.
	(coff_amd64_reloc_name_lookup): Likewise.
	(CALC_ADDEND): Check that reloc r_type field is valid.
	* coffcode.h (coff_slurp_line_table): Check for symbol table
	indexing underflow.
	(coff_slurp_symbol_table): Use zalloc to ensure that all table
	entries are initialised.
	* coffgen.c (_bfd_coff_read_string_table): Initialise unused bits
	in the string table.  Also ensure that the table is 0 terminated.
	(coff_get_normalized_symtab): Check for symbol table indexing
	underflow.
	* opncls.c (bfd_alloc): Catch the case where a small negative size
	can result in only 1 byte being allocated.
	(bfd_alloc2): Use bfd_alloc.
	* pe-mips.c (NUM_HOWTOS): New define.
	(coff_mips_reloc_name_lookup): Use it.
	(CALC_ADDEND): Check that reloc r_type field is valid.
	* peXXigen.c (_bfd_XXi_swap_aouthdr_in): Initialise unused entries
	in the DataDirectory.
	(pe_print_idata): Avoid reading beyond the end of the data block
	wen printing strings.
	(pe_print_edata): Likewise.
	Check for table indexing underflow.
	* peicode.h (pe_mkobject): Initialise the pe_opthdr field.
	(pe_bfd_object_p): Allocate and initialize enough space to hold a
	PEAOUTHDR, even if the opt_hdr field specified less.
Fix objcopy and strip so that they remove their temporary files even if an error occurs.

	PR binutils/17552
	* (copy_archive): Clean up temporary files even if an error
	occurs.
More fixes for assertion failures and out-of-bounds reads by readelf.

	PR binutils/17531
	* (ia64_process_unwind): Replace assertion with an error message.
	Add range checking for group section indicies.
	(hppa_process_unwind): Replace assertion with an error message.
	(process_syminfo): Likewise.
	(decode_arm_unwind_bytecode): Add range checking.
	(dump_section_as_strings): Add more string range checking.
	(display_tag_value): Likewise.
	(display_arm_attribute): Likewise.
	(display_gnu_attribute): Likewise.
	(display_tic6x_attribute): Likewise.
	(display_msp430x_attribute): Likewise.
bfd/
2014-11-10  James Cowgill  <James.Cowgill@imgtec.com>

	* elfxx-mips.c (_bfd_mips_elf_section_processing): don't force small
	data sections to be PROGBITS
daily update
PR 17564: Fix objfile search order for static symbols.

When searching static symbols, gdb would search over all
expanded symtabs of all objfiles, and if that fails only then
would it search all partial/gdb_index tables of all objfiles.
This means that the user could get a random instance of the
symbol depending on what symtabs have been previously expanded.
Now the search is consistent, searching each objfile completely
before proceeding to the next one.

gdb/ChangeLog:

	PR symtab/17564
	* symtab.c (lookup_symbol_in_all_objfiles): Delete.
	(lookup_static_symbol): Move definition to new location and rewrite.
	(lookup_symbol_in_objfile): New function.
	(lookup_symbol_global_iterator_cb): Call it.

gdb/testsuite/ChangeLog:

	PR symtab/17564
	* gdb.base/symtab-search-order.exp: New file.
	* gdb.base/symtab-search-order.c: New file.
	* gdb.base/symtab-search-order-1.c: New file.
	* gdb.base/symtab-search-order-shlib-1.c: New file.
source.c (select_source_symtab): Rewrite to use ALL_SYMTABS.

gdb/ChangeLog:

	* source.c (select_source_symtab): Rewrite to use ALL_SYMTABS.
symmisc.c: Remove trailing whitespace.

gdb/ChangeLog:

	* symmisc.c (print_objfile_statistics): Remove trailing whitespace.
	(maintenance_info_symtabs, maintenance_check_symtabs): Ditto.