[lld] 54fe70b - [ELF] RelocationScanner::scanOne: replace rel.r_offset with offset. NFC

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 17 00:05:31 PST 2022


Author: Fangrui Song
Date: 2022-01-17T00:05:27-08:00
New Revision: 54fe70bfba230a0058ff90bcf0c459e82b0363b9

URL: https://github.com/llvm/llvm-project/commit/54fe70bfba230a0058ff90bcf0c459e82b0363b9
DIFF: https://github.com/llvm/llvm-project/commit/54fe70bfba230a0058ff90bcf0c459e82b0363b9.diff

LOG: [ELF] RelocationScanner::scanOne: replace rel.r_offset with offset. NFC

Added: 
    

Modified: 
    lld/ELF/Relocations.cpp

Removed: 
    


################################################################################
diff  --git a/lld/ELF/Relocations.cpp b/lld/ELF/Relocations.cpp
index 7befe09ce233..3a4cbde6ab69 100644
--- a/lld/ELF/Relocations.cpp
+++ b/lld/ELF/Relocations.cpp
@@ -1310,10 +1310,10 @@ template <class ELFT, class RelTy> void RelocationScanner::scanOne(RelTy *&i) {
   // Error if the target symbol is undefined. Symbol index 0 may be used by
   // marker relocations, e.g. R_*_NONE and R_ARM_V4BX. Don't error on them.
   if (sym.isUndefined() && symIndex != 0 &&
-      maybeReportUndefined(cast<Undefined>(sym), sec, rel.r_offset))
+      maybeReportUndefined(cast<Undefined>(sym), sec, offset))
     return;
 
-  const uint8_t *relocatedAddr = sec.data().begin() + rel.r_offset;
+  const uint8_t *relocatedAddr = sec.data().begin() + offset;
   RelExpr expr = target.getRelExpr(type, sym, relocatedAddr);
 
   // Ignore R_*_NONE and other marker relocations.


        


More information about the llvm-commits mailing list