Alan Modra 7b958a48e1 PR25993, read of freed memory
ldmain.c:add_archive_element copies file name pointers from the bfd to
a lang_input_statement_type.
  input->filename = abfd->filename;
  input->local_sym_name = abfd->filename;
This results in stale pointers when twiddling the bfd filename in
places like the pe ld after_open.  So don't free the bfd filename,
and make copies using bfd_alloc memory that won't result in small
memory leaks that annoy memory checkers.

	PR 25993
bfd/
	* archive.c (_bfd_get_elt_at_filepos): Don't strdup filename,
	use bfd_set_filename.
	* elfcode.h (_bfd_elf_bfd_from_remote_memory): Likewise.
	* mach-o.c (bfd_mach_o_fat_member_init): Likewise.
	* opncls.c (bfd_fopen, bfd_openstreamr, bfd_openr_iovec, bfd_openw),
	(bfd_create): Likewise.
	(_bfd_delete_bfd): Don't free filename.
	(bfd_set_filename): Copy filename param to bfd_alloc'd memory,
	return pointer to the copy or NULL on alloc fail.
	* vms-lib.c (_bfd_vms_lib_get_module): Free newname and test
	result of bfd_set_filename.
	* bfd-in2.h: Regenerate.
gdb/
	* solib-darwin.c (darwin_bfd_open): Don't strdup pathname for
	bfd_set_filename.
	* solib-aix.c (solib_aix_bfd_open): Use std::string for name
	passed to bfd_set_filename.
	* symfile-mem.c (add_vsyscall_page): Likewise for string
	passed to symbol_file_add_from_memory.
	(symbol_file_add_from_memory): Make name param a const char* and
	don't strdup.
ld/
	* emultempl/pe.em (gld_${EMULATION_NAME}_after_open): Don't copy
	other_bfd_filename for bfd_set_filename, and test result of
	bfd_set_filename call.  Don't create a new is->filename, simply
	copy from bfd filename.  Free new_name after bfd_set_filename.
	* emultempl/pep.em (gld_${EMULATION_NAME}_after_open): Likewise.
2020-05-20 11:43:50 +09:30
..
2020-03-02 23:49:03 +10:30
2020-03-02 19:30:48 +10:30
2020-05-19 12:35:03 +09:30
2020-05-20 11:43:50 +09:30
2020-02-19 13:12:00 +10:30
2020-05-20 11:43:50 +09:30
2020-05-19 12:35:03 +09:30
2020-05-19 10:51:04 +09:30
2020-03-02 19:30:48 +10:30
2020-05-19 12:35:03 +09:30
2020-05-20 11:43:50 +09:30
2020-01-01 18:12:08 +10:30
2020-03-03 00:12:44 +10:30
2020-03-31 15:04:21 +10:30
2020-02-26 10:37:25 +10:30
2020-03-02 19:30:48 +10:30
2020-03-02 11:36:19 +10:30
2020-02-19 13:12:00 +10:30
2020-03-02 19:30:48 +10:30
2020-04-27 17:41:39 +01:00
2020-03-20 03:55:30 -07:00
2020-04-27 17:41:39 +01:00
2020-02-26 10:37:25 +10:30
2020-02-19 17:46:10 +00:00
2020-02-19 13:12:00 +10:30
2020-05-19 12:35:03 +09:30
2020-02-19 13:12:00 +10:30
2020-02-26 10:37:25 +10:30
2020-02-19 13:12:00 +10:30
2020-02-19 13:12:00 +10:30
2020-02-19 14:00:55 +10:30
2020-02-19 13:12:00 +10:30
2020-02-26 10:37:25 +10:30
2020-02-19 13:12:00 +10:30
2020-02-26 10:37:25 +10:30
2020-05-19 14:26:33 +01:00
2020-02-26 10:37:25 +10:30
2020-02-19 14:00:55 +10:30
2020-02-19 13:12:00 +10:30
2020-02-19 13:12:00 +10:30
2020-03-02 11:36:19 +10:30
2020-02-19 13:12:00 +10:30
2020-02-19 14:00:55 +10:30
2020-02-19 13:12:00 +10:30
2020-05-11 21:08:37 +09:30
2020-01-22 17:14:08 +10:30
2020-02-19 13:12:00 +10:30
2020-02-19 14:00:55 +10:30
2020-02-19 13:14:05 +10:30
2020-02-19 13:12:00 +10:30
2020-02-26 10:37:25 +10:30
2020-02-19 13:12:00 +10:30
2020-02-26 10:37:25 +10:30
2020-02-26 10:37:25 +10:30
2020-02-26 10:37:25 +10:30
2020-05-20 11:43:50 +09:30
2020-05-19 12:35:03 +09:30
2020-05-19 12:35:03 +09:30
2020-03-19 07:07:11 +01:00
2020-01-22 16:45:04 -08:00
2020-02-26 10:37:25 +10:30
2020-02-19 13:12:00 +10:30
2020-02-19 13:12:00 +10:30
2020-03-02 23:49:03 +10:30
2020-03-03 00:12:44 +10:30
2020-02-26 10:37:25 +10:30
2020-03-26 20:02:42 +10:30
2020-03-02 23:49:03 +10:30
2020-03-02 19:30:48 +10:30
2020-04-22 18:46:45 -07:00
2020-05-19 12:35:03 +09:30
2020-03-02 23:49:03 +10:30
2020-03-02 19:30:48 +10:30
2020-03-02 19:30:48 +10:30
2020-03-02 19:30:48 +10:30
2020-03-02 19:30:48 +10:30
2020-05-20 11:43:50 +09:30
2020-03-02 19:30:48 +10:30
2020-01-31 10:47:46 +10:30
2020-01-31 10:47:46 +10:30
2020-03-02 23:49:03 +10:30
2020-05-20 11:43:50 +09:30
2020-03-02 23:49:03 +10:30
2020-05-19 12:35:03 +09:30
2020-04-27 17:41:39 +01:00
2020-03-02 19:30:48 +10:30
2020-03-02 19:30:48 +10:30
2020-05-19 12:35:03 +09:30
2020-03-20 03:55:30 -07:00
2020-03-02 19:30:48 +10:30
2020-03-02 23:49:03 +10:30
2020-04-22 18:46:45 -07:00
2020-03-03 00:12:44 +10:30
2020-04-18 10:24:17 +09:30
2020-05-19 12:35:03 +09:30
2020-05-19 12:35:03 +09:30
2020-01-17 12:34:03 -06:00
2020-04-27 17:41:39 +01:00
2020-03-31 15:04:21 +10:30
2020-05-20 00:00:07 +00:00
2020-04-28 08:35:34 +09:30
2020-05-20 11:43:50 +09:30
2020-01-14 11:02:28 +10:30
2020-03-09 10:10:36 +10:30
2020-03-02 19:30:48 +10:30
2020-03-02 19:30:48 +10:30

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

BFD is an object file library.  It permits applications to use the
same routines to process object files regardless of their format.

BFD is used by the GNU debugger, assembler, linker, and the binary
utilities.

The documentation on using BFD is scanty and may be occasionally
incorrect.  Pointers to documentation problems, or an entirely
rewritten manual, would be appreciated.

There is some BFD internals documentation in doc/bfdint.texi which may
help programmers who want to modify BFD.

BFD is normally built as part of another package.  See the build
instructions for that package, probably in a README file in the
appropriate directory.

BFD supports the following configure options:

  --target=TARGET
	The default target for which to build the library.  TARGET is
	a configuration target triplet, such as sparc-sun-solaris.
  --enable-targets=TARGET,TARGET,TARGET...
	Additional targets the library should support.  To include
	support for all known targets, use --enable-targets=all.
  --enable-64-bit-bfd
	Include support for 64 bit targets.  This is automatically
	turned on if you explicitly request a 64 bit target, but not
	for --enable-targets=all.  This requires a compiler with a 64
	bit integer type, such as gcc.
  --enable-shared
	Build BFD as a shared library.
  --with-mmap
	Use mmap when accessing files.  This is faster on some hosts,
	but slower on others.  It may not work on all hosts.

Report bugs with BFD to bug-binutils@gnu.org.

Patches are encouraged.  When sending patches, always send the output
of diff -u or diff -c from the original file to the new file.  Do not
send default diff output.  Do not make the diff from the new file to
the original file.  Remember that any patch must not break other
systems.  Remember that BFD must support cross compilation from any
host to any target, so patches which use ``#ifdef HOST'' are not
acceptable.  Please also read the ``Reporting Bugs'' section of the
gcc manual.

Bug reports without patches will be remembered, but they may never get
fixed until somebody volunteers to fix them.

Copyright (C) 2012-2020 Free Software Foundation, Inc.

Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved.