summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoland McGrath <roland@redhat.com>2010-06-01 13:44:00 -0700
committerRoland McGrath <roland@redhat.com>2010-06-01 13:44:00 -0700
commit7a5bed8919f2a1dace847a33a78dbbb86a8e7eb9 (patch)
treec9523dbadc75285b946c9cb72cd19f0d3a8b0aa0
parent50aa8d16dad005de413e19ecbac9447865b1f013 (diff)
downloadelfutils-7a5bed8919f2a1dace847a33a78dbbb86a8e7eb9.tar.gz
readelf: Print .eh_frame even with no other DWARF.
-rw-r--r--src/ChangeLog5
-rw-r--r--src/readelf.c7
2 files changed, 10 insertions, 2 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 1b803b0f..4a6389ae 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
+2010-06-01 Roland McGrath <roland@redhat.com>
+
+ * readelf.c (print_debug): Don't bail if libdw setup fails.
+ Suppress complaint if we only want .eh_frame anyway.
+
2010-05-28 Ulrich Drepper <drepper@redhat.com>
* readelf.c (attr_callback): Also print form information.
diff --git a/src/readelf.c b/src/readelf.c
index dc368c26..0d8c4315 100644
--- a/src/readelf.c
+++ b/src/readelf.c
@@ -6503,12 +6503,15 @@ print_debug (Dwfl_Module *dwflmod, Ebl *ebl, GElf_Ehdr *ehdr)
/* Before we start the real work get a debug context descriptor. */
Dwarf_Addr dwbias;
Dwarf *dbg = dwfl_module_getdwarf (dwflmod, &dwbias);
+ Dwarf dummy_dbg = { .other_byte_order = MY_ELFDATA != ehdr->e_ident[EI_DATA] };
if (dbg == NULL)
{
- if (print_debug_sections != 0)
+ if ((print_debug_sections & ~section_exception) != 0)
error (0, 0, gettext ("cannot get debug context descriptor: %s"),
dwfl_errmsg (-1));
- return;
+ if ((print_debug_sections & section_exception) == 0)
+ return;
+ dbg = &dummy_dbg;
}
/* Get the section header string table index. */