<div dir="ltr">ICF: Identical Code Folding <br><br>Linker deduplicates functions by collapsing any identical functions together - with icf=safe, the linker looks at a .addressing section in the object file and any functions listed in that section are not treated as collapsible (eg: because they need to meet C++'s "distinct functions have distinct addresses" guarantee)</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Mar 22, 2021 at 6:16 PM Philip Reames via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">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>
<p>Can you define ICF please? And give a bit of context?<br>
</p>
<p>Philip<br>
</p>
<div>On 3/22/21 5:27 PM, Zequan Wu via
llvm-dev wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">Hi all,
<div><br>
</div>
<div>Background:</div>
<div>It's been a longstanding difficulty of debugging with ICF.
Programmers don't have control over which sections should be
folded by ICF, which sections shouldn't. The existing address
significant table won't have effect for code sections during
all ICF mode in both ld.lld and lld-link. By switching to safe
ICF could mark code sections as unique, but at a cost of
increasing binary size out of control. So, it would be good if
programmers could selectively disable ICF in source code by
annotating global functions/variables with an attribute to
improve debugging experience and have the control on the
binary size increase. </div>
<div><br>
</div>
<div>My plan is to add a new section table(`.no_icf`) to object
files. Sections of all symbols inside the table should not be
folded by all ICF mode. And symbols can only be added into the
table by annotating global functions/variables with a new
attribute(`no_icf`) in source code. </div>
<div><br>
</div>
<div>What do you think about this approach?</div>
<div><br>
</div>
<div>Thanks,</div>
<div>Zequan</div>
<div><br>
</div>
</div>
<br>
<fieldset></fieldset>
<pre>_______________________________________________
LLVM Developers mailing list
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a>
</pre>
</blockquote>
</div>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div>