From: Mark Wielaard <mark@klomp.org>
To: David Blaikie <dblaikie@gmail.com>
Cc: Fangrui Song <maskray@google.com>,
gdb@sourceware.org, elfutils-devel@sourceware.org,
binutils@sourceware.org
Subject: Re: Range lists, zero-length functions, linker gc
Date: Mon, 1 Jun 2020 00:29:37 +0200 [thread overview]
Message-ID: <20200531222937.GM44629@wildebeest.org> (raw)
In-Reply-To: <CAENS6Esjx0HQpviW=ZrA4O3Bza7JDOpoqe3fLxqmLZ4TZsv-9w@mail.gmail.com>
Hi,
On Sun, May 31, 2020 at 01:49:12PM -0700, David Blaikie wrote:
> On Sun, May 31, 2020 at 1:41 PM Mark Wielaard <mark@klomp.org> wrote:
> > On Sun, May 31, 2020 at 11:55:06AM -0700, Fangrui Song via Elfutils-devel wrote:
> > > I am eager to know what you think
> > > of the ideas from binutils/gdb/elfutils's perspective.
> >
> > I think this is a producer problem. If a (code) section can be totally
> > dropped then the associated (.debug) sections should have been
> > generated together with that (code) section in a COMDAT group. That
> > way when the linker drops that section, all the associated sections in
> > that COMDAT group will get dropped with it. If you don't do that, then
> > the DWARF is malformed and there is not much a consumer can do about
> > it.
> >
> > Said otherwise, I don't think it is correct for the linker (with
> > --gc-sections) to drop any sections that have references to it
> > (through relocation symbols) from other (.debug) sections.
>
> That's probably not practical for at least some users - the
> easiest/most thorough counter-example is Split DWARF - the DWARF is in
> another file the linker can't see. All the linker sees is a list of
> addresses (debug_addr).
I might be missing something, but I think this works fine with Split
DWARF. As long as you make sure that the .dwo files/sections are
separated along the same lines as the ELF section groups are. That
means each section group either gets its own .dwo file, or you
generate the .dwo sections in the same section group in the same
object file using the SHF_EXCLUDED trick. That way each .debug.dwo
uses their own index into the separate .debug_addr tables. If that
group, with the .debug_addr table, gets discarded, then the reference
to the .dwo also disappears and it simply won't be used.
Cheers,
Mark
next prev parent reply other threads:[~2020-05-31 22:30 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-31 18:55 Fangrui Song
2020-05-31 19:15 ` Fangrui Song
2020-05-31 20:10 ` Mark Wielaard
2020-05-31 20:47 ` Fangrui Song
2020-05-31 22:11 ` Mark Wielaard
2020-05-31 23:17 ` David Blaikie
2020-05-31 20:49 ` David Blaikie
2020-05-31 22:29 ` Mark Wielaard [this message]
2020-05-31 22:36 ` David Blaikie
2020-06-01 9:31 ` Mark Wielaard
2020-06-01 20:18 ` David Blaikie
2020-06-02 16:50 ` Mark Wielaard
2020-06-02 18:06 ` David Blaikie
2020-06-03 3:10 ` Alan Modra
2020-06-03 4:06 ` Fangrui Song
2020-06-03 21:50 ` David Blaikie
2020-06-09 20:24 ` Tombstone values in debug sections (was: Range lists, zero-length functions, linker gc) Fangrui Song
2020-06-19 20:04 ` Mark Wielaard
2020-06-20 1:02 ` David Blaikie
2020-06-19 12:00 ` Range lists, zero-length functions, linker gc Mark Wielaard
2020-06-20 0:46 ` David Blaikie
2020-06-24 22:21 ` Mark Wielaard
2020-06-25 23:45 ` David Blaikie
2020-05-31 21:33 ` David Blaikie
2020-06-01 16:25 ` Andrew Burgess
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=20200531222937.GM44629@wildebeest.org \
--to=mark@klomp.org \
--cc=binutils@sourceware.org \
--cc=dblaikie@gmail.com \
--cc=elfutils-devel@sourceware.org \
--cc=gdb@sourceware.org \
--cc=maskray@google.com \
/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