summaryrefslogtreecommitdiff
path: root/binutils/stabs.c
Commit message (Collapse)AuthorAgeFilesLines
* Replace "if (x) free (x)" with "free (x)", binutilsAlan Modra2020-05-211-12/+6
| | | | | | | | | | | | * addr2line.c: Replace "if (x) free (x)" with "free (x)" throughout. * dlltool.c: Likewise. * elfcomm.c: Likewise. * rddbg.c: Likewise. * readelf.c: Likewise. * stabs.c: Likewise. * windmc.c: Likewise. * windres.c: Likewise. * wrstabs.c: Likewise.
* Update year range in copyright notice of binutils filesAlan Modra2020-01-011-1/+1
|
* Remove support for old gnu v2 name mangling.Nick Clifton2019-01-081-19/+7
| | | | | | | | | | | | PR 24044 * cxxfilt.c (hp_symbol_characters): Delete. (main): Remove depcreated demangling styles. * stabs.c (parse_stab_argtypes): Remove support for old gnu v2 demangling opnames. * testsuite/binutils-all/cxxfilt.exp: Use the --no-strip-underscore option for targets that do prefix their symbols with underscores. Update tests to elimiate those that use gnu v2 encoding.
* Revert "Sync libiberty sources with master version in gcc repository. ↵Simon Marchi2019-01-071-7/+19
| | | | | | | | Updated stabs demangling and cxxfilt tests to match." The previous commit breaks the GDB build, which is still using functions cplus_demangle_opname & co. Since removing these usages is not an obvious fix, let's revert this patch until we get rid of them.
* Sync libiberty sources with master version in gcc repository. Updated stabs ↵Nick Clifton2019-01-071-19/+7
| | | | | | | | | | demangling and cxxfilt tests to match. PR 24044 * stabs.c (parse_stab_argtypes): Remove call to cplus_mangle_opcode. * testsuite/binutils-all/cxxfilt.exp: Replace tests of v2 encoding with v3 encoding. Add escape for known failures.
* Update year range in copyright notice of binutils filesAlan Modra2019-01-011-1/+1
|
* Synchronize libiberty with gcc and add --no-recruse-limit option to tools ↵Nick Clifton2018-12-071-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | that support name demangling. This patch addresses the multitude of bug reports about resource exhaustion in libiberty's name demangling code. It adds a limit to the amount of recursion that is allowed, before an error is triggered. It also adds a new demangling option to disable this limit. (The limit is enabled by default). PR 87681 PR 87675 PR 87636 PR 87335 libiberty * cp-demangle.h (struct d_info): Add recursion_limit field. * cp-demangle.c (d_function_type): If the recursion limit is enabled and reached, return with a failure result. (d_demangle_callback): If the recursion limit is enabled, check for a mangled string that is so long that there is not enough stack space for the local arrays. * cplus-dem.c (struct work): Add recursion_level field. (demangle_nested_args): If the recursion limit is enabled and reached, return with a failure result. include * demangle.h (DMGL_RECURSE_LIMIT): Define. (DEMANGLE_RECURSION_LIMIT): Prototype. binutuils * addr2line.c (demangle_flags): New static variable. (long_options): Add --recurse-limit and --no-recurse-limit. (translate_address): Pass demangle_flags to bfd_demangle. (main): Handle --recurse-limit and --no-recurse-limit options. * cxxfilt.c (flags): Add DMGL_RECURSE_LIMIT. (long_options): Add --recurse-limit and --no-recurse-limit. (main): Handle new options. * dlltool.c (gen_def_file): Include DMGL_RECURSE_LIMIT in flags passed to cplus_demangle. * nm.c (demangle_flags): New static variable. (long_options): Add --recurse-limit and --no-recurse-limit. (main): Handle new options. * objdump.c (demangle_flags): New static variable. (usage): Add --recurse-limit and --no-recurse-limit. (long_options): Likewise. (objdump_print_symname): Pass demangle_flags to bfd_demangle. (disassemble_section): Likewise. (dump_dymbols): Likewise. (main): Handle new options. * prdbg.c (demangle_flags): New static variable. (tg_variable): Pass demangle_flags to demangler. (tg_start_function): Likewise. * stabs.c (demangle_flags): New static variable. (stab_demangle_template): Pass demangle_flags to demangler. (stab_demangle_v3_argtypes): Likewise. (stab_demangle_v3_arg): Likewise. * doc/binutuls.texi: Document new command line options. * NEWS: Mention the new feature. * testsuite/config/default.exp (CXXFILT): Define if not already defined. (CXXFILTFLAGS): Likewise. * testsuite/binutils-all/cxxfilt.exp: New file. Runs a few simple tests of the cxxfilt program.
* Prevent a buffer overrun when parsing corrupt STABS debug information.Nick Clifton2018-03-131-1/+3
| | | | | | PR 22957 * stabs.c (pop_binincl): Fail if the file index is off the end of the stack.
* Add range changing to STABS parsing functions, in order to prevent buffer ↵Nick Clifton2018-03-131-144/+260
| | | | | | | | | | | | | | | | | | | | | | | | | | overruns. PR 22955 * stabs.c (parse_number): Add p_end parameter and use it to check the validity of the pp parameter. Add checks to prevent walking off the end of the string buffer. (parse_stab_string): Likewise. (parse_stab_type): Likewise. (parse_stab_type_number): Likewise. (parse_stab_range_type): Likewise. (parse_stab_sun_builtin_type): Likewise. (parse_stab_sun_floating_type): Likewise. (parse_stab_enum_type): Likewise. (parse_stab_struct_type): Likewise. (parse_stab_baseclasses): Likewise. (parse_stab_struct_fields): Likewise. (parse_stab_cpp_abbrev): Likewise. (parse_stab_one_struct_field): Likewise. (parse_stab_members): Likewise. (parse_stab_tilde_field): Likewise. (parse_stab_array_type): Likewise. * parse_stab: Compute the end of the string and then pass it on to individual parser functions.
* Update year range in copyright notice of binutils filesAlan Modra2018-01-031-1/+1
|
* Fix spelling typos.Yuri Chornovian2017-07-181-1/+1
|
* Fix handling of corrupt STABS enum type strings.Nick Clifton2017-02-141-1/+13
| | | | | | | PR binutils/21157 * stabs.c (parse_stab_enum_type): Check for corrupt NAME:VALUE pairs. (parse_number): Exit early if passed an empty string.
* Fix compile time warning about pointer comparison.Nick Clifton2017-01-101-1/+1
| | | | | | PR 21034 * stabs.c (parse_stab_members): Fix thinko checking for g++ version 1 stabs information.
* Update year range in copyright notice of all files.Alan Modra2017-01-021-1/+1
|
* Fix spelling in comments in C source files (binutils)Ambrogino Modigliani2016-11-271-1/+1
| | | | | | | | | | * dwarf.c: Fix spelling in comments. * dwarf.h: Fix spelling in comments. * objcopy.c: Fix spelling in comments. * od-macho.c: Fix spelling in comments. * rclex.c: Fix spelling in comments. * readelf.c: Fix spelling in comments. * stabs.c: Fix spelling in comments.
* -Wimplicit-fallthrough error fixesAlan Modra2016-10-061-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Well, not all are errors, but a little more substantive than just fiddling with comments. bfd/ * coffcode.h (coff_slurp_symbol_table): Revert accidental commit made 2015-01-08. * elf32-nds32.c (nds32_elf_grok_psinfo): Add missing break. * reloc.c (bfd_default_reloc_type_lookup): Add missing breaks. opcodes/ * arc-ext.c (create_map): Add missing break. * msp430-decode.opc (encode_as): Likewise. * msp430-decode.c: Regenerate. binutils/ * coffdump.c (dump_coff_where): Add missing break. * stabs.c (stab_xcoff_builtin_type): Likewise. gas/ * config/tc-arc.c (find_opcode_match): Add missing break. * config/tc-i960.c (get_cdisp): Likewise. * config/tc-metag.c (parse_swap, md_apply_fix): Likewise. * config/tc-mt.c (md_parse_option): Likewise. * config/tc-nds32.c (nds32_apply_fix): Likewise. * config/tc-hppa.c (pa_ip): Assert rather than testing last condition of multiple if statements. * config/tc-s390.c (s390_exp_compare): Return 0 on error. * config/tc-tic4x.c (tic4x_operand_parse): Add as_bad and break out of case rather than falling into next case. Formatting. ld/ * plugin.c (asymbol_from_plugin_symbol): Avoid compiler warning by adding return.
* Copyright update for binutilsAlan Modra2016-01-011-1/+1
|
* Remove trailing spaces in binutilsH.J. Lu2015-08-121-1/+1
|
* Use 0xffffffffffffffffLL to silence GCC 6 warningH.J. Lu2015-07-241-1/+1
| | | | | | | | | | | GCC 6 warns: error: result of ‘4294967295ll << 32’ requires 65 bits to represent, but ‘long long int’ only has 64 bits [-Werror=shift-overflow=] on ((((bfd_signed_vma) 0xffffffff) << 32) | 0xffffffff). This patch replaces it with bfd_signed_vma) 0xffffffffffffffffLL. * stabs.c (parse_stab_range_type): Use 0xffffffffffffffffLL.
* ChangeLog rotatation and copyright year updateAlan Modra2015-01-021-1/+1
|
* Fix more memory faults uncovered by fuzzing various executables.Nick Clifton2014-11-121-12/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PR binutils/17512 * dwarf.c (read_and_display_attr_value): Check that we do not read past end. (display_debug_pubnames_worker): Add range checks. (process_debug_info): Check for invalid pointer sizes. (display_loc_list): Likewise. (display_loc_list_dwo): Likewise. (display_debug_ranges): Likewise. (display_debug_aranges): Check for invalid address size. (read_cie): Add range checks. Replace call strchr with while loop. * objdump.c (dump_dwarf): Replace abort with a warning message. (print_section_stabs): Improve range checks. * rdcoff.c (coff_get_slot): Use long for indx parameter type. Add check for an excesively large index. * rddbg.c (read_section_stabs_debugging_info): Zero terminate the string table. Avoid walking off the end of the stabs data. * stabs.c (parse_stab_string): Add check for a NULL name. PR binutils/17512 * coffcode.h (coff_slurp_line_table): Set the line number of corrupt entries to -1. (coff_slurp_symbol_table): Alway initialise the value of the symbol. * coffgen.c (coff_print_symbol): Check that the combined pointer is valid. (coff_print_symbol): Do not print negative line numbers. * peXXigen.c (pe_print_idata): Add range checking displaying member names.
* Update copyright yearsAlan Modra2014-03-051-2/+1
|
* PR binutils/15018Alan Modra2013-01-151-6/+3
| | | | | | * stabs.c (parse_stab_members): Always set physname here to avoid gcc warning.. (parse_stab_argtypes): ..and don't duplicate the init here.
* PR binutils/13925Nick Clifton2012-03-301-0/+5
| | | | | * stabs.c (stab_demangle_v3_arglist): Cope with the demangler returning an empty context for a function with no arguments.
* * stabs.c (parse_stab_enum_type): Fix memory leaks.Nick Clifton2011-03-251-19/+50
| | | | | | | | (parse_stab_struct_type): Ditto. (parse_stab_struct_fields): Ditto. (parse_stab_one_struct_field): Ditto. (parse_stab_members): Ditto. (stab_demangle_qualified): Ditto.
* bfd/ChangeLogNick Clifton2010-04-091-22/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2010-04-09 Nick Clifton <nickc@redhat.com> * aoutx.h (aout_link_input_bfd): Remove unused variable sym_count. * elf-eh-frame.c (_bfd_elf_eh_frame_section_offset): Remove unused variables htab and hdr_info and mark info parameter as unused. * elf.c (prep_headers): Remove unused variable i_phdrp. (_bfd_elf_write_object_contents): Remove unused variable i_ehdrp. * elf32-i386.c (elf_i386_relocate_section): Mark variabled warned as unused. * peXXigen.c (pe_print_reloc): Remove unused variable datasize. * verilog.c (verilog_write_section): Remove unused variable address. binutils/ChangeLog 2010-04-09 Nick Clifton <nickc@redhat.com> * dwarf.c (process_debug_info): Remove unused variable cu_abbrev_offset_ptr. (display_debug_lines_decoded): Remove unused variable prev_line. * elfedit.c (process_archive): Remove unused variable file_name_size. * ieee.c (ieee_start_compilation_unit): Remove unused variable nindx. (ieee_set_type): Remove unused variables info, targetindx and baseindx. * objdump.c (disassmble_byte): Remove unused variable done_dot. * rddbg.c (read_section_stabs_debugging_info): Remove unused variable other. * readelf.c (dump_section_as_strings): Remove unused variable addr. (process_archive): Remove unused variable file_name_size. * stabs.c (parse_stab_string): Mark desc parameter as unused. Remove unused variable lineno. (parse_stab_struct_type): Remove unused variable orig. (stab_demangle_type): Remove unused variables constp, volatilep and hold. gas/ChangeLog 2010-04-09 Nick Clifton <nickc@redhat.com> * as.c (create_obj_attrs_section): Remove unused variable addr. * listing.c (listing_listing): Remove unused variable message. * read.c: Remove unnecessary register type qualifiers. (s_mri): Only define/use old_flag variable if MRI_MODE_CHANGE is defined. ld/ChangeLog 2010-04-09 Nick Clifton <nickc@redhat.com> * ldlang.c (wild_sort): Remove unused variable section_name. opcodes/ChangeLog 2010-04-09 Nick Clifton <nickc@redhat.com> * i386-dis.c (print_insn): Remove unused variable op. (OP_sI): Remove unused variable mask.
* Add -Wshadow to the gcc command line options used when compiling the binutils.Nick Clifton2009-12-111-7/+7
| | | | Fix up all warnings generated by the addition of this switch.
* Updated soruces in binutils/* to compile cleanly with -Wc++-compat.Nick Clifton2009-09-101-21/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * binutils/addr2line.c (slurp_symtab): Fix casts. Introduce variable minisyms to avoid aliasing varning. * binutils/ar.c: Add casts. (normalize): Use name del instead of delete. (display_target_list,display_info_table): Change loop counter variable a to int. * binutils/bucomm.c: Add casts. * binutils/debug.c: Update function to use new names. (struct debug_baseclass): Rename member from virtual to is_virtual. (struct debug_type_s,struct debug_field_s,struct debug_baseclass_s,struct debug_method_s,struct debug_method_variant_s,struct debug_type_s): Rename struct from avoid name collision. * /binutils/debug.h: Use new struct names. * binutils/dwarf.c: Add casts. (free_debug_memory): Change loop counter variable a to int. * binutils/ieee.c: Add casts. (enum ieee_var_kind): Move to top level. (ieee_class_baseclass): Rename parameter virtual to is_virtual. (ieee_class_method_var): Rename variable virtual to is_virtual. * binutils/nm.c: Add casts. * binutils/objcopy.c: Add casts. (copy_archive): Rename variable delete to del. * binutils/objdump.c: Add casts. (dump_dwarf_section): Change loop counter variable i to int. * binutils/prdbg.c: Add casts. (pr_class_baseclass,tg_class_baseclass): Rename parameters virtual to is_virtual. * binutils/readelf.c: Add casts. (struct ia64_unw_table_entry,struct hppa_unw_table_entry): Move to top level. * binutils/size.c: Add casts. * binutils/stabs.c (parse_stab_type, parse_stab_range_type) (parse_stab_cpp_abbrev): Rename parameter from typename to type_name. (parse_stab_baseclasses): Rename variable virtual to is_virtual. * binutils/strings.c: Add casts. * binutils/wrstabs.c (stab_class_baseclass): Rename parameter virtual to is_virtual.
* update copyright datesAlan Modra2009-09-021-1/+1
|
* PR 6934Nick Clifton2008-10-021-0/+20
| | | | | * stabs.c (parse_stab_string): Parse and ignore =Y<name> strings generated by the SUNPro C++ compiler.
* PR 6922Nick Clifton2008-09-301-6/+8
| | | | | * stabs.c (parse_stab_sun_builtin_type): Parse, but ignore SUN's 'b' and 'v' extensions.
* Change sources over to using GPLv3Nick Clifton2007-07-051-1/+1
|
* bfd/Alan Modra2007-04-261-5/+3
| | | | | | | | | | | | | | | | | | | | Many files: Include sysdep.h before bfd.h. * Makefile.am: Run "make dep-am". * Makefile.in: Regenerate. binutils/ * bucumm.h: Split off host dependencies to.. * sysdep.h: ..here. Many files: Include sysdep.h. Remove duplicate headers and reorder. * Makefile.am: Run "make dep-am". * Makefile.in: Regenerate. ld/ Many files: Include sysdep.h first. Remove duplicate headers. * Makefile.am: Run "make dep-am". * Makefile.in: Regenerate. opcodes/ * Makefile.am: Run "make dep-am". * Makefile.in: Regenerate. * ns32k-dis.c: Include sysdep.h first.
* * bfd-in.h (STRING_AND_COMMA): New macro. Takes one constant string as itsNick Clifton2006-09-161-7/+7
| | | | | | | | | | | argument and emits the string followed by a comma and then the length of the string. (CONST_STRNEQ): New macro. Checks to see if a variable string has a constant string as its initial characters. (CONST_STRNCPY): New macro. Copies a constant string to the start of a variable string. * bfd-in2.h: Regenerate. * <remainign files>: Make use of the new macros.
* Update FSF addressNick Clifton2005-05-081-2/+2
|
* PR binutils/536Ian Lance Taylor2004-11-101-1/+2
| | | | | | * stabs.c (stab_demangle_template): Call stab_demangle_count rather than stab_demangle_get_count to get the length of a pointer target.
* * stabs.c (stab_demangle_v3_arglist): New static function, brokenIan Lance Taylor2004-10-251-9/+58
| | | | | | | out of stab_demangle_v3_argtypes. (stab_demangle_v3_argtypes): Call it. (stab_demangle_v3_arg): Handle DEMANGLE_COMPONENT_FUNCTION_TYPE. If we find an unrecognized component, print out its number.
* Update copyright year.Ian Lance Taylor2004-01-121-1/+1
|
* * stabs.c (parse_stab_argtypes): Handle g++ ABI version 3 names.Ian Lance Taylor2004-01-121-1/+303
| | | | | | (stab_demangle_argtypes): Likewise. (stab_demangle_v3_argtypes): New static function. (stab_demangle_v3_arg): New static function.
* * ChangeLog-9197: Fix comment typos.Kazu Hirata2003-12-061-1/+1
| | | | | | | | | | * coffgrok.c: Likewise. * filemode.c: Likewise. * objcopy.c: Likewise. * objdump.c: Likewise. * prdbg.c: Likewise. * stabs.c: Likewise. * unwind-ia64.c: Likewise.
* Fix 'the the' typoNick Clifton2003-11-061-1/+1
|
* * addr2line.c: Convert to ISO C90 prototypes, change PTR, removeAndreas Jaeger2003-09-141-309/+152
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | unneeded (void *) casts. * ar.c: Likewise. * arlex.l: Likewise. * arparse.y: Likewise. * arsup.c: Likewise. * binemul.c: Likewise. * binemul.h: Likewise. * bucomm.c: Likewise. * bucomm.h: Likewise. * budbg.h: Likewise. * budemang.c: Likewise. * budemang.h: Likewise. * coffdump.c: Likewise. * coffgrok.c: Likewise. * cxxfilt.c: Likewise. * debug.c: Likewise. * debug.h: Likewise. * deflex.l: Likewise. * dlltool.c: Likewise. * dlltool.h: Likewise. * dllwrap.c: Likewise. * emul_aix.c: Likewise. * filemode.c: Likewise. * ieee.c: Likewise. * nlmconv.c: Likewise. * nlmconv.h: Likewise. * nlmheader.y: Likewise. * nm.c: Likewise. * prdbg.c: Likewise. * rclex.l: Likewise. * rcparse.y: Likewise. * rdcoff.c: Likewise. * rddbg.c: Likewise. * rename.c: Likewise. * resbin.c: Likewise. * rescoff.c: Likewise. * resrc.c: Likewise. * size.c: Likewise. * srconv.c: Likewise. * stabs.c: Likewise. * strings.c: Likewise. * sysdump.c: Likewise. * sysinfo.y: Likewise. * syslex.l: Likewise. * unwind-ia64.c: Likewise. * unwind-ia64.h: Likewise. * version.c: Likewise. * windres.c: Likewise. * windres.h: Likewise. * winduni.c: Likewise. * wrstabs.c: Likewise.
* Remove redundant defintions of BYTES_IN_WORD and add conditional defintion inNick Clifton2003-03-061-23/+8
| | | | aout64.h.
* For N_SLINE only include function_start_offset if the symbol is within aNick Clifton2003-02-131-5/+7
| | | | function; otherwise, the value is absolute.
* s/boolean/bfd_boolean/ s/true/TRUE/ s/false/FALSE/. SimplifyAlan Modra2002-11-301-465/+476
| | | | comparisons of bfd_boolean vars with TRUE/FALSE. Formatting.
* Cope with demangling function names that include a double underscore.Nick Clifton2002-08-161-23/+30
|
* * arsup.c: Remove ARGSUSED.Kazu Hirata2002-05-261-1/+0
| | | | | | | | | * debug.c: Likewise. * ieee.c: Likewise. * nlmconv.c: Likewise. * prdbg.c: Likewise. * stabs.c: Likewise. * wrstabs.c: Likewise.
* * size.c: Fix formatting.Kazu Hirata2002-05-241-29/+29
| | | | | | | | * srconv.c: Likewise. * stabs.c: Likewise. * sysdump.c: Likewise. * unwind-ia64.c: Likewise. * wrstabs.c: Likewise.
* Locale changes from Bruno Haible <haible@clisp.cons.org>.H.J. Lu2001-09-191-25/+25
|
* 2001-08-29 Ben Elliston <bje@redhat.com>Ben Elliston2001-08-291-1/+1
| | | | * stabs.c (stab_demangle_template): Initialise s4.