diff options
author | Roland McGrath <roland@redhat.com> | 2007-10-04 08:50:09 +0000 |
---|---|---|
committer | Roland McGrath <roland@redhat.com> | 2007-10-04 08:50:09 +0000 |
commit | 59ea7f33f781e6e3f8c9d81d457e5d99eee8f1ce (patch) | |
tree | 10a3dd35d3b568876f0edc6dd903fe8715a507e1 /libelf/elf_end.c | |
parent | 057ec6b35ef97bd1cf6c1e96da3da399237e5224 (diff) | |
download | android_external_elfutils-59ea7f33f781e6e3f8c9d81d457e5d99eee8f1ce.tar.gz android_external_elfutils-59ea7f33f781e6e3f8c9d81d457e5d99eee8f1ce.tar.bz2 android_external_elfutils-59ea7f33f781e6e3f8c9d81d457e5d99eee8f1ce.zip |
src/
2007-10-04 Roland McGrath <roland@redhat.com>
* readelf.c (print_archive_index): New variable.
(options, parse_opt): Accept -c/--archive-index to set it.
(dump_archive_index): New function.
(process_file): Take new arg WILL_PRINT_ARCHIVE_INDEX.
Call dump_archive_index on archives if set.
(main): Update caller.
(any_control_option): Give it file scope, moved out of ...
(parse_opt): ... here.
tests/
2007-10-04 Roland McGrath <roland@redhat.com>
* run-readelf-test4.sh: New file.
* Makefile.am (TESTS, EXTRA_DIST): Add it.
Diffstat (limited to 'libelf/elf_end.c')
-rw-r--r-- | libelf/elf_end.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/libelf/elf_end.c b/libelf/elf_end.c index 4b4e11fe..5112eaea 100644 --- a/libelf/elf_end.c +++ b/libelf/elf_end.c @@ -1,5 +1,5 @@ /* Free resources associated with Elf descriptor. - Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2005 Red Hat, Inc. + Copyright (C) 1998,1999,2000,2001,2002,2004,2005,2007 Red Hat, Inc. This file is part of Red Hat elfutils. Written by Ulrich Drepper <drepper@redhat.com>, 1998. @@ -89,7 +89,8 @@ elf_end (elf) descriptor. The long name table cannot be freed yet since the archive headers for the ELF files in the archive point into this array. */ - free (elf->state.ar.ar_sym); + if (elf->state.ar.ar_sym != (Elf_Arsym *) -1l) + free (elf->state.ar.ar_sym); elf->state.ar.ar_sym = NULL; if (elf->state.ar.children != NULL) @@ -134,6 +135,21 @@ elf_end (elf) case ELF_K_ELF: { + Elf_Data_Chunk *rawchunks + = (elf->class == ELFCLASS32 + || (offsetof (struct Elf, state.elf32.rawchunks) + == offsetof (struct Elf, state.elf64.rawchunks)) + ? elf->state.elf32.rawchunks + : elf->state.elf64.rawchunks); + while (rawchunks != NULL) + { + Elf_Data_Chunk *next = rawchunks->next; + if (rawchunks->dummy_scn.flags & ELF_F_MALLOCED) + free (rawchunks->data.d.d_buf); + free (rawchunks); + rawchunks = next; + } + Elf_ScnList *list = (elf->class == ELFCLASS32 || (offsetof (struct Elf, state.elf32.scns) == offsetof (struct Elf, state.elf64.scns)) |