[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug binutils/22571] libbfd: bfd_get_symtab_upper_bound causes SIGSEGV w
From: |
nickc at redhat dot com |
Subject: |
[Bug binutils/22571] libbfd: bfd_get_symtab_upper_bound causes SIGSEGV when iterating archive files |
Date: |
Fri, 15 Dec 2017 18:57:39 +0000 |
https://sourceware.org/bugzilla/show_bug.cgi?id=22571
Nick Clifton <nickc at redhat dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
CC| |nickc at redhat dot com
Resolution|--- |FIXED
--- Comment #3 from Nick Clifton <nickc at redhat dot com> ---
Hi Jonathan,
This is a documentation error. You need to call bfd_check_format() on
each element in the archive before attempting to process it. Ie your
code should look like this:
while ((file = bfd_openr_next_archived_file(archive, file)) != NULL) {
printf("File: %s\n", file->filename);
if (! bfd_check_format (file, bfd_object))
break;
long storage_needed = bfd_get_symtab_upper_bound(file);
printf(" symbol table: %li bytes\n", storage_needed);
}
I have checked in a small patch to update the documentation.
Cheers
Nick
--
You are receiving this mail because:
You are on the CC list for the bug.