<div dir="ltr">Thanks. The new name is much better than before.</div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Feb 5, 2016 at 7:27 AM, Rafael Espindola 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: rafael<br>
Date: Fri Feb 5 09:27:15 2016<br>
New Revision: 259889<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=259889&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=259889&view=rev</a><br>
Log:<br>
Rename IsUsedInDynamicReloc to MustBeInDynSym.<br>
<br>
The variable was marking various cases where a symbol must be included<br>
in the dynamic symbol table. Being used by a dynamic relocation was only<br>
one of them.<br>
<br>
Modified:<br>
lld/trunk/ELF/OutputSections.cpp<br>
lld/trunk/ELF/SymbolTable.cpp<br>
lld/trunk/ELF/Symbols.cpp<br>
lld/trunk/ELF/Symbols.h<br>
lld/trunk/ELF/Writer.cpp<br>
<br>
Modified: lld/trunk/ELF/OutputSections.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/OutputSections.cpp?rev=259889&r1=259888&r2=259889&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/OutputSections.cpp?rev=259889&r1=259888&r2=259889&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/ELF/OutputSections.cpp (original)<br>
+++ lld/trunk/ELF/OutputSections.cpp Fri Feb 5 09:27:15 2016<br>
@@ -219,7 +219,7 @@ template <class ELFT><br>
void RelocationSection<ELFT>::addReloc(const DynamicReloc<ELFT> &Reloc) {<br>
SymbolBody *Sym = Reloc.Sym;<br>
if (!Reloc.UseSymVA && Sym)<br>
- Sym->setUsedInDynamicReloc();<br>
+ Sym->MustBeInDynSym = true;<br>
Relocs.push_back(Reloc);<br>
}<br>
<br>
<br>
Modified: lld/trunk/ELF/SymbolTable.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/SymbolTable.cpp?rev=259889&r1=259888&r2=259889&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/SymbolTable.cpp?rev=259889&r1=259888&r2=259889&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/ELF/SymbolTable.cpp (original)<br>
+++ lld/trunk/ELF/SymbolTable.cpp Fri Feb 5 09:27:15 2016<br>
@@ -268,7 +268,7 @@ template <class ELFT> void SymbolTable<E<br>
for (StringRef U : File->getUndefinedSymbols())<br>
if (SymbolBody *Sym = find(U))<br>
if (Sym->isDefined())<br>
- Sym->setUsedInDynamicReloc();<br>
+ Sym->MustBeInDynSym = true;<br>
}<br>
<br>
template class elf2::SymbolTable<ELF32LE>;<br>
<br>
Modified: lld/trunk/ELF/Symbols.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Symbols.cpp?rev=259889&r1=259888&r2=259889&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Symbols.cpp?rev=259889&r1=259888&r2=259889&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/ELF/Symbols.cpp (original)<br>
+++ lld/trunk/ELF/Symbols.cpp Fri Feb 5 09:27:15 2016<br>
@@ -128,7 +128,7 @@ template <class ELFT> int SymbolBody::co<br>
// symbols in the DSO at runtime.<br>
if (isShared() != Other->isShared())<br>
if (isa<DefinedRegular<ELFT>>(isShared() ? Other : this))<br>
- IsUsedInDynamicReloc = Other->IsUsedInDynamicReloc = true;<br>
+ MustBeInDynSym = Other->MustBeInDynSym = true;<br>
<br>
if (L != R)<br>
return -1;<br>
<br>
Modified: lld/trunk/ELF/Symbols.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Symbols.h?rev=259889&r1=259888&r2=259889&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Symbols.h?rev=259889&r1=259888&r2=259889&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/ELF/Symbols.h (original)<br>
+++ lld/trunk/ELF/Symbols.h Fri Feb 5 09:27:15 2016<br>
@@ -83,8 +83,6 @@ public:<br>
bool isLazy() const { return SymbolKind == LazyKind; }<br>
bool isShared() const { return SymbolKind == SharedKind; }<br>
bool isUsedInRegularObj() const { return IsUsedInRegularObj; }<br>
- bool isUsedInDynamicReloc() const { return IsUsedInDynamicReloc; }<br>
- void setUsedInDynamicReloc() { IsUsedInDynamicReloc = true; }<br>
bool isTls() const { return IsTls; }<br>
bool isFunc() const { return IsFunc; }<br>
<br>
@@ -131,10 +129,9 @@ public:<br>
protected:<br>
SymbolBody(Kind K, StringRef Name, bool IsWeak, uint8_t Visibility,<br>
bool IsTls, bool IsFunc)<br>
- : SymbolKind(K), IsWeak(IsWeak), Visibility(Visibility), IsTls(IsTls),<br>
- IsFunc(IsFunc), Name(Name) {<br>
+ : SymbolKind(K), IsWeak(IsWeak), Visibility(Visibility),<br>
+ MustBeInDynSym(false), IsTls(IsTls), IsFunc(IsFunc), Name(Name) {<br>
IsUsedInRegularObj = K != SharedKind && K != LazyKind;<br>
- IsUsedInDynamicReloc = 0;<br>
}<br>
<br>
const unsigned SymbolKind : 8;<br>
@@ -147,9 +144,11 @@ protected:<br>
// it can be false.<br>
unsigned IsUsedInRegularObj : 1;<br>
<br>
+public:<br>
// If true, the symbol is added to .dynsym symbol table.<br>
- unsigned IsUsedInDynamicReloc : 1;<br>
+ unsigned MustBeInDynSym : 1;<br>
<br>
+protected:<br>
unsigned IsTls : 1;<br>
unsigned IsFunc : 1;<br>
StringRef Name;<br>
<br>
Modified: lld/trunk/ELF/Writer.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Writer.cpp?rev=259889&r1=259888&r2=259889&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Writer.cpp?rev=259889&r1=259888&r2=259889&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/ELF/Writer.cpp (original)<br>
+++ lld/trunk/ELF/Writer.cpp Fri Feb 5 09:27:15 2016<br>
@@ -366,8 +366,7 @@ void Writer<ELFT>::scanRelocs(<br>
// See "Global Offset Table" in Chapter 5 in the following document<br>
// for detailed description:<br>
// <a href="ftp://www.linux-mips.org/pub/linux/mips/doc/ABI/mipsabi.pdf" rel="noreferrer" target="_blank">ftp://www.linux-mips.org/pub/linux/mips/doc/ABI/mipsabi.pdf</a><br>
- // FIXME: Why do we need to set this here?<br>
- Body->setUsedInDynamicReloc();<br>
+ Body->MustBeInDynSym = true;<br>
continue;<br>
}<br>
<br>
@@ -778,7 +777,7 @@ static bool includeInDynsym(const Symbol<br>
return false;<br>
if (Config->ExportDynamic || Config->Shared)<br>
return true;<br>
- return B.isUsedInDynamicReloc();<br>
+ return B.MustBeInDynSym;<br>
}<br>
<br>
// This class knows how to create an output section for a given<br>
<br>
<br>
_______________________________________________<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/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div>