Simplify. No functionality change intended.

I honestly do not understand this part of code as it is too tangled.
What I'm trying now is to carefully disentangle it by transforming
code without changing meaining to see if I can improve overall
readability.

llvm-svn: 298576
This commit is contained in:
Rui Ueyama 2017-03-23 03:44:08 +00:00
parent ccf71c6ab3
commit 968381ef22
1 changed files with 6 additions and 6 deletions

View File

@ -138,14 +138,14 @@ template <class ELFT>
static unsigned
handleTlsRelocation(uint32_t Type, SymbolBody &Body, InputSectionBase &C,
typename ELFT::uint Offset, int64_t Addend, RelExpr Expr) {
typedef typename ELFT::uint uintX_t;
if (!(C.Flags & SHF_ALLOC))
return 0;
if (!Body.isTls())
return 0;
typedef typename ELFT::uint uintX_t;
if (Config->EMachine == EM_ARM)
return handleNoRelaxTlsRelocation<ELFT>(In<ELFT>::Got, Type, Body, C,
Offset, Addend, Expr);
@ -221,11 +221,11 @@ handleTlsRelocation(uint32_t Type, SymbolBody &Body, InputSectionBase &C,
In<ELFT>::RelaDyn->addReloc({Target->TlsGotRel, In<ELFT>::Got,
Body.getGotOffset(), false, &Body, 0});
}
return Target->TlsGdRelaxSkip;
} else {
C.Relocations.push_back(
{Target->adjustRelaxExpr(Type, nullptr, R_RELAX_TLS_GD_TO_LE), Type,
Offset, Addend, &Body});
}
C.Relocations.push_back(
{Target->adjustRelaxExpr(Type, nullptr, R_RELAX_TLS_GD_TO_LE), Type,
Offset, Addend, &Body});
return Target->TlsGdRelaxSkip;
}