[lld] r268556 - Rename isRelRelative.
Rafael Espindola via llvm-commits
llvm-commits at lists.llvm.org
Wed May 4 14:28:57 PDT 2016
Author: rafael
Date: Wed May 4 16:28:56 2016
New Revision: 268556
URL: http://llvm.org/viewvc/llvm-project?rev=268556&view=rev
Log:
Rename isRelRelative.
What it is computing is if we need a dynamic relocation or not.
Modified:
lld/trunk/ELF/Writer.cpp
Modified: lld/trunk/ELF/Writer.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Writer.cpp?rev=268556&r1=268555&r2=268556&view=diff
==============================================================================
--- lld/trunk/ELF/Writer.cpp (original)
+++ lld/trunk/ELF/Writer.cpp Wed May 4 16:28:56 2016
@@ -440,7 +440,8 @@ static bool needsPlt(RelExpr Expr) {
}
template <class ELFT>
-static bool isRelRelative(RelExpr E, uint32_t Type, const SymbolBody &Body) {
+static bool isStaticLinkTimeConstant(RelExpr E, uint32_t Type,
+ const SymbolBody &Body) {
if (E == R_SIZE)
return true;
@@ -631,7 +632,7 @@ void Writer<ELFT>::scanRelocs(InputSecti
continue;
}
- if (Expr == R_GOT && !isRelRelative<ELFT>(Expr, Type, Body) &&
+ if (Expr == R_GOT && !isStaticLinkTimeConstant<ELFT>(Expr, Type, Body) &&
Config->Shared)
AddDyn({Target->RelativeRel, C.OutSec, Offset, true, &Body,
getAddend<ELFT>(RI)});
@@ -733,7 +734,7 @@ void Writer<ELFT>::scanRelocs(InputSecti
// We can however do better than just copying the incoming relocation. We
// can process some of it and and just ask the dynamic linker to add the
// load address.
- if (!Config->Pic || isRelRelative<ELFT>(Expr, Type, Body)) {
+ if (!Config->Pic || isStaticLinkTimeConstant<ELFT>(Expr, Type, Body)) {
if (Config->EMachine == EM_MIPS && Body.isLocal() &&
(Type == R_MIPS_GPREL16 || Type == R_MIPS_GPREL32))
Addend += File.getMipsGp0();
More information about the llvm-commits
mailing list