[lld] r252982 - [elf2] get{Local, Global}DynamicReloc -> is{LocalGlobal}DynamicReloc.
Michael J. Spencer via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 12 16:32:59 PST 2015
Author: mspencer
Date: Thu Nov 12 18:32:58 2015
New Revision: 252982
URL: http://llvm.org/viewvc/llvm-project?rev=252982&view=rev
Log:
[elf2] get{Local,Global}DynamicReloc -> is{LocalGlobal}DynamicReloc.
Modified:
lld/trunk/ELF/InputSection.cpp
lld/trunk/ELF/OutputSections.cpp
lld/trunk/ELF/Target.h
lld/trunk/ELF/Writer.cpp
Modified: lld/trunk/ELF/InputSection.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputSection.cpp?rev=252982&r1=252981&r2=252982&view=diff
==============================================================================
--- lld/trunk/ELF/InputSection.cpp (original)
+++ lld/trunk/ELF/InputSection.cpp Thu Nov 12 18:32:58 2015
@@ -108,7 +108,7 @@ void InputSectionBase<ELFT>::relocate(
uint8_t *BufLoc = Buf + Offset;
uintX_t AddrLoc = OutSec->getVA() + Offset;
- if (Type == Target->getTlsLocalDynamicReloc()) {
+ if (Target->isTlsLocalDynamicReloc(Type)) {
Target->relocateOne(BufLoc, BufEnd, Type, AddrLoc,
Out<ELFT>::Got->getVA() +
Out<ELFT>::LocalModuleTlsIndexOffset +
@@ -127,7 +127,7 @@ void InputSectionBase<ELFT>::relocate(
SymbolBody &Body = *File->getSymbolBody(SymIndex)->repl();
- if (Type == Target->getTlsGlobalDynamicReloc()) {
+ if (Target->isTlsGlobalDynamicReloc(Type)) {
Target->relocateOne(BufLoc, BufEnd, Type, AddrLoc,
Out<ELFT>::Got->getEntryAddr(Body) +
getAddend<ELFT>(RI));
Modified: lld/trunk/ELF/OutputSections.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/OutputSections.cpp?rev=252982&r1=252981&r2=252982&view=diff
==============================================================================
--- lld/trunk/ELF/OutputSections.cpp (original)
+++ lld/trunk/ELF/OutputSections.cpp Thu Nov 12 18:32:58 2015
@@ -205,7 +205,7 @@ template <class ELFT> void RelocationSec
uint32_t Type = RI.getType(Config->Mips64EL);
- if (Type == Target->getTlsLocalDynamicReloc()) {
+ if (Target->isTlsLocalDynamicReloc(Type)) {
P->setSymbolAndType(0, Target->getTlsModuleIndexReloc(),
Config->Mips64EL);
P->r_offset =
@@ -213,7 +213,7 @@ template <class ELFT> void RelocationSec
continue;
}
- if (Body && Type == Target->getTlsGlobalDynamicReloc()) {
+ if (Body && Target->isTlsGlobalDynamicReloc(Type)) {
P->setSymbolAndType(Body->getDynamicSymbolTableIndex(),
Target->getTlsModuleIndexReloc(), Config->Mips64EL);
P->r_offset = Out<ELFT>::Got->getEntryAddr(*Body);
Modified: lld/trunk/ELF/Target.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Target.h?rev=252982&r1=252981&r2=252982&view=diff
==============================================================================
--- lld/trunk/ELF/Target.h (original)
+++ lld/trunk/ELF/Target.h Thu Nov 12 18:32:58 2015
@@ -29,8 +29,12 @@ public:
unsigned getPltReloc() const { return PltReloc; }
unsigned getGotRefReloc() const { return GotRefReloc; }
unsigned getRelativeReloc() const { return RelativeReloc; }
- unsigned getTlsLocalDynamicReloc() const { return TlsLocalDynamicReloc; }
- unsigned getTlsGlobalDynamicReloc() const { return TlsGlobalDynamicReloc; }
+ bool isTlsLocalDynamicReloc(unsigned Type) const {
+ return Type == TlsLocalDynamicReloc;
+ }
+ bool isTlsGlobalDynamicReloc(unsigned Type) const {
+ return Type == TlsGlobalDynamicReloc;
+ }
unsigned getTlsModuleIndexReloc() const { return TlsModuleIndexReloc; }
unsigned getTlsOffsetReloc() const { return TlsOffsetReloc; }
unsigned getPltZeroEntrySize() const { return PltZeroEntrySize; }
Modified: lld/trunk/ELF/Writer.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Writer.cpp?rev=252982&r1=252981&r2=252982&view=diff
==============================================================================
--- lld/trunk/ELF/Writer.cpp (original)
+++ lld/trunk/ELF/Writer.cpp Thu Nov 12 18:32:58 2015
@@ -199,7 +199,7 @@ void Writer<ELFT>::scanRelocs(
SymbolBody *Body = File.getSymbolBody(SymIndex);
uint32_t Type = RI.getType(Config->Mips64EL);
- if (Type == Target->getTlsLocalDynamicReloc()) {
+ if (Target->isTlsLocalDynamicReloc(Type)) {
if (Out<ELFT>::LocalModuleTlsIndexOffset == uint32_t(-1)) {
Out<ELFT>::LocalModuleTlsIndexOffset =
Out<ELFT>::Got->addLocalModuleTlsIndex();
@@ -217,7 +217,7 @@ void Writer<ELFT>::scanRelocs(
Body = Body->repl();
if (Body && Body->isTLS()) {
- if (Type != Target->getTlsGlobalDynamicReloc())
+ if (!Target->isTlsGlobalDynamicReloc(Type))
continue;
if (Body->isInGot())
continue;
More information about the llvm-commits
mailing list