public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: David Blaikie <dblaikie@gmail.com>
To: Alan Modra <amodra@gmail.com>
Cc: Mark Wielaard <mark@klomp.org>,
	gdb@sourceware.org, elfutils-devel@sourceware.org,
	 binutils@sourceware.org, Fangrui Song <maskray@google.com>
Subject: Re: Range lists, zero-length functions, linker gc
Date: Wed, 3 Jun 2020 14:50:49 -0700	[thread overview]
Message-ID: <CAENS6EvzJh6Z_XaqOWg+f0k0grXzBVSruHNvJSy=fNaakOtxcQ@mail.gmail.com> (raw)
In-Reply-To: <20200603031040.GD29024@bubble.grove.modra.org>

On Tue, Jun 2, 2020 at 8:10 PM Alan Modra <amodra@gmail.com> wrote:
>
> On Tue, Jun 02, 2020 at 11:06:10AM -0700, David Blaikie via Binutils wrote:
> > On Tue, Jun 2, 2020 at 9:50 AM Mark Wielaard <mark@klomp.org> wrote:
> > > where I
> > > would argue the compiler simply needs to make sure that if it generates
> > > code in separate sections it also should create the DWARF separate
> > > section (groups).
> >
> > I don't think that's practical - the overhead, I believe, is too high.
> > Headers for each section contribution (ELF headers but DWARF headers
> > moreso - having a separate .debug_addr, .debug_line, etc section for
> > each function would be very expensive) would make for very large
> > object files.
>
> With a little linker magic I don't see the neccesity of duplicating
> the DWARF headers.  Taking .debug_line as an example, a compiler could
> emit the header, opcode, directory and file tables to a .debug_line
> section with line statements for function foo emitted to
> .debug_line.foo and for bar to .debug_line.bar, trusting that the
> linker will combine these sections in order to create an output
> .debug_line section.  If foo code is excluded then .debug_line.foo
> info will also be dropped if section groups are used.

I don't think this would apply to debug_addr - where the entries are
referenced from elsewhere via index, or debug_rnglist where the
rnglist header (or the debug_info directly) contains offsets into this
section, so taking chunks out would break those offsets. (or to the
file/directory name part of debug_line - where you might want to
remove file/line entries that were eliminated as dead code - but
that'd throw off the indexes)

  parent reply	other threads:[~2020-06-03 21:51 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
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 [this message]
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='CAENS6EvzJh6Z_XaqOWg+f0k0grXzBVSruHNvJSy=fNaakOtxcQ@mail.gmail.com' \
    --to=dblaikie@gmail.com \
    --cc=amodra@gmail.com \
    --cc=binutils@sourceware.org \
    --cc=elfutils-devel@sourceware.org \
    --cc=gdb@sourceware.org \
    --cc=mark@klomp.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).