* symfile-mem.c (do_target_read_memory): New function.
(symbol_file_add_from_memory): Pass do_target_read_memory to
bfd_elf_bfd_from_remote_memory.
* corefile.c (write_memory): Update, make a copy of the read-only
buffer.
* target.c (target_read_memory): Update.
(target_write_memory): Update, make a copy of the read-only
buffer.
* gdbcore.h (write_memory): Change buffer type to bfd_byte, make
const.
* target.h (target_read_memory, target_write_memory): Change
buffer type to bfd_byte; for write_memory, make it const.
* i386-linux-tdep.c (i386_linux_dwarf_signal_frame_p): New.
(i386_linux_init_abi): Call dwarf2_frame_set_signal_frame_p.
* inf-ptrace.c (inf_ptrace_attach): Call
observer_notify_inferior_created.
* inftarg.c (child_attach): Likewise.
* symfile-mem.c: Include "observer.h", "auxv.h", and "elf/common.h".
(symbol_file_add_from_memory): Take NAME argument. Use it for
the new BFD's filename.
(add_symbol_file_from_memory_command): Update call to
symbol_file_add_from_memory.
(struct symbol_file_add_from_memory_args, add_vsyscall_page)
(symbol_file_add_from_memory_wrapper): New.
(_initialize_symfile_mem): Register add_vsyscall_page as an
inferior_created observer.
* symfile.h (symbol_file_add_from_memory): Delete declaration.
* symfile-mem.h: Delete file.
* symfile-mem.c: Do not include "symfile-mem.h".
(symbol_file_add_from_memory): Make static. Use "struct bfd" and
"struct bfd_section". When an error do not bother returning NULL.
(add_symbol_file_from_memory_command): Use "struct bfd" and
"struct bfd_section".
* Makefile.in (symfile_mem_h): Delete.
(symfile-mem.o): Update dependencies.