summaryrefslogtreecommitdiff
path: root/libebl
diff options
context:
space:
mode:
authorMark Wielaard <mark@klomp.org>2020-04-17 11:31:40 +0200
committerMark Wielaard <mark@klomp.org>2020-04-22 00:02:20 +0200
commitd6185d33fb2a65b4c3cbc73c5529937debdd2568 (patch)
tree28d5992daab9f7a6d631620ee542c39d090bbfe5 /libebl
parente2fc0b737c1d55becda1f13dceec315a5589820a (diff)
downloadelfutils-d6185d33fb2a65b4c3cbc73c5529937debdd2568.tar.gz
libdw, readelf: Handle GCC LTO .gnu.debuglto_ prefix.
GCC puts (partial) DWARF debuginfo into sections prefixed with .gnu.debuglto_. Handle those sections as if they are normal .debug sections (which they are). This allows showing the DWARF that gcc puts into ET_REL files compiled with -flto. Signed-off-by: Mark Wielaard <mark@klomp.org>
Diffstat (limited to 'libebl')
-rw-r--r--libebl/ChangeLog5
-rw-r--r--libebl/eblopenbackend.c4
2 files changed, 8 insertions, 1 deletions
diff --git a/libebl/ChangeLog b/libebl/ChangeLog
index b3287310..90cf9728 100644
--- a/libebl/ChangeLog
+++ b/libebl/ChangeLog
@@ -1,3 +1,8 @@
+2020-04-17 Mark Wielaard <mark@klomp.org>
+
+ * eblopenbackend.c (default_debugscn_p): Handle .gnu.debuglto_
+ prefix.
+
2020-02-08 Mark Wielaard <mark@klomp.org>
* eblsegmenttypename.c (ebl_segment_type_name): Handle
diff --git a/libebl/eblopenbackend.c b/libebl/eblopenbackend.c
index 210b47e8..4ebde45f 100644
--- a/libebl/eblopenbackend.c
+++ b/libebl/eblopenbackend.c
@@ -621,7 +621,9 @@ default_debugscn_p (const char *name)
for (size_t cnt = 0; cnt < ndwarf_scn_names; ++cnt)
if (strcmp (name, dwarf_scn_names[cnt]) == 0
|| (strncmp (name, ".zdebug", strlen (".zdebug")) == 0
- && strcmp (&name[2], &dwarf_scn_names[cnt][1]) == 0))
+ && strcmp (&name[2], &dwarf_scn_names[cnt][1]) == 0)
+ || (strncmp (name, ".gnu.debuglto_", strlen (".gnu.debuglto_")) == 0
+ && strcmp (&name[14], dwarf_scn_names[cnt]) == 0))
return true;
return false;