Commit Graph

26 Commits

Author SHA1 Message Date
Alan Modra
fd67aa1129 Update year range in copyright notice of binutils files
Adds two new external authors to etc/update-copyright.py to cover
bfd/ax_tls.m4, and adds gprofng to dirs handled automatically, then
updates copyright messages as follows:

1) Update cgen/utils.scm emitted copyrights.
2) Run "etc/update-copyright.py --this-year" with an extra external
   author I haven't committed, 'Kalray SA.', to cover gas testsuite
   files (which should have their copyright message removed).
3) Build with --enable-maintainer-mode --enable-cgen-maint=yes.
4) Check out */po/*.pot which we don't update frequently.
2024-01-04 22:58:12 +10:30
Alan Modra
19cacf6729 Use bfd_alloc memory for read_debugging_info storage
Trying to free malloc'd memory used by the stabs and coff debug info
parsers is complicated, and traversing the trees generated requires a
lot of code.  It's better to bfd_alloc the memory which allows it all
to be freed without fuss when the bfd is closed.  In the process of
doing this I reverted most of commit a633691333.

Some of the stabs handling code grows arrays of pointers with realloc,
to deal with arbitrary numbers of fields, function args, etc.  The
code still does that but copies over to bfd_alloc memory when
finished.  The alternative is to parse twice, once to size, then again
to populate the arrays.  I think that complication is unwarranted.

Note that there is a greater than zero chance this patch breaks
something, eg. that I missed an attempt to free obj_alloc memory.
Also it seems there are no tests in the binutils testsuite aimed at
exercising objdump --debugging.

	* budbg.h (finish_stab, parse_stab): Update prototypes
	* debug.c: Include bucomm.h.
	(struct debug_handle): Add "abfd" field.
	(debug_init): Add "abfd" param.  bfd_alloc handle.
	(debug_xalloc, debug_xzalloc): New functions.  Use throughout
	in place of xmalloc and memset.
	(debug_start_source): Remove "name_used" param.
	* debug.h (debug_init, debug_start_source): Update prototypes.
	(debug_xalloc, debug_xzalloc): Declare.
	* objcopy.c (copy_object): Don't free dhandle.
	* objdump.c (dump_bfd): Likewise.
	* rdcoff.c (coff_get_slot): Add dhandle arg.  debug_xzalloc
	memory in place of xcalloc.  Update callers.
	(parse_coff_struct_type): Don't leak on error return.  Copy
	fields over to debug_xalloc memory.
	(parse_coff_enum_type): Copy names and vals over the
	debug_xalloc memory.
	* rddbg.c (read_debugging_info): Adjust debug_init call.
	Don't free dhandle.
	(read_section_stabs_debugging_info): Don't free shandle.
	Adjust parse_stab call.  Call finish_stab on error return.
	(read_symbol_stabs_debugging_info): Similarly.
	* stabs.c (savestring): Delete unnecessary forward declaration.
	Add dhandle param.  debug_xalloc memory.  Update callers.
	(start_stab): Delete unnecessary casts.
	(finish_stab): Add "emit" param.  Free file_types, so_string,
	and stabs handle.
	(parse_stab): Delete string_used param.  Revert code dealing
	with string_used.  Copy so_string passed to debug_set_filename
	and stored as main_filename to debug_xalloc memory.  Similarly
	for string passed to debug_start_source and push_bincl.  Copy
	args to debug_xalloc memory.  Don't leak args.
	(parse_stab_enum_type): Copy names and values to debug_xalloc
	memory.  Don't free name.
	(parse_stab_struct_type): Don't free fields.
	(parse_stab_baseclasses): Delete unnecessary cast.
	(parse_stab_struct_fields): Return debug_xalloc fields.
	(parse_stab_cpp_abbrev): Use debug_xalloc for _vb$ type name.
	(parse_stab_one_struct_field): Don't free name.
	(parse_stab_members): Copy variants and methods to
	debug_xalloc memory.  Don't free name or argtypes.
	(parse_stab_argtypes): Use debug_xalloc memory for physname
	and args.
	(push_bincl): Add dhandle param.  Use debug_xalloc memory.
	(stab_record_variable): Use debug_xalloc memory.
	(stab_emit_pending_vars): Don't free var list.
	(stab_find_slot): Add dhandle param.  Use debug_xzalloc
	memory.  Update all callers.
	(stab_find_tagged_type): Don't free name.  Use debug_xzalloc.
	(stab_demangle_qualified): Don't free name.
	(stab_demangle_template): Don't free s1.
	(stab_demangle_args): Tidy pvarargs refs.  Copy *pargs on
	success to debug_xalloc memory, free on failure.
	(stab_demangle_fund_type): Don't free name.
	(stab_demangle_v3_arglist): Copy args to debug_xalloc memory.
	Don't free dt.
2023-04-04 12:47:56 +09:30
Alan Modra
a633691333 rddbg.c stabs FIXMEs
This should sort out some very old FIXMEs in code handling stabs
debug info.  Necessary if we are to fuss over freeing up memory before
objdump and objcopy exit.  It is of course better from a user
viewpoint to *not* free memory, which takes some time, and leave that
to process exit.  The only reason to do so is that having many memory
leaks in binutils/ code tends to hide leaks in bfd/ or opcodes/, which
we should care about.

	* budbg.h (parse_stab): Update prototype.
	* debug.h (debug_start_source): Update prototype.
	* debug.c (debug_start_source): Add name_used.  Set if stashed.
	* rddbg.c (read_symbol_stabs_debugging_info): Always malloc
	stab string passed to parse_stab.  Free stab string when
	unreferenced.
	(read_section_stabs_debugging_info): Likewise, and strings
	section contents.
	* stabs.c (parse_stab): Add string_used param.  Set if string
	stashed.  Pass to debug_start_source.  Realloc file_types
	array rather that using malloc.  Clarify comment about
	debug_make_indirect_type.
2023-04-03 07:29:35 +09:30
Alan Modra
d87bef3a7b Update year range in copyright notice of binutils files
The newer update-copyright.py fixes file encoding too, removing cr/lf
on binutils/bfdtest2.c and ld/testsuite/ld-cygwin/exe-export.exp, and
embedded cr in binutils/testsuite/binutils-all/ar.exp string match.
2023-01-01 21:50:11 +10:30
Alan Modra
a2c5833233 Update year range in copyright notice of binutils files
The result of running etc/update-copyright.py --this-year, fixing all
the files whose mode is changed by the script, plus a build with
--enable-maintainer-mode --enable-cgen-maint=yes, then checking
out */po/*.pot which we don't update frequently.

The copy of cgen was with commit d1dd5fcc38ead reverted as that commit
breaks building of bfp opcodes files.
2022-01-02 12:04:28 +10:30
Alan Modra
015dc7e1f8 Use bool in binutils
* sysdep.h (POISON_BFD_BOOLEAN): Define.
	* addr2line.c, * ar.c, * arsup.c, * bfdtest2.c, * binemul.c,
	* binemul.h, * bucomm.c, * bucomm.h, * budbg.h, * coffgrok.c,
	* debug.c, * debug.h, * dlltool.c, * dwarf.c, * dwarf.h,
	* elfedit.c, * emul_aix.c, * mclex.c, * nm.c, * objcopy.c,
	* objdump.c, * od-macho.c, * prdbg.c, * rdcoff.c, * rddbg.c,
	* readelf.c, * rename.c, * stabs.c, * strings.c, * windint.h,
	* windmc.c, * windmc.h, * windres.c, * winduni.c,
	* wrstabs.c: Replace bfd_boolean with bool, FALSE with false,
	and TRUE with true throughout.
2021-03-31 10:49:23 +10:30
Alan Modra
250d07de5c Update year range in copyright notice of binutils files 2021-01-01 10:31:05 +10:30
Alan Modra
b3adc24a07 Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
Alan Modra
827041555a Update year range in copyright notice of binutils files 2019-01-01 22:06:53 +10:30
Alan Modra
fdef394344 Remove IEEE 695 object support
include/
	* ieee.h: Delete.
bfd/
	* Makefile.am: Remove IEEE 695 support.
	* archures.c: Likewise.
	* bfd.c: Likewise.
	* config.bfd: Likewise.
	* configure.ac: Likewise.
	* doc/bfd.texinfo: Likewise.
	* doc/bfdint.texi: Likewise.
	* doc/bfdsumm.texi: Likewise.
	* section.c: Likewise.
	* targets.c: Likewise.
	* ieee.c: Delete.
	* libieee.h: Delete.
	* Makefile.in: Regenerate.
	* bfd-in2.h: Regenerate.
	* configure: Regenerate.
	* po/SRC-POTFILES.in: Regenerate.
binutils/
	* Makefile.am: Remove IEEE 695 support.
	* budbg.h: Likewise.
	* doc/binutils.texi: Likewise.
	* makefile.vms: Likewise.
	* objcopy.c: Likewise.
	* objdump.c: Likewise.
	* rddbg.c: Likewise.
	* ieee.c: Delete.
	* Makefile.in: Regenerate.
	* po/POTFILES.in: Regenerate.
gas/
	* app.c: Remove IEEE 695 support.
	* symbols.c: Likewise.
ld/
	* ld.texinfo: Remove IEEE 695 support.
	* mri.c: Likewise.
2018-04-16 15:16:00 +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
Alan Modra
6f2750feaf Copyright update for binutils 2016-01-01 23:00:01 +10:30
Alan Modra
b38ead219b Assorted compiler warning fixes
The C standard doesn't guarantee a function pointer can be cast to
void* and vice versa.

binutils/
	* prdbg.c (print_debugging_info): Don't use void* for function
	pointer param.
	* budbg.h (print_debugging_info): Update prototype.
gas/
	* read.c (s_altmacro, s_reloc): Make definition static.
2015-01-12 18:07:52 +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
Alan Modra
dbb7c4414b * sysdep.h: Include sys/stat.h here.
* ar.c: Don't include headers already included by sysdep.h.
	* bucomm.c: Likewise.
	* budbg.h: Likewise.
	* dlltool.h: Likewise.
	* elfedit.c: Likewise.
	* nlmconv.c: Likewise.
	* objcopy.c: Likewise.
	* objdump.c: Likewise.
	* objdump.h: Likewise.
	* readelf.c: Likewise.
	* rename.c: Likewise.
	* resrc.c: Likewise.
	* strings.c: Likewise.
	* windres.c: Likewise.
	* od-macho.c: Ensure #include sysdep.h is first.
	* od-xcoff.c: Likewise.
	* dllwrap.c: Remove alloca pragma handled by sysdep.h, and
	remove duplicate headers.
	* dlltool.c: Likewise and ensure #include sysdep.h is first.
2012-02-09 04:51:44 +00:00
Alan Modra
aa820537ea update copyright dates 2009-09-02 07:25:43 +00:00
Nick Clifton
b922d5904f PR binutils/6483
* objdump.c (dump_bfd): If the -g option found no STABS or IEEE
        debug information to display, try dumping DWARF information
        instead.
        * rddbg.c (read_debugging_info): Add a parameter to suppress the
        display of a warning message when no debug information is found.
        * budbg.h (read_debugging_info): Update prototype.
        * objcopy.c (copy_object): Continue to allow read_debugging_info
        to produce warning messages.
        * doc/binutils.texi (--debugging): Document new behaviour of the
        -g/--debugging option.
2008-06-12 11:57:40 +00:00
Nick Clifton
32866df75e Change sources over to using GPLv3 2007-07-05 16:54:46 +00:00
Nick Clifton
b43b5d5f76 Update FSF address 2005-05-08 14:17:41 +00:00
Andreas Jaeger
2da42df615 * addr2line.c: Convert to ISO C90 prototypes, change PTR, remove
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.
2003-09-14 12:20:17 +00:00
Nick Clifton
51cdc6e056 * objdump.c: New command line option --debugging-tags.
* doc/binutils.texi: Document new command line option.
* prdbg.c: Code to print the debug info as tags compatible with ctags.
* budbg.h: Adjust prototype.
* NEWS: Mention new switch
2003-07-22 13:33:32 +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
Nick Clifton
8c2bc6877d Fix typos in ChangeLogs and update copyright notices 2001-03-13 06:43:59 +00:00
Richard Henderson
252b5132c7 19990502 sourceware import 1999-05-03 07:29:11 +00:00