<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Title" content="">
<meta name="Keywords" content="">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.msoIns
        {mso-style-type:export-only;
        mso-style-name:"";
        text-decoration:underline;
        color:teal;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style>
</head>
<body bgcolor="white" lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal">Requesting a merge to 6.0.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal" style="margin-left:.5in"><b><span style="font-size:12.0pt;color:black">From:
</span></b><span style="font-size:12.0pt;color:black">llvm-commits <llvm-commits-bounces@lists.llvm.org> on behalf of Shoaib Meenai via llvm-commits <llvm-commits@lists.llvm.org><br>
<b>Reply-To: </b>Shoaib Meenai <smeenai@fb.com><br>
<b>Date: </b>Wednesday, January 10, 2018 at 10:58 PM<br>
<b>To: </b>"llvm-commits@lists.llvm.org" <llvm-commits@lists.llvm.org><br>
<b>Subject: </b>[lld] r322259 - [ELF] Fix SysV hash tables with --no-rosegment<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">Author: smeenai<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">Date: Wed Jan 10 22:57:01 2018<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">New Revision: 322259<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject-3Frev-3D322259-26view-3Drev&d=DwIGaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=TzrIlS-6umMNRBVgupRbtxnFD-cXXbaxjd-gc8JgZcw&s=3Y89oPU0NvdG7K6lOFdJV5V8EZeTYfpNxkgb3JOIiEQ&e=">
https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject-3Frev-3D322259-26view-3Drev&d=DwIGaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=TzrIlS-6umMNRBVgupRbtxnFD-cXXbaxjd-gc8JgZcw&s=3Y89oPU0NvdG7K6lOFdJV5V8EZeTYfpNxkgb3JOIiEQ&e=</a><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">Log:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">[ELF] Fix SysV hash tables with --no-rosegment<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">When setting up the chain, we copy over the bucket's previous symbol<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">index, assuming that this index will be 0 (STN_UNDEF) for an unused<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">bucket (marking the end of the chain). When linking with --no-rosegment,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">however, unused buckets will in fact contain the padding value, and so<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">the hash table will end up containing invalid chains. Zero out the hash<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">table section explicitly to avoid this, similar to what's already done<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">for GNU hash sections.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">Differential Revision: <a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__reviews.llvm.org_D41928&d=DwIGaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=TzrIlS-6umMNRBVgupRbtxnFD-cXXbaxjd-gc8JgZcw&s=8qLiJg_KJkyadNiH7iVdh1Ab9J2tTu3wPrSxx_VYhGk&e=">
https://urldefense.proofpoint.com/v2/url?u=https-3A__reviews.llvm.org_D41928&d=DwIGaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=TzrIlS-6umMNRBVgupRbtxnFD-cXXbaxjd-gc8JgZcw&s=8qLiJg_KJkyadNiH7iVdh1Ab9J2tTu3wPrSxx_VYhGk&e=</a><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">Added:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">    lld/trunk/test/ELF/sysv-hash-no-rosegment.s<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">Modified:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">    lld/trunk/ELF/SyntheticSections.cpp<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">Modified: lld/trunk/ELF/SyntheticSections.cpp<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lld_trunk_ELF_SyntheticSections.cpp-3Frev-3D322259-26r1-3D322258-26r2-3D322259-26view-3Ddiff&d=DwIGaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=TzrIlS-6umMNRBVgupRbtxnFD-cXXbaxjd-gc8JgZcw&s=Csr47xs-UR1RtF4_oipHeeHvguaFAWBjbu_BF-eGMmY&e=">
https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lld_trunk_ELF_SyntheticSections.cpp-3Frev-3D322259-26r1-3D322258-26r2-3D322259-26view-3Ddiff&d=DwIGaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=TzrIlS-6umMNRBVgupRbtxnFD-cXXbaxjd-gc8JgZcw&s=Csr47xs-UR1RtF4_oipHeeHvguaFAWBjbu_BF-eGMmY&e=</a><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">==============================================================================<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">--- lld/trunk/ELF/SyntheticSections.cpp (original)<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">+++ lld/trunk/ELF/SyntheticSections.cpp Wed Jan 10 22:57:01 2018<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">@@ -1836,6 +1836,9 @@ void HashTableSection::finalizeContents(<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">}<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">void HashTableSection::writeTo(uint8_t *Buf) {<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">+  // See comment in GnuHashTableSection::writeTo.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">+  memset(Buf, 0, Size);<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">+<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">   unsigned NumSymbols = InX::DynSymTab->getNumSymbols();<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">   uint32_t *P = reinterpret_cast<uint32_t *>(Buf);<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">Added: lld/trunk/test/ELF/sysv-hash-no-rosegment.s<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lld_trunk_test_ELF_sysv-2Dhash-2Dno-2Drosegment.s-3Frev-3D322259-26view-3Dauto&d=DwIGaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=TzrIlS-6umMNRBVgupRbtxnFD-cXXbaxjd-gc8JgZcw&s=0bbiAHcIR4yTXv2MSkubnqN6lLXgm4QYw7TElwgAPKk&e=">
https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_lld_trunk_test_ELF_sysv-2Dhash-2Dno-2Drosegment.s-3Frev-3D322259-26view-3Dauto&d=DwIGaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=TzrIlS-6umMNRBVgupRbtxnFD-cXXbaxjd-gc8JgZcw&s=0bbiAHcIR4yTXv2MSkubnqN6lLXgm4QYw7TElwgAPKk&e=</a><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">==============================================================================<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">--- lld/trunk/test/ELF/sysv-hash-no-rosegment.s (added)<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">+++ lld/trunk/test/ELF/sysv-hash-no-rosegment.s Wed Jan 10 22:57:01 2018<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">@@ -0,0 +1,13 @@<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">+# REQUIRES: x86<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">+# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">+# RUN: ld.lld -shared --no-rosegment -o %t %t.o<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">+# RUN: llvm-readobj -hash-table %t | FileCheck %s<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">+<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">+# CHECK:      HashTable {<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">+# CHECK-NEXT:   Num Buckets: 2<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">+# CHECK-NEXT:   Num Chains: 2<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">+# CHECK-NEXT:   Buckets: [1, 0]<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">+# CHECK-NEXT:   Chains: [0, 0]<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">+# CHECK-NEXT: }<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">+<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">+callq undef@PLT<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">_______________________________________________<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">llvm-commits mailing list<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in"><a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in"><a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.llvm.org_cgi-2Dbin_mailman_listinfo_llvm-2Dcommits&d=DwIGaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=TzrIlS-6umMNRBVgupRbtxnFD-cXXbaxjd-gc8JgZcw&s=jcgUz94QCn22TBZVnEgVpJ7NSgqjghv1AjGNKpmlbmk&e=">https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.llvm.org_cgi-2Dbin_mailman_listinfo_llvm-2Dcommits&d=DwIGaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=TzrIlS-6umMNRBVgupRbtxnFD-cXXbaxjd-gc8JgZcw&s=jcgUz94QCn22TBZVnEgVpJ7NSgqjghv1AjGNKpmlbmk&e=</a><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in"><o:p> </o:p></p>
</div>
</div>
</body>
</html>