Commit Graph

60 Commits

Author SHA1 Message Date
Alan Modra 827041555a Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
Alan Modra b4b594e304 Remove netware support
include/
	* nlm/ChangeLog-9315: Delete.
	* nlm/alpha-ext.h: Delete.
	* nlm/common.h: Delete.
	* nlm/external.h: Delete.
	* nlm/i386-ext.h: Delete.
	* nlm/internal.h: Delete.
	* nlm/ppc-ext.h: Delete.
	* nlm/sparc32-ext.h: Delete.
bfd/
	* Makefile.am: Remove netware support.
	* bfd-in.h: Likewise.
	* bfd.c: Likewise.
	* config.bfd: Likewise.
	* configure.ac: Likewise.
	* doc/bfdint.texi: Likewise.
	* ecoff.c: Likewise.
	* targets.c: Likewise.
	* libnlm.h: Delete.
	* nlm-target.h: Delete.
	* nlm.c: Delete.
	* nlm32-alpha.c: Delete.
	* nlm32-i386.c: Delete.
	* nlm32-ppc.c: Delete.
	* nlm32-sparc.c: Delete.
	* nlm32.c: Delete.
	* nlm64.c: Delete.
	* nlmcode.h: Delete.
	* nlmswap.h: Delete.
	* Makefile.in: Regenerate.
	* bfd-in2.h: Regenerate.
	* configure: Regenerate.
	* po/SRC-POTFILES.in: Regenerate.
binutils/
	* .gitignore: Remove netware support.
	* Makefile.am: Likewise.
	* configure.ac: Likewise.
	* doc/Makefile.am: Likewise.
	* doc/binutils.texi: Likewise.
	* testsuite/binutils-all/nm.exp: Likewise.
	* nlmconv.c: Delete.
	* nlmconv.h: Delete.
	* nlmheader.y: Delete.
	* Makefile.in: Regenerate.
	* configure: Regenerate.
	* doc/Makefile.in: Regenerate.
	* po/POTFILES.in: Regenerate.
gas/
	* Makefile.am: Remove netware support.
	* config/tc-i386.c: Likewise.
	* configure.tgt: Likewise.
	* config/te-netware.h: Delete.
	* Makefile.in: Regenerate.
	* po/POTFILES.in: Regenerate.
gprof/
	* corefile.c: Remove netware support.
ld/
	* Makefile.am: Remove netware support.
	* configure.tgt: Likewise.
	* testsuite/ld-powerpc/powerpc.exp: Likewise.
	* emulparams/i386nw.sh: Delete.
	* emulparams/ppcnw.sh: Delete.
	* scripttempl/nw.sc: Delete.
	* Makefile.in: Regenerate.
	* po/BLD-POTFILES.in: Regenerate.
2018-04-16 15:11:22 +09:30
Alan Modra fceadf0951 Remove tahoe support
include/
	* opcode/tahoe.h: Delete.
bfd/
	* archures.c: Remove tahoe support.
	* config.bfd: Likewise.
	* configure.ac: Likewise.
	* hosts/tahoe.h: Delete.
	* bfd-in2.h: Regenerate.
	* configure: Regenerate.
opcodes/
	* configure.ac: Remove tahoe support.
	* configure: Regenerate.
binutils/
	* testsuite/binutils-all/objdump.exp: Remove tahoe support.
gprof/
	* Makefile.am: Remove tahoe support.
	* corefile.c: Likewise.
	* tahoe.c: Delete.
	* Makefile.in: Regenerate.
	* po/POTFILES.in: Regenerate.
2018-04-16 15:08:40 +09:30
Alan Modra 219d1afa89 Update year range in copyright notice of binutils files 2018-01-03 17:49:56 +10:30
Alan Modra 2571583aed Update year range in copyright notice of all files. 2017-01-02 14:08:56 +10:30
Ambrogino Modigliani 576a6e4d1d Fix spelling in comments in C source files (gprof)
* basic_blocks.c: Fix spelling in comments.
	* cg_arcs.c: Fix spelling in comments.
	* cg_print.c: Fix spelling in comments.
	* corefile.c: Fix spelling in comments.
2016-11-27 15:04:01 +10:30
Nick Clifton c616591359 Partially revert previous delta - move limit testing code to first scan over symbol file.
PR gprof/20499
	* corefile.c (num_of_syms_in): Return an unsigned int.
	Fail if the count exceeds the maximum possible allocatable size.
	(core_create_syms_from): Exit early if num_of_syms_in returns a
	failure code.
2016-08-30 13:51:43 +01:00
Nick Clifton 0092723307 Fix more potential seg-faults in gprof.
PR gprof/20499
	* corefile.c (num_of_syms_in): Return an unsigned int.
	(core_create_syms_from): Catch a possible integer overflow
	computing the argument to xmalloc.  Also allow for the possibility
	that an integer overflow in num_of_syms_in means that less space
	has been allocated than expected.
2016-08-30 13:38:54 +01:00
Nick Clifton 38334d6de4 Better fix for PR 20499, including preventing strlen from being called on an uninitialised name field.
PR gprof/20499
	* corefile.c (BUFSIZE): Define.
	(STR_BUFSIZE): Define.
	(read_function_mappings): Use BUFSIZE and STR)BUFSIZE.
	(num_of_syms_in): Move buf, address and name arrays out of
	function and declare as static BUFSIZE arrays.
	Use STR_BUFSIZE when scanning for name and address.
	(core_create_syms_from): Revert previous delta.  Instead
	short circuit the parsing of a symbol if all three fields
	could not be found.
2016-08-23 15:41:01 +01:00
Nick Clifton 4ca0333f07 Prevent a seg-fault in gprof when parsing a corrupt core file.
PR gprof/20499
	* corefile.c (core_create_syms_from): Avoid walking off the end of
	the symbol table.
2016-08-22 14:16:26 +01:00
Alan Modra 6f2750feaf Copyright update for binutils 2016-01-01 23:00:01 +10:30
Alan Modra b90efa5b79 ChangeLog rotatation and copyright year update 2015-01-02 00:53:45 +10:30
Alan Modra 4b95cf5c0c Update copyright years 2014-03-05 22:16:15 +10:30
Nick Clifton 5af84f938a PR gprof/16027
* source.c (annotate_source): Close ifp.
	* corefile.c (read_function_mappings): Close file.
2013-10-09 16:34:30 +00:00
Alan Modra cd2ae97138 * aarch64.c: New file.
* corefile.c (find_call): Call aarch64_find_call for bfd_arch_aarch64.
	* Makefile.am (sources): Add aarch64.c.
	* Makefile.in: Regenerate.
2013-05-22 13:29:43 +00:00
Alan Modra d165016dd7 * corefile.c (core_sym_class): Allow for ".constprop.N" cloned
functions.
2012-09-20 13:15:48 +00:00
Tristan Gingold ca25b5babc 2012-03-06 Tristan Gingold <gingold@adacore.com>
* corefile.c (core_create_function_syms): Do not call bsearch if
	symbol_map_count is 0.
2012-03-06 13:54:59 +00:00
Nick Clifton f36485f09d * corefile.c (core_sym_class): Allow for multiple iterations of
clone clones and subprograms.
2011-06-07 13:33:20 +00:00
Kai Tietz aee9ba6f90 2011-02-28 Kai Tietz <kai.tietz@onevision.com>
* basic_blocks.c (cmp_bb): Use filename_(n)cmp.
	* cg_print.c (order_and_dump_functions_by_arcs): Likewise.
	(cg_print_file_ordering): Likewise.
	* corefile.c (read_function_mappings): Likewise.
	(core_create_line_syms): Likewise.
2011-02-28 18:36:14 +00:00
Alan Modra 02f2d833d8 PR gprof/12468
* corefile.c (core_create_function_syms): Set is_func for targets
	that have no BSF_FUNCTION syms.
2011-02-06 23:38:38 +00:00
Nick Clifton 183e4ed8bc * corefile.c (core_sym_class): Fix handling of subprogram names
and add support for cloned function names.
2010-07-16 14:52:15 +00:00
Nick Clifton 1ad40a046a PR gprof/11524
* corefile.c (core_create_syms_from): Use correct size of buffer.
2010-04-27 14:46:09 +00:00
Nick Clifton 1e9cc1c27b * po/bfd.pot: Updated by the Translation project.
* po/binutils.pot: Updated by the Translation project.
        * po/gold.pot: Updated by the Translation project.
        * po/gold.pot: Updated by the Translation project.
        * po/gprof.pot: Updated by the Translation project.
        * po/sv.po: Updated Swedish translation.
        * po/ld.pot: Updated by the Translation project.
        * po/fi.po: Updated Finnish translation.
        * po/ld.pot: Updated by the Translation project.
        * po/fi.po: Updated Finnish translation.

        Updated sources to compile cleanly with -Wc++-compat:
        * basic_blocks.c: Add casts.
        * cg_dfn.c: Add cast.
        * corefile.c: Add casts.
        * gmon_io.c: Add casts.
        * hist.c: Add cast.
        * source.c: Add cast.
        * sym_ids.c (struct match): Moved to top level.

        Updated soruces in ld/* to compile cleanly with -Wc++-compat:
        * ld.h (enum endian_enum,enum symbolic_enum,enum dynamic_list_enum): Move to top level.
        * ldcref.c: Add casts.
        * ldctor.c: Add casts.
        * ldexp.c
        * ldexp.h (enum node_tree_enum,enum phase_enum): Move to top level.
        * ldlang.c: Add casts. (lang_insert_orphan): Use enum name instead of integer.
        * ldlang.h (enum statement_enum): Move to top level.
        * ldmain.c: Add casts.
        * ldwrite.c: Add casts.
        * lexsup.c: Add casts. (enum control_enum): Move to top level.
        * mri.c: Add casts. (mri_draw_tree): Use enum name instead of integer.

        Updated sources to compile cleanly with -Wc++-compat:
        * basic_blocks.c: Add casts.
        * cg_dfn.c: Add cast.
        * corefile.c: Add casts.
        * gmon_io.c: Add casts.
        * hist.c: Add cast.
        * source.c: Add cast.
        * sym_ids.c (struct match): Moved to top level.

        * as.c (main): Call dwarf2_init.
        * config/obj-elf.c (struct group_list): New field.
        (build_group_lists): Use hash lookup.
        (free_section_idx): New function.
        (elf_frob_file): Adjust.
        * dwarf2dbg.c (all_segs_hash, last_seg_ptr): New variables.
        (get_line_subseg): Adjust.
        (dwarf2_init): New function.
        * dwarf2dbg.h (dwarf2_init): New declaration.
2009-09-11 15:27:38 +00:00
Nick Clifton 96d56e9f91 * bfd/coff-arm.c (coff_arm_relocate_section)
(record_thumb_to_arm_glue, bfd_arm_process_before_allocation):
        Change member name class to symbol_class.
        * bfd/coff-i960.c (coff_i960_relocate_section) Rename variable
        class to class_val. Change member name class to symbol_class.
        * bfd/coff-rs6000.c (_bfd_xcoff_swap_aux_in)
        (_bfd_xcoff_swap_aux_out): Rename arguments class to in_class.
        * bfd/coff-stgo32.c (adjust_aux_in_post)
        (adjust_aux_out_pre, adjust_aux_out_post): Rename arguments class
        to in_class.
        * bfd/coff64-rs6000.c (_bfd_xcoff64_swap_aux_in)
        (_bfd_xcoff64_swap_aux_out): Rename arguments class to in_class.
        * bfd/coffcode.h (coff_pointerize_aux_hook): Rename variable class
        to n_sclass.
        * bfd/coffgen.c (coff_write_symbol, coff_pointerize_aux): Rename
        variables named class to n_sclass. (coff_write_symbols): Rename
        variable class to sym_class. (bfd_coff_set_symbol_class): Rename
        argument class to symbol_class.
        * bfd/cofflink.c (_bfd_coff_link_hash_newfunc)
        (coff_link_add_symbols, _bfd_coff_link_input_bfd)
        (_bfd_coff_write_global_sym, _bfd_coff_generic_relocate_section):
        Update code to use renamed members.
        * bfd/coffswap.h (coff_swap_aux_in, coff_swap_aux_out): Rename
        argument class to in_class.
        * bfd/libcoff-in.h (struct coff_link_hash_entry, struct
        coff_debug_merge_type) Renamed members class to symbol_class and
        type_class.
        * bfd/libcoff.h Regenerated.
        * bfd/peXXigen.c: (_bfd_XXi_swap_aux_in, _bfd_XXi_swap_aux_out):
        Rename argument class to in_class.
        * bfd/pef.c (bfd_pef_parse_imported_symbol): Update code to use
        renamed members.
        * bfd/pef.h (struct bfd_pef_imported_symbol): Changed name of
        member class to symbol_class.
        * binutils/ieee.c (ieee_read_cxx_misc, ieee_read_cxx_class)
        (ieee_read_reference): Rename variables named class to cxxclass.
        * gas/config/tc-arc.c (struct syntax_classes): Rename member class
        to s_class. (arc_extinst): Rename variable class to
        s_class. Update code to use renamed members.
        * gas/config/tc-mips.c (insn_uses_reg): Rename argument class to
        regclass.
        * gas/config/tc-ppc.c (ppc_csect, ppc_change_csect, ppc_function)
        (ppc_tc, ppc_is_toc_sym, ppc_symbol_new_hook, ppc_frob_label)
        (ppc_fix_adjustable, md_apply_fix): Update code to use renamed
        members.
        * gas/config/tc-ppc.h (struct ppc_tc_sy): Change name of member
        from class to symbol_class. (OBJ_COPY_SYMBOL_ATTRIBUTES): Update
        code to use renamed members.
        * gas/config/tc-score.c (s3_adjust_paritybit): Rename argument
        class to i_class.
        * gas/config/tc-score7.c (s7_adjust_paritybit): Rename argument
        class to i_class.
        * gprof/corefile.c (core_create_function_syms): Rename variable
        class to cxxclass.
        * include/coff/ti.h (GET_LNSZ_SIZE, PUT_LNSZ_SIZE): Updated name
        of class variable to in_class to match changes in function that
        use this macro.
        * include/opcode/ia64.h (struct ia64_operand): Renamed member
        class to op_class
        * ld/emultempl/elf32.em (gld${EMULATION_NAME}_load_symbols)
        (gld${EMULATION_NAME}_try_needed): Rename variable class to
        link_class
        * opcodes/ia64-dis.c (print_insn_ia64): Update code to use renamed
        member.
        * opcodes/m88k-dis.c (m88kdis): Rename variable class to in_class.
        * opcodes/tic80-opc.c (tic80_symbol_to_value)
        (tic80_value_to_symbol): Rename argument class to symbol_class.
2009-09-05 07:56:26 +00:00
Nick Clifton e7e981d684 * corefile.c (cmp_symbol_map): New function.
(read_function_mappins): Use qsort to sort the symbols.
        (search_mapped_symbol): New function.
        (core_create_function_syms): Use bsearch to find symbols.
        * corefile.h (struct function_map): Add new bit-field: is_first.
        * cg_print.c (cmp_symbol_map): New function.
        (cg_print_file_ordering): Sort the symbol map.
2009-06-16 11:49:12 +00:00
Nick Clifton f89ddd70e7 * corefile.c (core_create_syms_from): Use BFD_VMA_FMT when
scanning in an address.
2009-06-15 08:48:49 +00:00
Nick Clifton 0e27a8f69b * corefile.c (num_of_syms_in): New function - computes the number
of symbols in a given file.
        (core_create_syms_from): New function - populates a symbol table
        from the symbols found in a specified file.
        * corefile.h: Prototype core_create_syms_from.
        * gprof.c (long_options): Add --external-symbol-table.
        (usage): Mention it.
        (main): Initiailize external_symbol_table from
        --external-symbol-table option.  If set use it.
        * gprof.texi: Document the new option.

        * NEWS: Mention new feature added to gprof.
2009-06-12 15:33:30 +00:00
Nick Clifton 8487be8ba8 * corefile.c (core_create_function_syms): Initialise a symbol's
is_func field based on the setting of the BSF_FUNCTION flag.
2009-04-09 13:07:34 +00:00
Alan Modra d401d98a57 * corefile.c (core_create_function_syms): Remove "<locore>" and
"<hicore>" sentinels.
        * gprof.c: Likewise.
        * cg_print.c (cg_print_function_ordering): Likewise.
        * alpha.c (alpha_find_call): Add check for return value of sym_lookup.
        * mips.c (mips_find_call): Likewise.
        * sparc.c (sparc_find_call): Likewise.
        * tahoe.c (tahoe_find_call): Likewise.
        * vax.c (vax_find_call): Likewise.
2009-02-12 12:47:39 +00:00
Alan Modra 0af1713e7c Silence gcc printf warnings 2008-07-30 04:34:58 +00:00
Andreas Schwab ecba005fa1 * basic_blocks.c: Always include "gprof.h" first.
* cg_arcs.c: Likewise.
* cg_dfn.c: Likewise.
* cg_print.c: Likewise.
* corefile.c: Likewise.
* gprof.c: Likewise.
* hist.c: Likewise.
* search_list.c: Likewise.
* sym_ids.c: Likewise.
* utils.c: Likewise.
2008-06-19 16:30:29 +00:00
Nick Clifton 651dbc76f2 CHange FSF sources over to GPLv3 2007-07-06 10:40:34 +00:00
Nick Clifton 3289fe0ce0 * corefile.c (core_sym_class): Do not discard nested subprograms. 2007-07-05 09:07:30 +00:00
Alan Modra 8db406db3c * corefile.c (core_create_function_syms, core_create_line_syms): Don't
set discard_underscores.
	* gprof.c (discard_underscores): Delete.
	* gprof.h (discard_underscores): Delete.
	* sym_ids.c (match): Use bfd_get_symbol_leading_char to check for
	leading underscores.
	* utils.c (print_name_only): Call bfd_demangle rather than
	cplus_demangle.
	* Makefile.am: Run "make dep-am".
	* Makefile.in: Regenerate.
2007-04-19 10:46:56 +00:00
Vladimir Prus b3296dc54c * hist.h (struct histogram)
(histograms, num_histograms): New.
	* hist.c (find_histogram, find_histogram_for_pc)
	(read_histogram_header): New.
	(s_lowpc, s_highpc, lowpc, highpc, hist_num_bins)
	(hist_sample): Remove.
	(hist_read_rec): Use the above, and handle multiple
	histogram records with disjoint address ranges.
	(hist_write_hist): Support several histogram records.
	(scale_and_align_entries): Adjust for multiple histograms.
	(hist_assign_samples_1): New.
	(hist_assign_samples): Use the above.
	(hist_clip_symbol_address): New.
	* hist.h (hist_check_address)
	(hist_clip_symbol_address): Declare.
	* gmon_io.c (gmon_out_read, gmon_out_write): Adjust handling
	of legacy format for multiple histogram changes.
	* corefile.c (find_call): Check for core_text_space and
	clip symbol address range here.
	* vax.c	(vax_find_call): Don't check for
	core_text_space, or clip the symbol's address range here.
	Use hist_check_address to check call's target address.
	* sparc.c: Likewise.
	* tahoe.c: Likewise.
	* i386.c: Likewise.
	* mips.c: Likewise. Also use core_text_sect->vma as the base
	address for code accesses, just like other machine-specific
	routines do.
	* gprof.texi: Adjust for the new logic.
2007-04-10 07:57:31 +00:00
Ben Elliston 7433560750 * corefile.c (parse_error): New function.
(read_function_mappings): Check calls to fscanf and report any
	errors in parsing the mapping file.
2007-01-15 23:26:08 +00:00
Ben Elliston 11010f5a82 * corefile.c (core_init): Report that the executable is not in the
expected executable format rather than "a.out" format.
2006-03-22 03:51:02 +00:00
Nick Clifton 44eb18016c Update the address of the FSF 2005-05-09 06:55:25 +00:00
Ben Elliston 9e972ca0ed * corefile.c (core_num_syms): Make static.
(core_syms): Likewise.
	(min_insn_size): Likewise.
	* gprof.c (abfd): Remove unused variable.
	* hist.c (hist_dimension): Make static.
	(hist_dimension_abbrev): Likewise.
	* sym_ids.c (id_list): Likewise.
	(table_name): Likewise.
2005-04-23 17:13:31 +00:00
Alan Modra 2f041bf7ed * corefile.c (core_init): Call bfd_get_synthetic_symtab. 2005-04-14 10:33:55 +00:00
Alan Modra d6a3970174 update copyright dates 2005-03-03 12:05:13 +00:00
Alan Modra 67cf9bc5a1 * corefile.c (core_init): Use bfd_get_section_size
instead of bfd_get_section_size_before_reloc or _raw_size.
	* symtab.c (symtab_finalize): Likewise.
2004-06-15 01:11:43 +00:00
Andrew Cagney bb02f434ac 2004-05-26 Andrew Cagney <cagney@gnu.org>
* corefile.c (core_create_line_syms): Per ISO C '90, move
	vma_high's declaration to the function's start.
2004-05-26 19:40:53 +00:00
Ben Elliston 3e8f6abf1e * alpha.c, basic_blocks.c, basic_blocks.h, bb_exit_func.c,
call_graph.c, call_graph.h, cg_arcs.c, cg_arcs.h, cg_dfn.c,
	cg_dfn.h, cg_print.c, cg_print.h, corefile.c, corefile.h,
	gmon_io.c, gmon_io.h, gprof.c, gprof.h, hertz.h, hist.c, hist.h,
	i386.c, mips.c, search_list.c, search_list.h, source.c, source.h,
	sparc.c, sym_ids.c, sym_ids.h, symtab.c, symtab.h, tahoe.c,
	utils.c, utils.h, vax.c, gen-c-prog.awk: Convert K&R C to ANSI C.
2004-05-26 04:55:55 +00:00
Ben Elliston 37b1bfcd81 * corefile.c (core_init): Use a separate local variable,
core_sym_bytes, to make the units from bfd_get_symtab_upper_bound
	more obvious.
	(core_create_function_syms): Discard cbfd argument.  Eliminate
	`offset' variable and calculate VMA directly. Update all users.
	* corefile.h (core_create_function_syms): Update prototype.
	(core_create_line_syms): Likewise.
	* gprof.c (main): Remove #ifdef PROF_SUPPORT_IMPLEMENTED code.
	Tidy.
2004-05-26 04:06:26 +00:00
Alan Modra c3fcc31e0e * corefile.c (core_create_function_syms): Don't refer directly to
_cooked_size and vma;  Use bfd_section_size and bfd_get_section_vma.
2003-10-11 12:34:31 +00:00
Nick Clifton 887933998a Check for a NULL sentinel value before using it. 2003-02-21 12:42:56 +00:00
Alan Modra b34976b65a s/boolean/bfd_boolean/ s/true/TRUE/ s/false/FALSE/. Simplify
comparisons of bfd_boolean vars with TRUE/FALSE.  Formatting.
2002-11-30 08:39:46 +00:00
Dave Brolley 8e1a114b75 2002-07-24 Dave Brolley <brolley@redhat.com>
* corefile.c (core_create_function_syms): Use the end of the section
	containing the symbol to compute max_vma.
2002-07-24 15:25:03 +00:00
Alan Modra 1355568ab4 * alpha.c (alpha_find_call): Warning fixes.
* mips.c (mips_find_call): Likewise.
	* sparc.c (sparc_find_call): Likewise.
	* basic_blocks.c: Warning fixes.  Eliminate DEFUN.
	* call_graph.c: Likewise.
	* cg_arcs.c: Likewise.
	* cg_dfn.cp: Likewise.
	* gprof.c: Likewise.
	* gprof.h: Likewise.
	* hist.c: Likewise.
	* search_list.c: Likewise.
	* source.c: Likewise.
	* source.h: Likewise.
	* sym_ids.c: Likewise.
	* symtab.c: Likewise.
	* symtab.h: Likewise.
	* utils.c: Likewise.
	* cg_print.c: Likewise.
	(struct function_map, symbol_map, symbol_map_count): Move
	declaration to..
	* corefile: ..here.
	* corefile.c: Warning fixes.  Eliminate DEFUN.
	(struct function_map): Remove declaration.
	* gmon_io.c: Warning fixes.  Eliminate DEFUN.
	(gmon_io_read_64): Make static.
	(gmon_io_write_64): Likewise.
	(gmon_read_raw_arc): Likewise.
	(gmon_write_raw_arc): Likewise.
	(gmon_io_write_8): Don't pass char, pass int param.
	* gmon_io.h (gmon_io_write_8): Likewise.

and a few copyright dates that should have been done previously.
2002-02-01 08:24:16 +00:00