summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRoland McGrath <roland@redhat.com>2008-12-03 03:41:58 +0000
committerRoland McGrath <roland@redhat.com>2008-12-03 03:41:58 +0000
commita845f68bf43f90e0670ed6b33154f2aff98ad46b (patch)
tree3bc6809479ef0de95b106f0f8616ca8cb0c02cc2 /src
parenta4c9d281616090c46ffc4fc3234d64e915008e1a (diff)
downloadelfutils-a845f68bf43f90e0670ed6b33154f2aff98ad46b.tar.gz
src/
2008-12-02 Roland McGrath <roland@redhat.com> * readelf.c (count_dwflmod, process_file): Don't presume encoding of nonzero OFFSET argument to dwfl_getmodules.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog5
-rw-r--r--src/readelf.c13
2 files changed, 14 insertions, 4 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 4ef23a22..fb17835f 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
+2008-12-02 Roland McGrath <roland@redhat.com>
+
+ * readelf.c (count_dwflmod, process_file): Don't presume encoding of
+ nonzero OFFSET argument to dwfl_getmodules.
+
2008-08-07 Roland McGrath <roland@redhat.com>
* addr2line.c (main): Pass string to handle_address.
diff --git a/src/readelf.c b/src/readelf.c
index 7b599ec8..2797a849 100644
--- a/src/readelf.c
+++ b/src/readelf.c
@@ -459,8 +459,10 @@ count_dwflmod (Dwfl_Module *dwflmod __attribute__ ((unused)),
Dwarf_Addr base __attribute__ ((unused)),
void *arg)
{
- *(bool *) arg = false;
- return DWARF_CB_ABORT;
+ if (*(bool *) arg)
+ return DWARF_CB_ABORT;
+ *(bool *) arg = true;
+ return DWARF_CB_OK;
}
struct process_dwflmod_args
@@ -548,8 +550,11 @@ process_file (int fd, const char *fname, bool only_one)
dwfl_report_end (dwfl, NULL, NULL);
if (only_one)
- /* Clear ONLY_ONE if we have multiple modules, from an archive. */
- dwfl_getmodules (dwfl, &count_dwflmod, &only_one, 1);
+ {
+ /* Clear ONLY_ONE if we have multiple modules, from an archive. */
+ bool seen = false;
+ only_one = dwfl_getmodules (dwfl, &count_dwflmod, &seen, 0) == 0;
+ }
/* Process the one or more modules gleaned from this file. */
struct process_dwflmod_args a = { .fd = fd, .only_one = only_one };