diff options
-rw-r--r-- | lld/ELF/Relocations.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lld/ELF/Relocations.cpp b/lld/ELF/Relocations.cpp index 3e5e7a83acb..f22ca683cf6 100644 --- a/lld/ELF/Relocations.cpp +++ b/lld/ELF/Relocations.cpp @@ -410,13 +410,16 @@ static RelExpr toPlt(RelExpr Expr) { static RelExpr fromPlt(RelExpr Expr) { // We decided not to use a plt. Optimize a reference to the plt to a // reference to the symbol itself. - if (Expr == R_PLT_PC) + switch (Expr) { + case R_PLT_PC: return R_PC; - if (Expr == R_PPC_PLT_OPD) + case R_PPC_PLT_OPD: return R_PPC_OPD; - if (Expr == R_PLT) + case R_PLT: return R_ABS; - return Expr; + default: + return Expr; + } } // Returns true if a given shared symbol is in a read-only segment in a DSO. |