diff options
author | Jan Kratochvil <[email protected]> | 2011-02-27 12:01:25 -0800 |
---|---|---|
committer | Roland McGrath <[email protected]> | 2011-02-27 12:01:25 -0800 |
commit | fec3999dc82e340bdcb41aefca2793f0b10cb825 (patch) | |
tree | aa6de6084b8edc688b5274a8f0fcd53ecb84f0a1 | |
parent | cf454ab68981584c50ad28133c7065344f06db80 (diff) |
Fix readelf --debug-dump=loc crash on multiple input files.
-rw-r--r-- | src/ChangeLog | 4 | ||||
-rw-r--r-- | src/readelf.c | 1 | ||||
-rw-r--r-- | tests/ChangeLog | 5 | ||||
-rw-r--r-- | tests/Makefile.am | 2 | ||||
-rwxr-xr-x | tests/run-readelf-twofiles.sh | 32 |
5 files changed, 43 insertions, 1 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 5ef2aec2..35d5f097 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2011-02-27 Jan Kratochvil <[email protected]> + + * readelf.c (reset_listptr): Clear TABLE->TABLE. + 2011-02-25 Mark Wielaard <[email protected]> * readelf.c (dwarf_attr_string): Add DW_AT_GNU_* handling. diff --git a/src/readelf.c b/src/readelf.c index b798b5ac..956d8bd4 100644 --- a/src/readelf.c +++ b/src/readelf.c @@ -4363,6 +4363,7 @@ static void reset_listptr (struct listptr_table *table) { free (table->table); + table->table = NULL; table->n = table->alloc = 0; } diff --git a/tests/ChangeLog b/tests/ChangeLog index bc788431..16eb7d5f 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,8 @@ +2011-02-27 Jan Kratochvil <[email protected]> + + * Makefile.am (TESTS): Add run-readelf-twofiles.sh. + * run-readelf-twofiles.sh: New file. + 2011-02-02 Josh Stone <[email protected]> * run-prelink-addr-test.sh: Add testfile55, 32 and 64-bit. diff --git a/tests/Makefile.am b/tests/Makefile.am index b317553d..dcdc0d8e 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -76,7 +76,7 @@ TESTS = run-arextract.sh run-arsymtest.sh newfile test-nlist \ run-addrscopes.sh run-strings-test.sh run-funcscopes.sh \ run-find-prologues.sh run-allregs.sh \ run-readelf-test1.sh run-readelf-test2.sh run-readelf-test3.sh \ - run-readelf-test4.sh \ + run-readelf-test4.sh run-readelf-twofiles.sh \ run-native-test.sh run-bug1-test.sh \ dwfl-bug-addr-overflow run-addrname-test.sh \ dwfl-bug-fd-leak dwfl-bug-report \ diff --git a/tests/run-readelf-twofiles.sh b/tests/run-readelf-twofiles.sh new file mode 100755 index 00000000..4255587c --- /dev/null +++ b/tests/run-readelf-twofiles.sh @@ -0,0 +1,32 @@ +#! /bin/sh +# Copyright (C) 2011 Red Hat, Inc. +# This file is part of Red Hat elfutils. +# +# Red Hat elfutils is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by the +# Free Software Foundation; version 2 of the License. +# +# Red Hat elfutils is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with Red Hat elfutils; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. +# +# Red Hat elfutils is an included package of the Open Invention Network. +# An included package of the Open Invention Network is a package for which +# Open Invention Network licensees cross-license their patents. No patent +# license is granted, either expressly or impliedly, by designation as an +# included package. Should you wish to participate in the Open Invention +# Network licensing program, please visit www.openinventionnetwork.com +# <http://www.openinventionnetwork.com>. + +. $srcdir/test-subr.sh + +testfiles testfile14 + +testrun >/dev/null ../src/readelf -w testfile14 testfile14 + +exit 0 |