From: "mark at klomp dot org" <sourceware-bugzilla@sourceware.org>
To: elfutils-devel@sourceware.org
Subject: [Bug general/27367] readelf: invalid loclists data with -ffat-lto-objects
Date: Mon, 08 Feb 2021 11:14:16 +0000 [thread overview]
Message-ID: <bug-27367-10460-rTcq1vPt8i@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-27367-10460@http.sourceware.org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=27367
Mark Wielaard <mark at klomp dot org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Ever confirmed|0 |1
Last reconfirmed| |2021-02-08
Status|UNCONFIRMED |NEW
CC| |mark at klomp dot org
--- Comment #4 from Mark Wielaard <mark at klomp dot org> ---
Same for git HEAD/0.183
Without -flto and -ffat-lto-objects this looks like:
DWARF section [ 7] '.debug_loclists' at offset 0xff:
Table at Offset 0x0:
Length: 24
DWARF version: 5
Address size: 8
Segment size: 0
Offset entries: 0
CU [ c] base: .text+000000000000000000 <main_argc>
Offset: c, Index: 0
view pair 2, 3
Offset: e, Index: 2
start_length 0x0, 0
.text+000000000000000000 <main_argc>..
0xffffffffffffffff
[ 0] lit0
[ 1] stack_value
end_of_list
Note that it starts with a view pair, and in the non-lto variant eu-readelf
does know which CU this is associated with, while in the lto variant it says
"Not associated with a CU."
The issue seems to be that eu-readelf seeing both .debug_info and
.gnu.debuglto_.debug_info (you get both when using -ffat-lto-objects) picks the
.gnu.debuglto_.debug_info and drops/skips the .debug_info.
The following "fixes" it:
diff --git a/libdw/dwarf_begin_elf.c b/libdw/dwarf_begin_elf.c
index 757ac4fa..49ec0f22 100644
--- a/libdw/dwarf_begin_elf.c
+++ b/libdw/dwarf_begin_elf.c
@@ -137,10 +137,10 @@ check_section (Dwarf *result, size_t shstrndx, Elf_Scn
*scn, bool inscngrp)
gnu_compressed = true;
break;
}
- else if (scnlen > 14 /* .gnu.debuglto_ prefix. */
- && strncmp (scnname, ".gnu.debuglto_", 14) == 0
- && strcmp (&scnname[14], dwarf_scnnames[cnt]) == 0)
- break;
+// else if (scnlen > 14 /* .gnu.debuglto_ prefix. */
+// && strncmp (scnname, ".gnu.debuglto_", 14) == 0
+// && strcmp (&scnname[14], dwarf_scnnames[cnt]) == 0)
+// break;
}
if (cnt >= ndwarf_scnnames)
But of course that breaks showing .gnu.debuglto_ sections...
--
You are receiving this mail because:
You are on the CC list for the bug.
next prev parent reply other threads:[~2021-02-08 11:14 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-08 10:45 [Bug general/27367] New: " mliska at suse dot cz
2021-02-08 10:47 ` [Bug general/27367] " mliska at suse dot cz
2021-02-08 11:09 ` mliska at suse dot cz
2021-02-08 11:10 ` mliska at suse dot cz
2021-02-08 11:14 ` mark at klomp dot org [this message]
2021-11-04 11:14 ` ldv at sourceware dot org
2021-11-04 11:32 ` mark at klomp dot org
2021-11-08 8:48 ` mark at klomp dot org
2021-11-09 18:17 ` mark at klomp dot org
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=bug-27367-10460-rTcq1vPt8i@http.sourceware.org/bugzilla/ \
--to=sourceware-bugzilla@sourceware.org \
--cc=elfutils-devel@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).