<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" style="display:none"><!-- p { margin-top: 0px; margin-bottom: 0px; } @font-face { font-family: "Cambria Math"; } @font-face { font-family: Calibri; } @font-face { font-family: Tahoma; } p.MsoNormal, li.MsoNormal, div.MsoNormal { margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; } a:link, span.MsoHyperlink { color: blue; text-decoration: underline; } a:visited, span.MsoHyperlinkFollowed { color: purple; text-decoration: underline; } p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph { margin: 0in 0in 0.0001pt 0.5in; font-size: 11pt; font-family: Calibri, sans-serif; } p.msonormal0, li.msonormal0, div.msonormal0 { margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; } p.msonormal00, li.msonormal00, div.msonormal00 { margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; } p.msochpdefault, li.msochpdefault, div.msochpdefault { margin: 0in 0in 0.0001pt; font-size: 10pt; font-family: Calibri, sans-serif; } span.emailstyle19 { font-family: Calibri, sans-serif; color: windowtext; font-weight: normal; font-style: normal; } span.EmailStyle23 { font-family: Calibri, sans-serif; color: windowtext; font-weight: normal; font-style: normal; } .MsoChpDefault { font-size: 10pt; } @page WordSection1 { margin: 1in; } div.WordSection1 { }--></style>
</head>
<body dir="ltr" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<p>On the other hand, in this case, you have to deal with lots of small sections. I can't say for sure, which variant is quicker. Anyway, lld doesn't do deep parsing of .eh_frame sections currently, nor need it for GC. Just splits them into FDEs and CIEs and
then analyzes corresponding relocations. Thus, the amount of required work is more or less the same, whether we have separate sections or have to split the monolithic one.<br>
</p>
<p><br>
</p>
<div id="Signature">
<div name="divtagdefaultwrapper" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:; margin:0">
<div style="color:rgb(33,33,33); font-family:"Segoe UI","Segoe WP","Segoe UI WPC",Tahoma,Arial,sans-serif; font-size:15px; background-color:rgb(255,255,255); margin:0px">
<span style="font-size:10.5pt; font-family:Calibri,sans-serif">Best Regards,</span></div>
<div style="color:rgb(33,33,33); font-family:"Segoe UI","Segoe WP","Segoe UI WPC",Tahoma,Arial,sans-serif; font-size:15px; background-color:rgb(255,255,255); margin:0px">
<font face="Calibri,sans-serif" size="2"><span style="font-size:11pt"><font size="2"><span lang="en-US" style="font-size:10.5pt">Igor Kudrin</span></font></span></font></div>
<div style="color:rgb(33,33,33); font-family:"Segoe UI","Segoe WP","Segoe UI WPC",Tahoma,Arial,sans-serif; font-size:15px; background-color:rgb(255,255,255); margin:0px">
<font face="Calibri,sans-serif" size="2"><span style="font-size:11pt"><font size="2"><span lang="en-US" style="font-size:10.5pt">C++ Developer,</span></font></span></font><span style="font-family:Calibri,sans-serif; font-size:14.6667px"> </span><span style="font-family:Calibri,sans-serif; font-size:14.6667px">Access
Softek, Inc.</span></div>
</div>
</div>
<div style="color: rgb(33, 33, 33);">
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Evgeny Astigeevich <Evgeny.Astigeevich@arm.com><br>
<b>Sent:</b> Friday, November 10, 2017 8:27 PM<br>
<b>To:</b> Igor Kudrin<br>
<b>Cc:</b> nd; llvm-dev@lists.llvm.org<br>
<b>Subject:</b> Re: [llvm-dev] [RFC] Making .eh_frame more linker-friendly</font>
<div> </div>
</div>
<div>
<div class="WordSection1">
<p class="MsoNormal" style="background:white"><span style="color:#212121">> But if we still need to deal with CIEs and generate .eh_frame_hdr in a special way,</span></p>
<p class="MsoNormal" style="background:white"><span style="color:#212121">> does it make sense to make this change to simplify only a small part of a linker?</span></p>
<p class="MsoNormal"><span style=""> </span></p>
<p class="MsoNormal"><span style="">For huge C++ projects this could improve link time if GC is a bottleneck. It will also improve eh_frame_hdr build time because you don’t spend time on parsing garbage. However a linker will have to have two versions of GC:
one with parsing eh_frames and another without parsing. There can be input object files where .eh_frame is not split.
</span></p>
<p class="MsoNormal"><span style=""> </span></p>
<p class="MsoNormal"><span style="">-Evgeny</span></p>
<p class="MsoNormal"><span style=""> </span></p>
<div style="border:none; border-top:solid #B5C4DF 1.0pt; padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:12.0pt; color:black">From: </span>
</b><span style="font-size:12.0pt; color:black">Igor Kudrin <ikudrin@accesssoftek.com><br>
<b>Date: </b>Friday, 10 November 2017 at 12:23<br>
<b>To: </b>Evgeny Astigeevich <Evgeny.Astigeevich@arm.com><br>
<b>Cc: </b>nd <nd@arm.com>, "llvm-dev@lists.llvm.org" <llvm-dev@lists.llvm.org><br>
<b>Subject: </b>Re: [llvm-dev] [RFC] Making .eh_frame more linker-friendly</span></p>
</div>
<div>
<p class="MsoNormal"> </p>
</div>
<p>Hi Evgeny,</p>
<p> </p>
<p class="MsoNormal" style="background:white"><span style="color:#212121">> Yes, a linker needs some details but not all of them. It needs to know sizes of records and initial locations (PC Begin) to find out which functions FDEs belong to.</span></p>
<div>
<p class="MsoNormal"><br>
So, it still needs some details. Not all of them, but anyway, handling of .eh_frame sections is still a special case, even if we split all the content at compile time.</p>
</div>
<p> </p>
<p class="MsoNormal" style="background:white"><span style="color:#212121">> What do you mean “one place or two”?</span></p>
<p class="MsoNormal" style="background:white"><span style="color:#212121"> </span></p>
<p class="MsoNormal" style="background:white"><span style="color:#212121">If I understand it right, the RFC is about helping a linker to eliminate unneeded .eh_frame items when performing GC. But if we still need to deal with CIEs and generate .eh_frame_hdr
in a special way, does it make sense to make this change to simplify only a small part of a linker?</span></p>
<p class="MsoNormal" style="background:white"><span style="color:#212121"> </span></p>
<div id="Signature">
<div name="divtagdefaultwrapper">
<div>
<p class="MsoNormal" style="background:white"><span style="font-size:10.5pt; color:#212121">Best Regards,</span><span style="font-size:11.5pt; font-family:"Tahoma",sans-serif; color:#212121"></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span lang="EN-US" style="font-size:10.5pt; color:#212121">Igor Kudrin</span><span style="font-size:11.5pt; font-family:"Tahoma",sans-serif; color:#212121"></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span lang="EN-US" style="font-size:10.5pt; color:#212121">C++ Developer,</span><span style="color:#212121"> Access Softek, Inc.</span><span style="font-size:11.5pt; font-family:"Tahoma",sans-serif; color:#212121"></span></p>
</div>
</div>
</div>
<div>
<div class="MsoNormal" align="center" style="text-align:center"><span style="color:#212121">
<hr size="2" width="98%" align="center">
</span></div>
<div id="divRplyFwdMsg">
<p class="MsoNormal"><b><span style="color:black">From:</span></b><span style="color:black"> llvm-dev <llvm-dev-bounces@lists.llvm.org> on behalf of Evgeny Astigeevich via llvm-dev <llvm-dev@lists.llvm.org><br>
<b>Sent:</b> Friday, November 10, 2017 6:41 PM<br>
<b>To:</b> Igor Kudrin<br>
<b>Cc:</b> llvm-dev@lists.llvm.org; nd<br>
<b>Subject:</b> Re: [llvm-dev] [RFC] Making .eh_frame more linker-friendly</span><span style="color:#212121">
</span></p>
<div>
<p class="MsoNormal"><span style="color:#212121"> </span></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"><span style="color:#212121">Hi Igor,</span></p>
<p class="MsoNormal"><span style="color:#212121"> </span></p>
<p class="MsoNormal"><span style="color:#212121">> It sounds like the linker has to be aware of the .eh_frame section details to be able to generate .eh_frame_hdr and eliminate duplicate CIEs, right?</span></p>
<p class="MsoNormal"><span style="color:#212121"> </span></p>
<p class="MsoNormal"><span style="color:#212121">Yes, a linker needs some details but not all of them. It needs to know sizes of records and initial locations (PC Begin) to find out which functions FDEs belong to.</span></p>
<p class="MsoNormal"><span style="color:#212121"> </span></p>
<p class="MsoNormal"><span style="color:#212121">> So, is there any difference whether it knows that in one place or two?</span></p>
<p class="MsoNormal"><span style="color:#212121"> </span></p>
<p class="MsoNormal"><span style="color:#212121">What do you mean “one place or two”? If .eh_frame_hdr is not created a linker does not need to parse .eh_frame sections. It simply merges them into one section. The format of .eh_frame allows to do this without
parsing .eh_frame sections.</span></p>
<p class="MsoNormal"><span style="color:#212121"> </span></p>
<p class="MsoNormal"><span style="color:#212121">Thanks,</span></p>
<p class="MsoNormal"><span style="color:#212121">Evgeny Astigeevich</span></p>
<p class="MsoNormal"><span style="color:#212121"> </span></p>
<div style="border:none; border-top:solid #B5C4DF 1.0pt; padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:12.0pt; color:black">From: </span>
</b><span style="font-size:12.0pt; color:black">Igor Kudrin <ikudrin.dev@gmail.com><br>
<b>Date: </b>Thursday, 9 November 2017 at 11:29<br>
<b>To: </b>Rui Ueyama <ruiu@google.com>, Evgeny Astigeevich <Evgeny.Astigeevich@arm.com><br>
<b>Cc: </b>"llvm-dev@lists.llvm.org" <llvm-dev@lists.llvm.org>, nd <nd@arm.com><br>
<b>Subject: </b>Re: [llvm-dev] [RFC] Making .eh_frame more linker-friendly</span><span style="color:#212121"></span></p>
</div>
<div>
<p class="MsoNormal"><span style="color:#212121"> </span></p>
</div>
<p><a name="_MailOriginalBody"><span style="color:#212121">It sounds like the linker has to be aware of the .eh_frame section details to be able to generate .eh_frame_hdr and eliminate duplicate CIEs, right?</span></a></p>
<p><span style=""><span style="color:#212121">So, is there any difference whether it knows that in one place or two?</span></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span style=""><span style="color:#212121">Best Regards,<br>
Igor Kudrin<br>
C++ Developer, Access Softek, Inc.</span></span></p>
<div>
<p class="MsoNormal"><span style=""><span style="color:#212121">On 27-Oct-17 3:43, Rui Ueyama via llvm-dev wrote:</span></span></p>
</div>
<blockquote style="margin-top:5.0pt; margin-bottom:5.0pt">
<div>
<div>
<div>
<p class="MsoNormal"><span style=""><span style="color:#212121">On Thu, Oct 26, 2017 at 1:13 PM, Evgeny Astigeevich <</span></span><a href="mailto:Evgeny.Astigeevich@arm.com" target="_blank"><span style="">Evgeny.Astigeevich@arm.com</span><span style=""></span></a><span style=""><span style="color:#212121">>
wrote:</span></span></p>
<blockquote style="border:none; border-left:solid #CCCCCC 1.0pt; padding:0in 0in 0in 6.0pt; margin-left:4.8pt; margin-top:5.0pt; margin-right:0in; margin-bottom:5.0pt">
<div>
<div>
<p class="MsoNormal"><span style=""><span style="color:#212121">Hi,</span></span></p>
<p class="MsoNormal"><span style=""><span style="color:#212121"> </span></span></p>
<p class="MsoNormal"><span style=""><span style="color:#212121">There will be problems with eh_frame_hdr. Eh_frame_hdr is needed to use the binary search instead of the linear search. Having eh_frame per a function will cause no eh_frame_hdr or multiple eh_frame_hdr
and will degrade search from binary to linear.</span></span></p>
</div>
</div>
</blockquote>
<div>
<p class="MsoNormal"><span style=""><span style="color:#212121"> </span></span></p>
</div>
<div>
<p class="MsoNormal"><span style=""><span style="color:#212121">Linkers would combine .eh_frame sections into one .eh_frame, so that's not an issue, no?</span></span></p>
</div>
<div>
<p class="MsoNormal"><span style=""><span style="color:#212121"> </span></span></p>
</div>
<blockquote style="border:none; border-left:solid #CCCCCC 1.0pt; padding:0in 0in 0in 6.0pt; margin-left:4.8pt; margin-top:5.0pt; margin-right:0in; margin-bottom:5.0pt">
<div>
<div>
<p class="MsoNormal"><span style=""><span style="color:#212121">As we create eh_frame_hdr in most cases there is no problem to filter out garbage eh_frame sections. If there is information about unused symbols, the implementation is very simple. BTW there is
no need to do full decoding of eh_frame records to remove garbage.</span></span></p>
<p class="MsoNormal"><span style=""><span style="color:#212121">Paul is right there will be code size overhead. Eh_frame is usually created per a compilation module with common information in CFI. Multiple eh_frames will cause a lot of redundant CFI. There
might be a case when the total size of redundant CFIs will be greater than the total size of removed garbage.</span></span></p>
</div>
</div>
</blockquote>
<div>
<p class="MsoNormal"><span style=""><span style="color:#212121"> </span></span></p>
</div>
<div>
<p class="MsoNormal"><span style=""><span style="color:#212121">As I wrote in the previous message, I don't think there's a size issue in link results because even existing linkers merge CIEs by contents.</span></span><span style="color:#212121"></span></p>
</div>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>