diff lld/MachO/Symbols.h @ 223:5f17cb93ff66 llvm-original

LLVM13 (2021/7/18)
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sun, 18 Jul 2021 22:43:00 +0900
parents 79ff65ed7e25
children c4bab56944e8
line wrap: on
line diff
--- a/lld/MachO/Symbols.h	Sun Jul 18 22:10:01 2021 +0900
+++ b/lld/MachO/Symbols.h	Sun Jul 18 22:43:00 2021 +0900
@@ -55,10 +55,6 @@
 
   virtual uint64_t getVA() const { return 0; }
 
-  virtual uint64_t getFileOffset() const {
-    llvm_unreachable("attempt to get an offset from a non-defined symbol");
-  }
-
   virtual bool isWeakDef() const { llvm_unreachable("cannot be weak def"); }
 
   // Only undefined or dylib symbols can be weak references. A weak reference
@@ -124,8 +120,8 @@
         includeInSymtab(true), thumb(isThumb),
         referencedDynamically(isReferencedDynamically),
         noDeadStrip(noDeadStrip), weakDef(isWeakDef), external(isExternal) {
-    if (isec)
-      isec->numRefs++;
+    if (auto concatIsec = dyn_cast_or_null<ConcatInputSection>(isec))
+      concatIsec->numRefs++;
   }
 
   bool isWeakDef() const override { return weakDef; }
@@ -133,14 +129,13 @@
     return isWeakDef() && isExternal() && !privateExtern;
   }
   bool isTlv() const override {
-    return !isAbsolute() && isThreadLocalVariables(isec->flags);
+    return !isAbsolute() && isThreadLocalVariables(isec->getFlags());
   }
 
   bool isExternal() const { return external; }
   bool isAbsolute() const { return isec == nullptr; }
 
   uint64_t getVA() const override;
-  uint64_t getFileOffset() const override;
 
   static bool classof(const Symbol *s) { return s->kind() == DefinedKind; }