From: Daniel Berlin <dberlin@dberlin.org>
To: Jim Blandy <jimb@red-bean.com>
Cc: binutils@sourceware.org, gdb-patches@sourceware.org
Subject: Re: linker debug info editing
Date: Tue, 14 Mar 2006 15:10:00 -0000 [thread overview]
Message-ID: <1142281149.20401.84.camel@dyn9002219123> (raw)
In-Reply-To: <1142217868.20401.15.camel@linux.site>
> I spent a large amount of time when we were implementing
> -feliminate-dwarf2-dups measuring the cost of various schemes for
> deciding what to try to split and what not.
Oh, i forgot the other half of problems.
If you don't do something like split every die, then you get into things
where you have to name the linkonce sections by the content (using md5
hashes or something), so that you'd don't accidently eliminate one set
of dies that really isn't an exact duplicate of some other.
Once you do this you get hit with ordering issues if the include files
in something else are in a slightly different order, and this causes the
md5's to be different.
*or* you hit the problem that you may not split exactly the same (due to
ordering, more dies, etc), and thus, the dies in one split CU may be
different than another, and thus, will not be commoned (because they
will have different linkonce section names from the content hash)
If you do something obvious like split every type/subprogram die into
it's own section, and linkonce those, the cost in .o files is enormous.
Then, for each type DIE, you have:
12 bytes for a debug_info header
~10-20 bytes of extra overhead from using dw_form_refaddr references
(assuming it is referenced ~3-5 times)
30 bytes for the new section name (.debug_info.linkonce.<16 byte md5>)
10+ bytes (i forget the number) for the extra section table entry you've
added
10+ bytes for the extra symbol you need to reference the thing
everywhere else
It ends up being about 100 bytes per die you put into it's own CU
If you have a C++ app, and 5000 types, you've just wasted 500k.
I had tried this scheme once, and it usually doubled (or more) the size
of the .o files.
IOW, it's always a better idea to eliminate in the linker if possible,
which has *none* of these issues.
It's hard work, but straightforward there if you have all the info you
need.
next prev parent reply other threads:[~2006-03-13 20:19 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-10 19:44 Alan Modra
2006-03-10 20:06 ` James E Wilson
2006-03-10 20:16 ` Daniel Jacobowitz
2006-03-12 7:58 ` Jim Blandy
2006-03-13 12:53 ` Daniel Berlin
2006-03-13 20:19 ` Alan Modra
2006-03-14 15:10 ` Daniel Berlin [this message]
2006-03-13 4:59 ` Daniel Jacobowitz
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=1142281149.20401.84.camel@dyn9002219123 \
--to=dberlin@dberlin.org \
--cc=binutils@sourceware.org \
--cc=gdb-patches@sourceware.org \
--cc=jimb@red-bean.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