[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug ld/17047] BFD ld crashes on cleanup, if MALLOC_PERTURB_ is set
From: |
cvs-commit at gcc dot gnu.org |
Subject: |
[Bug ld/17047] BFD ld crashes on cleanup, if MALLOC_PERTURB_ is set |
Date: |
Fri, 13 Jun 2014 09:43:25 +0000 |
https://sourceware.org/bugzilla/show_bug.cgi?id=17047
--- Comment #2 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot
gnu.org> ---
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gdb and binutils".
The branch, master has been updated
via d495ab0d843def702a6641fa4fc31708d7fc97b1 (commit)
via caa4096e844a000ff63c4fa9180d70ca2093fd2a (commit)
via 68faa6378d757de1fdf29f7d27025c5eadd897ec (commit)
via c72f2fb2bb6a3e1850b081dbfce4040970fae8e6 (commit)
from 07cccc39f31f4b77607fd9487f33e242969475ca (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=d495ab0d843def702a6641fa4fc31708d7fc97b1
commit d495ab0d843def702a6641fa4fc31708d7fc97b1
Author: Alan Modra <address@hidden>
Date: Fri Jun 13 19:11:39 2014 +0930
Free linker hash table from bfd_close.
Also tidies numerous error exit paths in various link_hash_table_create
functions that failed to free memory.
include/
* bfdlink.h (struct bfd_link_hash_table): Add hash_table_free field.
bfd/
* archive.c: Include bfdlink.h.
(_bfd_archive_close_and_cleanup): Call linker hash_table_free.
* bfd.c (struct bfd): Add is_linker_output field.
* elf-bfd.h (_bfd_elf_link_hash_table_free): Update prototype.
* linker.c (_bfd_link_hash_table_init): Set up hash_table_free,
link.hash and is_linker_output.
(_bfd_generic_link_hash_table_free): Replace bfd_link_hash_table*
param with bfd*. Assert is_linker_output and link.hash, and
clear them before exit.
* elf-m10300.c (elf32_mn10300_link_hash_table_free): Replace
bfd_link_hash_table* param with bfd*. Hack is_linker_output
and link.hash so we can free two linker hash tables.
(elf32_mn10300_link_hash_table_create): Create static_hash_table
first. Clean up on errors. Set hash_table_free pointer.
* elf32-arm.c (elf32_arm_link_hash_table_free): Replace
bfd_link_hash_table* param with bfd*.
(elf32_arm_link_hash_table_create): Clean up on errors. Set
hash_table_free pointer.
* elf32-avr.c, * elf32-hppa.c, * elf32-i386.c, * elf32-m68hc1x.c,
* elf32-m68k.c, * elf32-metag.c, * elf32-nios2.c, * elf32-xgate.c,
* elf64-ia64-vms.c, * elf64-ppc.c, * elf64-x86-64.c, * elflink.c,
* elfnn-aarch64.c, * elfnn-ia64.c, * elfxx-sparc.c,
* xcofflink.c: Similarly.
* simple.c (bfd_simple_get_relocated_section_contents): Save and
clear link.next before creating linker hash table. Clean up on
errors, and restore link.next on exit.
* elf32-m68hc1x.h (m68hc11_elf_bfd_link_hash_table_free): Delete.
* elf32-xgate.h (xgate_elf_bfd_link_hash_table_free): Delete.
* elfxx-sparc.h (_bfd_sparc_elf_link_hash_table_free): Delete.
* libcoff-in.h (_bfd_xcoff_bfd_link_hash_table_free): Delete.
* hash.c (bfd_hash_table_init_n): Free table on error.
* libbfd-in.h (_bfd_generic_link_hash_table_free): Update proto.
* bfd-in2.h: Regenerate.
* libbfd.h: Regenerate.
* libcoff.h: Regenerate.
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=caa4096e844a000ff63c4fa9180d70ca2093fd2a
commit caa4096e844a000ff63c4fa9180d70ca2093fd2a
Author: Alan Modra <address@hidden>
Date: Fri Jun 13 19:11:29 2014 +0930
Don't call bfd_link_hash_table_free
Freeing the linker hash table is a royal pain. It can't be freed
before the _bfd_write_contents call in bfd_close, because some target
bfd_write_contents functions access the hash table. It can't be freed
after bfd_close either, since bfd_alloc memory holding side data
structures disappears (PR17047). Clearly the only place it can be freed
is actually in bfd_close. This patch doesn't do that, but kills off
the existing means of freeing the hash table via a bfd target xvec call.
bfd/
PR 17047
* targets.c (BFD_JUMP_TABLE): Delete NAME##_bfd_link_hash_table_free.
(struct bfd_target <_bfd_link_hash_table_free>): Delete.
* bfd.c (bfd_link_hash_table_free): Don't define.
* aout-adobe.c, * aout-target.h, * aout-tic30.c, * binary.c, * bout.c,
* coff64-rs6000.c, * coffcode.h, * elf-m10300.c, * elf32-arm.c,
* elf32-avr.c, * elf32-hppa.c, * elf32-i386.c, * elf32-m68hc11.c,
* elf32-m68hc12.c, * elf32-m68k.c, * elf32-metag.c, * elf32-nios2.c,
* elf32-sparc.c, * elf32-xgate.c, * elf64-ia64-vms.c, * elf64-ppc.c,
* elf64-sparc.c, * elf64-x86-64.c, * elfnn-aarch64.c, * elfnn-ia64.c,
* elfxx-target.h, * i386msdos.c, * i386os9k.c, * ieee.c, * ihex.c,
* libbfd-in.h, * libecoff.h, * mach-o-target.c, * mmo.c,
* nlm-target.h, * oasys.c, * pef.c, * plugin.c, * ppcboot.c, * som.c,
* srec.c, * tekhex.c, * verilog.c, * versados.c, * vms-alpha.c,
* xsym.c: Don't define various link_hash_table_free defines, and
remove from bfd_target vars. Temporarily reference some of the
target link_hash_table_free functions to avoid warnings.
* bfd-in2.h: Regenerate.
* libbfd.h: Regenerate.
ld/
PR 17047
* ldlang.c (output_bfd_hash_table_free_fn): Delete.
(open_output): Don't set it..
* ldmain.c (ld_cleanup): ..or call it.
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=68faa6378d757de1fdf29f7d27025c5eadd897ec
commit 68faa6378d757de1fdf29f7d27025c5eadd897ec
Author: Alan Modra <address@hidden>
Date: Fri Jun 13 19:11:19 2014 +0930
Move link_hash_table_free functions earlier
Move some code around, in preparation for a followup patch.
* elf-m10300.c, * elf32-arm.c, * elf32-avr.c, * elf32-hppa.c,
* elf32-i386.c, * elf32-m68hc1x.c, * elf32-m68k.c, * elf32-metag.c,
* elf32-nios2.c, * elf64-ia64-vms.c, * elf64-ppc.c, * elf64-x86-64.c,
* elfnn-aarch64.c, * elfnn-ia64.c, * elfxx-sparc.c, * xcofflink.c:
Move link_hash_table_free functions before their corresponding
link_hash_table_create functions.
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=c72f2fb2bb6a3e1850b081dbfce4040970fae8e6
commit c72f2fb2bb6a3e1850b081dbfce4040970fae8e6
Author: Alan Modra <address@hidden>
Date: Fri Jun 13 19:10:57 2014 +0930
Make bfd.link_next field a union
This field of struct bfd is currently only used to chain together
linker input files. This patch prepares to use the field to stash
the linker hash table, which is always created on the linker output
file.
bfd/
* bfd.c (struct bfd): Replace link_next with a union.
* aoutx.h, * bfd.c, * coff-ppc.c, * coff-rs6000.c, * cofflink.c,
* ecoff.c, * elf-m10300.c, * elf32-arm.c, * elf32-avr.c,
* elf32-hppa.c, * elf32-i386.c, * elf32-lm32.c, * elf32-m32c.c,
* elf32-m32r.c, * elf32-m68hc1x.c, * elf32-metag.c,
* elf32-microblaze.c, * elf32-nds32.c, * elf32-nios2.c,
* elf32-or1k.c, * elf32-ppc.c, * elf32-rl78.c, * elf32-s390.c,
* elf32-score.c, * elf32-score7.c, * elf32-sh.c, * elf32-spu.c,
* elf32-tic6x.c, * elf32-tilepro.c, * elf32-xstormy16.c,
* elf32-xtensa.c, * elf64-alpha.c, * elf64-hppa.c, * elf64-ia64-vms.c,
* elf64-mmix.c, * elf64-ppc.c, * elf64-s390.c, * elf64-x86-64.c,
* elflink.c, * elfnn-aarch64.c, * elfxx-mips.c, * elfxx-sparc.c,
* elfxx-tilegx.c, * linker.c, * pdp11.c, * peXXigen.c, * simple.c,
* sunos.c, * vms-alpha.c, * xcofflink.c: Update for above.
* bfd-in2.h: Regenerate.
include/
* bfdlink.h: Update for bfd.link_next change.
ld/
* emultempl/cr16elf.em, * emultempl/elf32.em, * emultempl/genelf.em,
* emultempl/m68kcoff.em, * emultempl/m68kelf.em,
* emultempl/nds32elf.em, * emultempl/pe.em, * emultempl/pep.em,
* ldlang.c, * ldmain.c, * pe-dll.c: Update for bfd.link_next change.
-----------------------------------------------------------------------
Summary of changes:
bfd/ChangeLog | 87 ++++++++++++++++++++++++++++++++++++++++++++++
bfd/aout-adobe.c | 1 -
bfd/aout-target.h | 3 --
bfd/aout-tic30.c | 3 --
bfd/aoutx.h | 6 ++--
bfd/archive.c | 4 ++
bfd/bfd-in2.h | 18 +++++-----
bfd/bfd.c | 14 +++++---
bfd/binary.c | 1 -
bfd/bout.c | 1 -
bfd/coff-ppc.c | 2 +-
bfd/coff-rs6000.c | 2 +-
bfd/coff64-rs6000.c | 2 -
bfd/coffcode.h | 4 --
bfd/cofflink.c | 4 +-
bfd/ecoff.c | 2 +-
bfd/elf-bfd.h | 2 +-
bfd/elf-m10300.c | 60 +++++++++++++++++--------------
bfd/elf32-arm.c | 44 +++++++++++-----------
bfd/elf32-avr.c | 49 ++++++++++++++------------
bfd/elf32-hppa.c | 39 +++++++++++---------
bfd/elf32-i386.c | 36 +++++++++---------
bfd/elf32-lm32.c | 4 +-
bfd/elf32-m32c.c | 4 +-
bfd/elf32-m32r.c | 2 +-
bfd/elf32-m68hc11.c | 2 -
bfd/elf32-m68hc12.c | 2 -
bfd/elf32-m68hc1x.c | 43 +++++++++++++----------
bfd/elf32-m68hc1x.h | 1 -
bfd/elf32-m68k.c | 38 +++++++++----------
bfd/elf32-metag.c | 39 +++++++++++---------
bfd/elf32-microblaze.c | 2 +-
bfd/elf32-nds32.c | 8 ++--
bfd/elf32-nios2.c | 38 ++++++++++---------
bfd/elf32-or1k.c | 2 +-
bfd/elf32-ppc.c | 8 ++--
bfd/elf32-rl78.c | 4 +-
bfd/elf32-s390.c | 4 +-
bfd/elf32-score.c | 2 +-
bfd/elf32-score7.c | 2 +-
bfd/elf32-sh.c | 2 +-
bfd/elf32-sparc.c | 2 -
bfd/elf32-spu.c | 28 +++++++-------
bfd/elf32-tic6x.c | 6 ++--
bfd/elf32-tilepro.c | 2 +-
bfd/elf32-xgate.c | 18 +++++-----
bfd/elf32-xgate.h | 1 -
bfd/elf32-xstormy16.c | 4 +-
bfd/elf32-xtensa.c | 14 ++++----
bfd/elf64-alpha.c | 2 +-
bfd/elf64-hppa.c | 2 +-
bfd/elf64-ia64-vms.c | 79 ++++++++++++++++++++---------------------
bfd/elf64-mmix.c | 2 +-
bfd/elf64-ppc.c | 69 ++++++++++++++++++------------------
bfd/elf64-s390.c | 4 +-
bfd/elf64-sparc.c | 2 -
bfd/elf64-x86-64.c | 39 +++++++++-----------
bfd/elflink.c | 35 ++++++++++--------
bfd/elfnn-aarch64.c | 48 ++++++++++++-------------
bfd/elfnn-ia64.c | 77 ++++++++++++++++++++--------------------
bfd/elfxx-mips.c | 6 ++--
bfd/elfxx-sparc.c | 35 +++++++++---------
bfd/elfxx-sparc.h | 2 -
bfd/elfxx-target.h | 6 ---
bfd/elfxx-tilegx.c | 2 +-
bfd/hash.c | 1 +
bfd/i386msdos.c | 1 -
bfd/i386os9k.c | 1 -
bfd/ieee.c | 2 -
bfd/ihex.c | 1 -
bfd/libbfd-in.h | 4 +--
bfd/libbfd.h | 4 +--
bfd/libcoff-in.h | 2 -
bfd/libcoff.h | 2 -
bfd/libecoff.h | 1 -
bfd/linker.c | 26 ++++++++++---
bfd/mach-o-target.c | 1 -
bfd/mmo.c | 1 -
bfd/nlm-target.h | 1 -
bfd/oasys.c | 1 -
bfd/pdp11.c | 6 ++--
bfd/peXXigen.c | 2 +-
bfd/pef.c | 1 -
bfd/plugin.c | 1 -
bfd/ppcboot.c | 1 -
bfd/simple.c | 16 +++++++--
bfd/som.c | 1 -
bfd/srec.c | 1 -
bfd/sunos.c | 2 +-
bfd/targets.c | 4 --
bfd/tekhex.c | 1 -
bfd/verilog.c | 1 -
bfd/versados.c | 1 -
bfd/vms-alpha.c | 7 ++--
bfd/xcofflink.c | 49 +++++++++++++++----------
bfd/xsym.c | 1 -
include/ChangeLog | 8 ++++
include/bfdlink.h | 4 ++-
ld/ChangeLog | 14 +++++++
ld/emultempl/cr16elf.em | 4 +-
ld/emultempl/elf32.em | 6 ++--
ld/emultempl/genelf.em | 2 +-
ld/emultempl/m68kcoff.em | 4 +-
ld/emultempl/m68kelf.em | 4 +-
ld/emultempl/nds32elf.em | 6 ++--
ld/emultempl/pe.em | 4 +-
ld/emultempl/pep.em | 4 +-
ld/ldlang.c | 19 +---------
ld/ldmain.c | 6 +---
ld/pe-dll.c | 12 +++---
110 files changed, 701 insertions(+), 616 deletions(-)
--
You are receiving this mail because:
You are on the CC list for the bug.
- [Bug ld/17047] New: BFD ld crashes on cleanup, if MALLOC_PERTURB_ is set, ueno at gnu dot org, 2014/06/11
- [Bug ld/17047] BFD ld crashes on cleanup, if MALLOC_PERTURB_ is set, amodra at gmail dot com, 2014/06/12
- [Bug ld/17047] BFD ld crashes on cleanup, if MALLOC_PERTURB_ is set,
cvs-commit at gcc dot gnu.org <=
- [Bug ld/17047] BFD ld crashes on cleanup, if MALLOC_PERTURB_ is set, amodra at gmail dot com, 2014/06/13
- [Bug ld/17047] BFD ld crashes on cleanup, if MALLOC_PERTURB_ is set, cvs-commit at gcc dot gnu.org, 2014/06/17