<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Feb 21, 2017 at 9:37 AM, Rafael Avila de Espindola <span dir="ltr"><<a href="mailto:rafael.espindola@gmail.com" target="_blank">rafael.espindola@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I think the real problem is at<br>
<br>
template <class ELFT> static SymbolBody *addRegular(SymbolAssignment *Cmd) {<br>
  uint8_t Visibility = Cmd->Hidden ? STV_HIDDEN : STV_DEFAULT;<br>
  Symbol *Sym = Symtab<ELFT>::X->addUndefined(<br>
      Cmd->Name, /*IsLocal=*/false, STB_GLOBAL, Visibility,<br>
      /*Type*/ 0,<br>
      /*CanOmitFromDynSym*/ false, /*File*/ nullptr);<br>
<br>
  replaceBody<DefinedRegular<<wbr>ELFT>>(Sym, Cmd->Name, /*IsLocal=*/false,<br>
                                    Visibility, STT_NOTYPE, 0, 0, nullptr,<br>
                                    nullptr);<br>
  return Sym->body();<br>
}<br>
<br>
We add an undefined just to replace it, which has the side effect of<br>
fetching the archive member. We should probably just have it as a single<br>
step in Symtab.</blockquote><div><br></div><div>You can probably just use insert() instead of addUndefined().<br></div></div></div></div>