<div dir="ltr">It seems like this change makes check-lld asan unhappy, see sanitizer-x86_64-linux-fast, for example.</div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Nov 21, 2016 at 8:28 PM, Rui Ueyama via llvm-commits <span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: ruiu<br>
Date: Mon Nov 21 22:28:39 2016<br>
New Revision: 287617<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=287617&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project?rev=287617&view=rev</a><br>
Log:<br>
Do not save unused pointers to In<ELFT>.<br>
<br>
Modified:<br>
    lld/trunk/ELF/<wbr>SyntheticSections.h<br>
    lld/trunk/ELF/Writer.cpp<br>
<br>
Modified: lld/trunk/ELF/<wbr>SyntheticSections.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/SyntheticSections.h?rev=287617&r1=287616&r2=287617&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/lld/trunk/ELF/<wbr>SyntheticSections.h?rev=<wbr>287617&r1=287616&r2=287617&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- lld/trunk/ELF/<wbr>SyntheticSections.h (original)<br>
+++ lld/trunk/ELF/<wbr>SyntheticSections.h Mon Nov 21 22:28:39 2016<br>
@@ -618,9 +618,6 @@ template <class ELFT> struct In {<br>
   static GotPltSection<ELFT> *GotPlt;<br>
   static HashTableSection<ELFT> *HashTab;<br>
   static InputSection<ELFT> *Interp;<br>
-  static MipsAbiFlagsSection<ELFT> *MipsAbiFlags;<br>
-  static MipsOptionsSection<ELFT> *MipsOptions;<br>
-  static MipsReginfoSection<ELFT> *MipsReginfo;<br>
   static PltSection<ELFT> *Plt;<br>
   static RelocationSection<ELFT> *RelaDyn;<br>
   static RelocationSection<ELFT> *RelaPlt;<br>
@@ -645,9 +642,6 @@ template <class ELFT> MipsGotSection<ELF<br>
 template <class ELFT> GotPltSection<ELFT> *In<ELFT>::GotPlt;<br>
 template <class ELFT> HashTableSection<ELFT> *In<ELFT>::HashTab;<br>
 template <class ELFT> InputSection<ELFT> *In<ELFT>::Interp;<br>
-template <class ELFT> MipsAbiFlagsSection<ELFT> *In<ELFT>::MipsAbiFlags;<br>
-template <class ELFT> MipsOptionsSection<ELFT> *In<ELFT>::MipsOptions;<br>
-template <class ELFT> MipsReginfoSection<ELFT> *In<ELFT>::MipsReginfo;<br>
 template <class ELFT> PltSection<ELFT> *In<ELFT>::Plt;<br>
 template <class ELFT> RelocationSection<ELFT> *In<ELFT>::RelaDyn;<br>
 template <class ELFT> RelocationSection<ELFT> *In<ELFT>::RelaPlt;<br>
<br>
Modified: lld/trunk/ELF/Writer.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Writer.cpp?rev=287617&r1=287616&r2=287617&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/lld/trunk/ELF/Writer.<wbr>cpp?rev=287617&r1=287616&r2=<wbr>287617&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- lld/trunk/ELF/Writer.cpp (original)<br>
+++ lld/trunk/ELF/Writer.cpp Mon Nov 21 22:28:39 2016<br>
@@ -305,24 +305,18 @@ template <class ELFT> void Writer<ELFT>:<br>
     Symtab<ELFT>::X->Sections.<wbr>push_back(Common);<br>
   }<br>
<br>
+  // Add MIPS-specific sections.<br>
   if (Config->EMachine == EM_MIPS) {<br>
-    // .MIPS.abiflags<br>
-    if (auto *Sec = MipsAbiFlagsSection<ELFT>::<wbr>create()) {<br>
-      In<ELFT>::MipsAbiFlags = Sec;<br>
+    if (auto *Sec = MipsAbiFlagsSection<ELFT>::<wbr>create())<br>
       Symtab<ELFT>::X->Sections.<wbr>push_back(Sec);<br>
-    }<br>
-    // .MIPS.options<br>
-    if (auto *Sec = MipsOptionsSection<ELFT>::<wbr>create()) {<br>
-      In<ELFT>::MipsOptions = Sec;<br>
+    if (auto *Sec = MipsOptionsSection<ELFT>::<wbr>create())<br>
       Symtab<ELFT>::X->Sections.<wbr>push_back(Sec);<br>
-    }<br>
-    // MIPS .reginfo<br>
-    if (auto *Sec = MipsReginfoSection<ELFT>::<wbr>create()) {<br>
-      In<ELFT>::MipsReginfo = Sec;<br>
+    if (auto *Sec = MipsReginfoSection<ELFT>::<wbr>create())<br>
       Symtab<ELFT>::X->Sections.<wbr>push_back(Sec);<br>
-    }<br>
   }<br>
<br>
+  // Add .got. MIPS' .got is so different from the other archs,<br>
+  // it has its own class.<br>
   if (Config->EMachine == EM_MIPS)<br>
     In<ELFT>::MipsGot = make<MipsGotSection<ELFT>>();<br>
   else<br>
@@ -1498,11 +1492,6 @@ template <class ELFT> void Writer<ELFT>:<br>
 template <class ELFT> void Writer<ELFT>::writeSections() {<br>
   uint8_t *Buf = Buffer->getBufferStart();<br>
<br>
-  // Finalize MIPS .MIPS.options sections because that contains<br>
-  // offsets to .got and _gp.<br>
-  if (In<ELFT>::MipsOptions)<br>
-    In<ELFT>::MipsOptions-><wbr>finalize();<br>
-<br>
   // PPC64 needs to process relocations in the .opd section<br>
   // before processing relocations in code-containing sections.<br>
   Out<ELFT>::Opd = findSection(".opd");<br>
<br>
<br>
______________________________<wbr>_________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div>