<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<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; } 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-right: 0in; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; } span.EmailStyle19 { 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>Hi Evgeny,<br>
</p>
<p><br>
</p>
<p class="MsoNormal" style="color: rgb(33, 33, 33); background-color: rgb(255, 255, 255);">
<span style="font-size: 11pt;">> </span><span style="font-size: 11pt;">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><span style="font-size: 11pt;">.</span><br>
</p>
<div><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.<br>
</div>
<p><br>
</p>
<p class="MsoNormal" style="color: rgb(33, 33, 33); background-color: rgb(255, 255, 255);">
> What do you mean “one place or two”?</p>
<p class="MsoNormal" style="color: rgb(33, 33, 33); background-color: rgb(255, 255, 255);">
<br>
</p>
<p class="MsoNormal" style="color: rgb(33, 33, 33); background-color: rgb(255, 255, 255);">
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?<br>
</p>
<p class="MsoNormal" style="color: rgb(33, 33, 33); background-color: rgb(255, 255, 255);">
<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> 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</font>
<div> </div>
</div>
<div>
<div class="WordSection1">
<p class="MsoNormal"><span style="">Hi Igor,</span></p>
<p class="MsoNormal"><span style=""> </span></p>
<p class="MsoNormal"><span>> </span>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?</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">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 style="">.</span></p>
<p class="MsoNormal"><span> </span></p>
<p class="MsoNormal"><span>> </span>So, is there any difference whether it knows that in one place or two?</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">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.</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">Thanks,</p>
<p class="MsoNormal">Evgeny Astigeevich<span style=""></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.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></p>
</div>
<div>
<p class="MsoNormal"> </p>
</div>
<p><a name="_MailOriginalBody">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?</a></p>
<p><span style="">So, is there any difference whether it knows that in one place or two?</span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span style="">Best Regards,<br>
Igor Kudrin<br>
C++ Developer, Access Softek, Inc.</span></p>
<div>
<p class="MsoNormal"><span style="">On 27-Oct-17 3:43, Rui Ueyama via llvm-dev wrote:</span></p>
</div>
<blockquote style="margin-top:5.0pt; margin-bottom:5.0pt">
<div>
<div>
<div>
<p class="MsoNormal"><span style="">On Thu, Oct 26, 2017 at 1:13 PM, Evgeny Astigeevich <</span><a href="mailto:Evgeny.Astigeevich@arm.com" target="_blank"><span style="">Evgeny.Astigeevich@arm.com</span><span style=""></span></a><span style="">> wrote:</span></p>
<blockquote style="border:none; border-left:solid #CCCCCC 1.0pt; padding:0in 0in 0in 6.0pt; margin-left:4.8pt; margin-right:0in">
<div>
<div>
<p class="MsoNormal" style=""><span style="">Hi,</span></p>
<p class="MsoNormal" style=""><span style=""> </span></p>
<p class="MsoNormal" style=""><span style="">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></p>
</div>
</div>
</blockquote>
<div>
<p class="MsoNormal"><span style=""> </span></p>
</div>
<div>
<p class="MsoNormal"><span style="">Linkers would combine .eh_frame sections into one .eh_frame, so that's not an issue, no?</span></p>
</div>
<div>
<p class="MsoNormal"><span style=""> </span></p>
</div>
<blockquote style="border:none; border-left:solid #CCCCCC 1.0pt; padding:0in 0in 0in 6.0pt; margin-left:4.8pt; margin-right:0in">
<div>
<div>
<p class="MsoNormal" style=""><span style="">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></p>
<p class="MsoNormal" style=""><span style="">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></p>
</div>
</div>
</blockquote>
<div>
<p class="MsoNormal"><span style=""> </span></p>
</div>
<div>
<p class="MsoNormal"><span style="">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></p>
</div>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</body>
</html>