Cary Coutant [Mon, 9 Feb 2015 23:58:57 +0000 (15:58 -0800)]
Improve ODR checking.
2015-02-09 Cary Coutant <ccoutant@google.com>
gold/
* dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Fix debug
output to print correct context.
(Sized_dwarf_line_info::do_addr2line): Add debug output. Return
up to 4 more locations at the beginning of the function.
* symtab.cc (Symbol_table::detect_odr_violations): Get canonical
result before sorting list of line numbers.
Cary Coutant [Fri, 30 Jan 2015 12:22:19 +0000 (04:22 -0800)]
Add gold support for two-level line tables.
2015-01-30 Cary Coutant <ccoutant@google.com>
elfcpp/
* dwarf.h (enum DW_LNS): Add experimental two-level line table opcodes.
(enum DW_LNCT): New enum for DWARF-5.
gold/
* debug.h (DEBUG_LOCATION): New constant.
(debug_string_to_enum): Add DEBUG_LOCATION.
* dwarf_reader.cc (struct LineStateMachine): Add context field.
(ResetLineStateMachine): Likewise.
(Sized_dwarf_line_info::Sized_dwarf_line_info): Add support for
two-level line tables.
(Sized_dwarf_line_info::read_header_prolog): Likewise. Also add
support for DWARF-3+ line tables.
(Sized_dwarf_line_info::read_header_tables_v5): New method.
(Sized_dwarf_line_info::process_one_opcode): Add support for two-level
line tables.
(Sized_dwarf_line_info::read_lines): Likewise.
(Sized_dwarf_line_info::read_line_mappings): Likewise.
(Sized_dwarf_line_info::do_addr2line): Add debug output.
* dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
Delete str_buffer_start_.
(DWARF5_EXPERIMENTAL_LINE_TABLE): New constant.
(Sized_dwarf_line_info::read_header_tables_v5): New method.
(Sized_dwarf_line_info::read_lines): Update prototype.
(Sized_dwarf_line_info::process_one_opcode): Likewise.
(Sized_dwarf_line_info::max_ops_per_insn): New data member.
(Sized_dwarf_line_info::str_buffer_): New data member.
(Sized_dwarf_line_info::str_buffer_end_): New data member.
(Sized_dwarf_line_info::str_buffer_start_): New data member.
(Sized_dwarf_line_info::end_of_header_length_): New data member.
(Sized_dwarf_line_info::logicals_start_): New data member.
(Sized_dwarf_line_info::actuals_start_): New data member.
(Sized_dwarf_line_info::end_of_unit_): New data member.
Cary Coutant [Thu, 29 Jan 2015 06:01:38 +0000 (22:01 -0800)]
Reformat experimental header for compatibility with old DWARF consumers.
Old consumers will now see a DWARF-4 header, with new fields added at the
end of the header. The new fields and the entire logicals and actuals
tables are wrapped in a single extended opcode so that old consumers
will see just the single opcode.
2015-01-28 Cary Coutant <ccoutant@google.com>
gas/
* dwarf2dbg.c (line_base): New variable.
(line_range): New variable.
(DWARF2_EXPERIMENTAL_LINE_OPCODE_BASE): Rename.
(DWARF2_LINE_BASE): Restore to original value.
(DWARF2_LINE_RANGE): Likewise.
(DWARF5_EXPERIMENTAL_LINE_BASE): New macro.
(DWARF5_EXPERIMENTAL_LINE_RANGE): New macro.
(SPECIAL_LINE): Use line_base, line_range.
(size_inc_line_addr): Likewise.
(emit_inc_line_addr): Likewise.
(out_debug_line): Reformat header for compatibility with old DWARF
consumers.
Cary Coutant [Fri, 23 Jan 2015 21:14:41 +0000 (13:14 -0800)]
Update DW_LNS_opcodes for two-level line tables.
2015-01-23 Cary Coutant <ccoutant@google.com>
binutils/
* dwarf.c (append_logical): Fix format string.
(display_line_program): Replace DW_LNS_set_context with
DW_LNS_inlined_call. Fix format strings.
Cary Coutant [Fri, 23 Jan 2015 21:12:29 +0000 (13:12 -0800)]
Update DW_LNS opcodes for two-level line tables.
2015-01-23 Cary Coutant <ccoutant@google.com>
gas/
* dwarf2dbg.c (emit_logicals): Increase max number of
DW_LNS_pop_context opcodes. Change DW_LNS_set_context
to DW_LNS_inlined_call.
(out_debug_line): Adjust operand lengths array.
Cary Coutant [Thu, 15 Jan 2015 21:51:18 +0000 (13:51 -0800)]
Fix bugs displaying DW_LNS_set_context and DW_LNS_pop_context.
2015-01-15 Cary Coutant <ccoutant@google.com>
binutils/
* dwarf.c (append_logical): Print summary for each logical row.
(display_line_program): Remove incorrect consumption of an LEB128
when reading DW_LNS_set_context and DW_LNS_pop_context.
binutils/
* dwarf.c (struct State_Machine_Registers): Add discriminator,
context, and subprogram.
(reset_state_machine): Likewise.
(logicals_table, logicals_allocated, logicals_count): New variables.
(free_logicals): New function.
(append_logical): New function.
(process_extended_line_op): Add is_logical parameter.
(fetch_indirect_line_string): New function.
(DWARF2_LINE_EXPERIMENTAL_VERSION): New macro.
(read_debug_line_header): Add pinitial_length_size, poffset_size
parameters. Update all callers. Check for new line table versions.
(display_directory_table_v4): New function, factored out from
display_debug_lines_raw.
(display_file_name_table_v4): Likewise.
(display_dir_file_table_v5): New function.
(display_line_program): New function, factored out from
display_debug_lines_raw.
(display_debug_lines_raw): Support new line table versions.
(display_debug_lines_decoded): Add missing newline to warning.
(display_debug_lines): Load .debug_line_str section.
(debug_displays): Add .debug_line_str section.
* dwarf.h (DWARF2_Internal_LineInfo): Add li_actuals_table_offset field.
(dwarf_section_display_enum): Add line_str.
* readelf.c (process_section_headers): Add .debug_line_str.
Cary Coutant [Wed, 7 Jan 2015 00:40:43 +0000 (16:40 -0800)]
Update support for DWARF-5 and experimental two-level line number tables.
2015-01-06 Cary Coutant <ccoutant@google.com>
gas/
* dwarf2dbg.c (emit_logicals): Replace DW_LNS_inlined_call with
DW_LNS_set_context and DW_LNS_set_subprogram.
Fix bug where we emit wrong value for line number.
(process_entries): Don't emit DW_LNS_negate_stmt in actuals table.
(out_dwarf5_file_list): Fix bug where dir list or file list is empty.
(out_debug_line): Update table of opcode lengths.
Cary Coutant [Tue, 23 Dec 2014 23:01:40 +0000 (15:01 -0800)]
Add support for DWARF-5 and experimental two-level line number tables.
2014-12-23 Cary Coutant <ccoutant@google.com>
gas/
* config/obj-elf.c (elf_pseudo_table): Add .lloc and .subprog
directives.
* dwarf2dbg.h (struct dwarf2_line_info): Add logical field.
(dwarf2_directive_subprog): New function.
(dwarf2_directive_loc): Add is_lloc parameter.
* dwarf2dbg.c: Include "hash.h".
(DWARF2_LINE_EXPERIMENTAL_VERSION): New macro.
(DWARF2_EXPERIMENTAL_LINE_OPCODE_BASE): New macro.
(opcode_base): New static variable.
(DWARF2_LINE_BASE, DWARF2_LINE_RANGE): Adjust parameters.
(DWARF2_LINE_MAX_OPS_PER_INSN): New macro.
(SPECIAL_LINE, SPECIAL_ADDR): Use opcode_base.
(struct subprog_entry): New struct.
(subprogs, subprogs_in_use, subprogs_allocated): New variables.
(struct logicals_entry): New struct.
(logicals, logicals_in_use, logicals_allocated, logicals_with_labels):
New variables.
(struct string_table): New struct.
(debug_line_str_table): New variable.
(current): Add logical field.
(dwarf2_gen_line_info): Fill in symbol and segment for recent logicals.
(dwarf2_where): Add logical field.
(make_subprog_entry): New function.
(make_logical): New function.
(dwarf2_directive_subprog): New function.
(dwarf2_directive_loc): Add is_lloc parameter; add support for .lloc
directive.
(out_set_addr_from_logical): New function.
(size_inc_line_addr): Fix signed/unsigned warnings. Use opcode_base.
(emit_inc_line_addr): Likewise.
(emit_logicals): New function.
(process_entries): Add support for two-level line tables.
(add_to_string_table): New function.
(out_string_table): New function.
(out_dwarf5_file_list): New function.
(out_subprog_list): New function.
(out_debug_line): Add support for DWARF-5 line tables and for
experimental two-level line number tables.
(dwarf2_finish): Likewise.
Joel Brobecker [Tue, 30 Dec 2014 07:36:53 +0000 (11:36 +0400)]
Remove "add-shared-symbol-files", "dll-symbols" and "assf" commands doc.
This patch removes documentation from some commands whose support has
been recently removed.
gdb/ChangeLog:
* NEWS: Document removal of "dll-symbols", "add-shared-symbol-files"
and "assf" commands.
gdb/doc/ChangeLog:
* gdb.texinfo (Files): Remove documentation of the
"add-shared-symbol-files" and "assf" commands.
(Cygwin Native): Remove documentation of the "dll-symbols"
command.
H.J. Lu [Wed, 31 Dec 2014 03:09:11 +0000 (19:09 -0800)]
Assign file position for .strtab only if needed
bfd/
PR ld/17773
* elflink.c (bfd_elf_final_link): Assign the file position for
the symbol string table only there are symbols to be emitted.
ld/testsuite/
PR ld/17773
* ld-elf/binutils.exp (binutils_test): Add an optional
readelf_options. Replace -l with $readelf_options. Add a
gap test.
* ld/testsuite/ld-elf/gap.s: New file.
Eli Zaretskii [Tue, 30 Dec 2014 19:14:25 +0000 (21:14 +0200)]
Fix executable indicator in file name completion on Windows.
* complete.c (stat_char) [_WIN32]: Don't use 'access' and X_OK on
Windows, they don't work. Instead, look at the file-name
extension to determine whether the file is executable.
input_interrupt is currently emiting non-printable characters, which
is confusing the dg-extract-results.sh script. This is obviously not
a good thing, and, by following Pedro's advices here:
I adapted the function to print "client connection closed" when it
receives a NUL character, or use the "isprint" function to decide how
to print the received char. I tested it by running the testcases that
were printing the non-printable chars before:
and confirming that they print the right message. I tried a bit to
come up with a testcase for this, but failed, and since I did not want
to spend too much time on it, I'm sending the patch anyway.
* remote-utils.c: Include ctype.h.
(input_interrupt): Explicitly handle the case when the char
received is the NUL byte. Improve the printing of non-ASCII
characters.
Alan Modra [Fri, 26 Dec 2014 07:56:38 +0000 (18:26 +1030)]
Delete unnecessary code copying SHF_SH5_ISA32 flag
Since 2006, commit d270463e9, _bfd_elf_copy_private_section_data has
copied over SHF_MASKOS and SHF_MASKPROC flags. That makes the buggy
code in sh_elf64_copy_private_data_internal redundant.
bfd/
PR 17755
* elf64-sh64.c (sh_elf64_copy_private_data_internal): Delete code
copying SHF_SH5_ISA32.
binutils/testsuite/
* binutils-all/strip-11.d: New test.
* binutils-all/objcopy.exp: Run it.
elfcpp/
* arm.h: Add enums for Tag_ABI_FP_number_model and Tag_ABI_VFP_args.
gold/
* arm.cc (Target_arm::do_adjust_elf_header): Provide namespace on
new enums.
(Target_arm::merge_object_attributes, ): Likewise.
Terry Guo [Thu, 25 Dec 2014 01:50:48 +0000 (09:50 +0800)]
ARM: Add support for value 3 of Tag_ABI_VFP_args attribute
*** bfd/ChangeLog ***
2014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com>
* elf32-arm.c (elf32_arm_merge_eabi_attributes): Handle new
Tag_ABI_VFP_args value and replace hardcoded values by enum
values.
(elf32_arm_post_process_headers): Set e_flags in ELF header
as hard float only when Tag_ABI_VFP_args is 1, using new enum
value AEABI_VFP_args_vfp to check that.
*** binutils/ChangeLog ***
2014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com>
2014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com>
* arm-tdep.c (arm_gdbarch_init): Explicitely handle value 3 of
Tag_ABI_VFP_args. Also replace hardcoded values by enum values
in the switch handling the different values of Tag_ABI_VFP_args.
*** gold/ChangeLog ***
2014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com>
* arm.cc (Target_arm::do_adjust_elf_header): Set e_flags in ELF
header as hard float only when Tag_ABI_VFP_args is 1, using new
enum value AEABI_VFP_args_vfp to check that.
(Target_arm::merge_object_attributes): Handle new Tag_ABI_VFP_args
value and replace hardcoded values by enum values.
*** include/elf/ChangeLog ***
2014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com>
* arm.h: New AEABI_FP_number_model_* and AEABI_VFP_args_* enum
values.
*** ld/testsuite/ChangeLog ***
2014-12-25 Thomas Preud'homme <thomas.preudhomme@arm.com>
Andrew Burgess [Mon, 27 Oct 2014 10:51:17 +0000 (10:51 +0000)]
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.
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.
Alan Modra [Wed, 24 Dec 2014 11:37:42 +0000 (22:07 +1030)]
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.
Pierre Muller [Wed, 24 Dec 2014 10:06:57 +0000 (10:06 +0000)]
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.
Doug Evans [Tue, 23 Dec 2014 15:55:39 +0000 (07:55 -0800)]
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.
Andrew Burgess [Sat, 22 Nov 2014 23:25:17 +0000 (23:25 +0000)]
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.
Andrew Burgess [Sat, 22 Nov 2014 23:19:31 +0000 (23:19 +0000)]
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.
Alan Modra [Mon, 22 Dec 2014 00:41:50 +0000 (11:11 +1030)]
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.
Alan Modra [Tue, 23 Dec 2014 08:37:23 +0000 (19:07 +1030)]
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.
Alan Modra [Mon, 22 Dec 2014 04:13:49 +0000 (14:43 +1030)]
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.
Alan Modra [Mon, 22 Dec 2014 00:15:13 +0000 (10:45 +1030)]
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.
Nick Clifton [Mon, 22 Dec 2014 22:44:34 +0000 (22:44 +0000)]
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.