<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>>As for reducing debug info size by omitting debug info
descriptions of dead code - Apple/MachO's dsymutil does this, and
I believe Alexey Lapshin is working on trying to get similar
behavior into lld, possibly (or as a post-link tool).<br>
<br>
yep. I am working on the tool similar to dsymutil but for
non-darwin platform. dsymutil is able to remove all unreferenced
debug info. That work is currently in progress. It has two main
parts:</p>
<p>1) speedup DWARFLinker library and reduce final debug info size -
<a class="moz-txt-link-freetext" href="https://reviews.llvm.org/D96035">https://reviews.llvm.org/D96035</a><br>
2) create a post link tool using DWARFLinker library to do similar
functionality as dsymutil does - <a class="moz-txt-link-freetext" href="https://reviews.llvm.org/D86539">https://reviews.llvm.org/D86539</a>
<a class="moz-txt-link-freetext" href="https://reviews.llvm.org/D88827">https://reviews.llvm.org/D88827</a><br>
</p>
<p>Alexey.<br>
</p>
<div class="moz-cite-prefix">On 30.09.2021 09:51, David Blaikie
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAENS6Eu6LaOTZpi1Gt_JNic2mAZf3RgfRFzLSuh22MtbG--uCQ@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">
<div dir="ltr">You can differentiate dead function descriptions
from others on most platforms by checking if the low_pc == 0.
If 0 is a valid instruction address on your architecture, you
can use an lld feature to set a more authoritative/unambiguous
tombstone value for dead code addresses, passing something
like:<br>
<pre style="white-space:pre-wrap;color:rgb(0,0,0)"><i> -z 'dead-reloc-in-nonalloc=.debug_ranges=0xfffffffffffffffe'
</i><i> -z 'dead-reloc-in-nonalloc=.debug_loc=0xfffffffffffffffe'
</i><i> -z 'dead-reloc-in-nonalloc=.debug_*=0xffffffffffffffff'
</i></pre>
</div>
to the linker.<br>
<br>
As for reducing debug info size by omitting debug info
descriptions of dead code - Apple/MachO's dsymutil does this,
and I believe Alexey Lapshin is working on trying to get similar
behavior into lld, possibly (or as a post-link tool).<br>
<br>
There's also the possibility of using comdats to make the
linker's job easier - I think there might be ways to structure
the DWARF into chunks that could be deduplicated and dropped
naturally by a linker's existing comdat support, but I haven't
fully prototyped it. I think there was a thread a while back
with JHenderson and others discussing this possibility further.<br>
<br>
- Dave<br>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Wed, Sep 29, 2021 at
12:50 PM Youssefi, Anna via llvm-dev <<a
href="mailto:llvm-dev@lists.llvm.org"
moz-do-not-send="true">llvm-dev@lists.llvm.org</a>>
wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex">
<div lang="EN-US">
<div class="gmail-m_-4019873380599080817WordSection1">
<p class="MsoNormal">Hi,</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">I was wondering if there are any
plans to separate debug information into distinct
sections accordingly when the compiler flags
-ffunction-sections and/or -fdata-sections are used.
If an unreferenced function is removed from the link,
it makes no sense for its associated debug information
to still be included. As we rely on the debug
information for stack usage analysis, we wind up
displaying stack usage statistics for unreferenced
functions that were eliminated from the link if debug
information for any other referenced functions is in
the same debug section. It seems that others have run
into this problem previously so I wanted to check
whether there are any plans to change the behavior.</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">Thanks,</p>
<p class="MsoNormal">Anna Youssefi</p>
<p class="MsoNormal">Texas Instruments, Codegen group</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"> </p>
</div>
</div>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank"
moz-do-not-send="true">llvm-dev@lists.llvm.org</a><br>
<a
href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev"
rel="noreferrer" target="_blank" moz-do-not-send="true">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote>
</div>
</div>
</blockquote>
</body>
</html>