Revert r145180 as it is causing test failures on all the bots.
authorChandler Carruth <chandlerc@gmail.com>
Sun, 27 Nov 2011 10:37:47 +0000 (10:37 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Sun, 27 Nov 2011 10:37:47 +0000 (10:37 +0000)
Original commit message:
Fixed ObjectFile functions:
- getSymbolOffset() renamed as getSymbolFileOffset()
- getSymbolFileOffset(), getSymbolAddress(), getRelocationAddress() returns same result for ELFObjectFile, MachOObjectFile and COFFObjectFile.
- added getRelocationOffset()
- fixed MachOObjectFile::getSymbolSize()
- fixed MachOObjectFile::getSymbolSection()
- fixed MachOObjectFile::getSymbolOffset() for symbols without section data.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145182 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm-c/Object.h
include/llvm/Object/COFF.h
include/llvm/Object/MachO.h
include/llvm/Object/ObjectFile.h
lib/Object/COFFObjectFile.cpp
lib/Object/ELFObjectFile.cpp
lib/Object/MachOObjectFile.cpp
lib/Object/Object.cpp
tools/llvm-nm/llvm-nm.cpp
tools/llvm-objdump/MachODump.cpp
tools/llvm-objdump/llvm-objdump.cpp

index 6b465b3ed6530787b3c28de60c8cfbbdf455259a..92bb03b68254776721cacaa53d5dfadfc9765f80 100644 (file)
@@ -73,12 +73,11 @@ void LLVMMoveToNextRelocation(LLVMRelocationIteratorRef RI);
 // SymbolRef accessors
 const char *LLVMGetSymbolName(LLVMSymbolIteratorRef SI);
 uint64_t LLVMGetSymbolAddress(LLVMSymbolIteratorRef SI);
-uint64_t LLVMGetSymbolFileOffset(LLVMSymbolIteratorRef SI);
+uint64_t LLVMGetSymbolOffset(LLVMSymbolIteratorRef SI);
 uint64_t LLVMGetSymbolSize(LLVMSymbolIteratorRef SI);
 
 // RelocationRef accessors
 uint64_t LLVMGetRelocationAddress(LLVMRelocationIteratorRef RI);
-uint64_t LLVMGetRelocationOffset(LLVMRelocationIteratorRef RI);
 LLVMSymbolIteratorRef LLVMGetRelocationSymbol(LLVMRelocationIteratorRef RI);
 uint64_t LLVMGetRelocationType(LLVMRelocationIteratorRef RI);
 // NOTE: Caller takes ownership of returned string of the two
index 73bde8ef4125de468d044a59451ac123f784c9f3..71e342fc8bffe8e3c8f94ed2201b165aac3ecdb7 100644 (file)
@@ -105,7 +105,7 @@ private:
 protected:
   virtual error_code getSymbolNext(DataRefImpl Symb, SymbolRef &Res) const;
   virtual error_code getSymbolName(DataRefImpl Symb, StringRef &Res) const;
-  virtual error_code getSymbolFileOffset(DataRefImpl Symb, uint64_t &Res) const;
+  virtual error_code getSymbolOffset(DataRefImpl Symb, uint64_t &Res) const;
   virtual error_code getSymbolAddress(DataRefImpl Symb, uint64_t &Res) const;
   virtual error_code getSymbolSize(DataRefImpl Symb, uint64_t &Res) const;
   virtual error_code getSymbolNMTypeChar(DataRefImpl Symb, char &Res) const;
@@ -135,8 +135,6 @@ protected:
                                        RelocationRef &Res) const;
   virtual error_code getRelocationAddress(DataRefImpl Rel,
                                           uint64_t &Res) const;
-  virtual error_code getRelocationOffset(DataRefImpl Rel,
-                                         uint64_t &Res) const;
   virtual error_code getRelocationSymbol(DataRefImpl Rel,
                                          SymbolRef &Res) const;
   virtual error_code getRelocationType(DataRefImpl Rel,
index 7e3a90dab1a8439cdc159cf70448910481834544..c6454ffeee847a2376ce4d6d6f0d51aae24d1aac 100644 (file)
@@ -49,7 +49,7 @@ public:
 protected:
   virtual error_code getSymbolNext(DataRefImpl Symb, SymbolRef &Res) const;
   virtual error_code getSymbolName(DataRefImpl Symb, StringRef &Res) const;
-  virtual error_code getSymbolFileOffset(DataRefImpl Symb, uint64_t &Res) const;
+  virtual error_code getSymbolOffset(DataRefImpl Symb, uint64_t &Res) const;
   virtual error_code getSymbolAddress(DataRefImpl Symb, uint64_t &Res) const;
   virtual error_code getSymbolSize(DataRefImpl Symb, uint64_t &Res) const;
   virtual error_code getSymbolNMTypeChar(DataRefImpl Symb, char &Res) const;
@@ -79,8 +79,6 @@ protected:
                                        RelocationRef &Res) const;
   virtual error_code getRelocationAddress(DataRefImpl Rel,
                                           uint64_t &Res) const;
-  virtual error_code getRelocationOffset(DataRefImpl Rel,
-                                         uint64_t &Res) const;
   virtual error_code getRelocationSymbol(DataRefImpl Rel,
                                          SymbolRef &Res) const;
   virtual error_code getRelocationType(DataRefImpl Rel,
index fd180d4e58a21da6052606786406b2699bd9dab0..a0f3c4bdca83db9e5f6e2da681e3dba9d45a4211 100644 (file)
@@ -104,7 +104,6 @@ public:
   error_code getNext(RelocationRef &Result) const;
 
   error_code getAddress(uint64_t &Result) const;
-  error_code getOffset(uint64_t &Result) const;
   error_code getSymbol(SymbolRef &Result) const;
   error_code getType(uint64_t &Result) const;
 
@@ -196,7 +195,7 @@ public:
 
   error_code getName(StringRef &Result) const;
   error_code getAddress(uint64_t &Result) const;
-  error_code getFileOffset(uint64_t &Result) const;
+  error_code getOffset(uint64_t &Result) const;
   error_code getSize(uint64_t &Result) const;
   error_code getType(SymbolRef::Type &Result) const;
 
@@ -255,7 +254,7 @@ protected:
   virtual error_code getSymbolNext(DataRefImpl Symb, SymbolRef &Res) const = 0;
   virtual error_code getSymbolName(DataRefImpl Symb, StringRef &Res) const = 0;
   virtual error_code getSymbolAddress(DataRefImpl Symb, uint64_t &Res) const =0;
-  virtual error_code getSymbolFileOffset(DataRefImpl Symb, uint64_t &Res) const =0;
+  virtual error_code getSymbolOffset(DataRefImpl Symb, uint64_t &Res) const =0;
   virtual error_code getSymbolSize(DataRefImpl Symb, uint64_t &Res) const = 0;
   virtual error_code getSymbolType(DataRefImpl Symb,
                                    SymbolRef::Type &Res) const = 0;
@@ -290,8 +289,6 @@ protected:
                                        RelocationRef &Res) const = 0;
   virtual error_code getRelocationAddress(DataRefImpl Rel,
                                           uint64_t &Res) const =0;
-  virtual error_code getRelocationOffset(DataRefImpl Rel,
-                                         uint64_t &Res) const =0;
   virtual error_code getRelocationSymbol(DataRefImpl Rel,
                                          SymbolRef &Res) const = 0;
   virtual error_code getRelocationType(DataRefImpl Rel,
@@ -366,8 +363,8 @@ inline error_code SymbolRef::getAddress(uint64_t &Result) const {
   return OwningObject->getSymbolAddress(SymbolPimpl, Result);
 }
 
-inline error_code SymbolRef::getFileOffset(uint64_t &Result) const {
-  return OwningObject->getSymbolFileOffset(SymbolPimpl, Result);
+inline error_code SymbolRef::getOffset(uint64_t &Result) const {
+  return OwningObject->getSymbolOffset(SymbolPimpl, Result);
 }
 
 inline error_code SymbolRef::getSize(uint64_t &Result) const {
@@ -489,10 +486,6 @@ inline error_code RelocationRef::getAddress(uint64_t &Result) const {
   return OwningObject->getRelocationAddress(RelocationPimpl, Result);
 }
 
-inline error_code RelocationRef::getOffset(uint64_t &Result) const {
-  return OwningObject->getRelocationOffset(RelocationPimpl, Result);
-}
-
 inline error_code RelocationRef::getSymbol(SymbolRef &Result) const {
   return OwningObject->getRelocationSymbol(RelocationPimpl, Result);
 }
index 8344ca071d34faa42d57e0e91d2d1ef5f4780d0a..c6ce56221a555ee0e2fecb20915989fdc94adc49 100644 (file)
@@ -101,7 +101,7 @@ error_code COFFObjectFile::getSymbolNext(DataRefImpl Symb,
   return getSymbolName(symb, Result);
 }
 
-error_code COFFObjectFile::getSymbolFileOffset(DataRefImpl Symb,
+error_code COFFObjectFile::getSymbolOffset(DataRefImpl Symb,
                                             uint64_t &Result) const {
   const coff_symbol *symb = toSymb(Symb);
   const coff_section *Section = NULL;
@@ -113,7 +113,7 @@ error_code COFFObjectFile::getSymbolFileOffset(DataRefImpl Symb,
   if (Type == 'U' || Type == 'w')
     Result = UnknownAddressOrSize;
   else if (Section)
-    Result = Section->PointerToRawData + symb->Value;
+    Result = Section->VirtualAddress + symb->Value;
   else
     Result = symb->Value;
   return object_error::success;
@@ -131,9 +131,11 @@ error_code COFFObjectFile::getSymbolAddress(DataRefImpl Symb,
   if (Type == 'U' || Type == 'w')
     Result = UnknownAddressOrSize;
   else if (Section)
-    Result = Section->VirtualAddress + symb->Value;
+    Result = reinterpret_cast<uintptr_t>(base() +
+                                         Section->PointerToRawData +
+                                         symb->Value);
   else
-    Result = symb->Value;
+    Result = reinterpret_cast<uintptr_t>(base() + symb->Value);
   return object_error::success;
 }
 
@@ -622,11 +624,6 @@ error_code COFFObjectFile::getRelocationAddress(DataRefImpl Rel,
   Res = toRel(Rel)->VirtualAddress;
   return object_error::success;
 }
-error_code COFFObjectFile::getRelocationOffset(DataRefImpl Rel,
-                                               uint64_t &Res) const {
-  Res = toRel(Rel)->VirtualAddress;
-  return object_error::success;
-}
 error_code COFFObjectFile::getRelocationSymbol(DataRefImpl Rel,
                                                SymbolRef &Res) const {
   const coff_relocation* R = toRel(Rel);
index a6c4c257d0e55e13ebac1646dcb9b47185dccc8b..d1a43e7b958d56fde4e64c942853d196e3d362d7 100644 (file)
@@ -325,7 +325,7 @@ class ELFObjectFile : public ObjectFile {
 protected:
   virtual error_code getSymbolNext(DataRefImpl Symb, SymbolRef &Res) const;
   virtual error_code getSymbolName(DataRefImpl Symb, StringRef &Res) const;
-  virtual error_code getSymbolFileOffset(DataRefImpl Symb, uint64_t &Res) const;
+  virtual error_code getSymbolOffset(DataRefImpl Symb, uint64_t &Res) const;
   virtual error_code getSymbolAddress(DataRefImpl Symb, uint64_t &Res) const;
   virtual error_code getSymbolSize(DataRefImpl Symb, uint64_t &Res) const;
   virtual error_code getSymbolNMTypeChar(DataRefImpl Symb, char &Res) const;
@@ -355,8 +355,6 @@ protected:
                                        RelocationRef &Res) const;
   virtual error_code getRelocationAddress(DataRefImpl Rel,
                                           uint64_t &Res) const;
-  virtual error_code getRelocationOffset(DataRefImpl Rel,
-                                         uint64_t &Res) const;
   virtual error_code getRelocationSymbol(DataRefImpl Rel,
                                          SymbolRef &Res) const;
   virtual error_code getRelocationType(DataRefImpl Rel,
@@ -464,7 +462,7 @@ ELFObjectFile<target_endianness, is64Bits>
 
 template<support::endianness target_endianness, bool is64Bits>
 error_code ELFObjectFile<target_endianness, is64Bits>
-                        ::getSymbolFileOffset(DataRefImpl Symb,
+                        ::getSymbolOffset(DataRefImpl Symb,
                                           uint64_t &Result) const {
   validateSymbol(Symb);
   const Elf_Sym  *symb = getSymbol(Symb);
@@ -488,8 +486,7 @@ error_code ELFObjectFile<target_endianness, is64Bits>
   case ELF::STT_FUNC:
   case ELF::STT_OBJECT:
   case ELF::STT_NOTYPE:
-    Result = symb->st_value +
-             (Section ? Section->sh_offset - Section->sh_addr : 0);
+    Result = symb->st_value;
     return object_error::success;
   default:
     Result = UnknownAddressOrSize;
@@ -505,25 +502,28 @@ error_code ELFObjectFile<target_endianness, is64Bits>
   const Elf_Sym  *symb = getSymbol(Symb);
   const Elf_Shdr *Section;
   switch (getSymbolTableIndex(symb)) {
-  case ELF::SHN_COMMON:
+  case ELF::SHN_COMMON: // Fall through.
    // Undefined symbols have no address yet.
   case ELF::SHN_UNDEF:
     Result = UnknownAddressOrSize;
     return object_error::success;
   case ELF::SHN_ABS:
-    Result = symb->st_value;
+    Result = reinterpret_cast<uintptr_t>(base()+symb->st_value);
     return object_error::success;
   default: Section = getSection(symb);
   }
-
+  const uint8_t* addr = base();
+  if (Section)
+    addr += Section->sh_offset;
   switch (symb->getType()) {
   case ELF::STT_SECTION:
-    Result = Section ? Section->sh_addr : UnknownAddressOrSize;
+    Result = reinterpret_cast<uintptr_t>(addr);
     return object_error::success;
-  case ELF::STT_FUNC:
-  case ELF::STT_OBJECT:
+  case ELF::STT_FUNC: // Fall through.
+  case ELF::STT_OBJECT: // Fall through.
   case ELF::STT_NOTYPE:
-    Result = symb->st_value;
+    addr += symb->st_value;
+    Result = reinterpret_cast<uintptr_t>(addr);
     return object_error::success;
   default:
     Result = UnknownAddressOrSize;
@@ -920,29 +920,6 @@ error_code ELFObjectFile<target_endianness, is64Bits>
   return object_error::success;
 }
 
-template<support::endianness target_endianness, bool is64Bits>
-error_code ELFObjectFile<target_endianness, is64Bits>
-                        ::getRelocationOffset(DataRefImpl Rel,
-                                              uint64_t &Result) const {
-  uint64_t offset;
-  const Elf_Shdr *sec = getSection(Rel.w.b);
-  switch (sec->sh_type) {
-    default :
-      report_fatal_error("Invalid section type in Rel!");
-    case ELF::SHT_REL : {
-      offset = getRel(Rel)->r_offset;
-      break;
-    }
-    case ELF::SHT_RELA : {
-      offset = getRela(Rel)->r_offset;
-      break;
-    }
-  }
-
-  Result = offset - sec->sh_addr;
-  return object_error::success;
-}
-
 template<support::endianness target_endianness, bool is64Bits>
 error_code ELFObjectFile<target_endianness, is64Bits>
                         ::getRelocationType(DataRefImpl Rel,
index bb4f6a275b0f7ed90107f0377e9b502438f6b93c..65ce5f882a06bc055a6b11480bf757ba21f32e82 100644 (file)
@@ -125,27 +125,23 @@ error_code MachOObjectFile::getSymbolName(DataRefImpl DRI,
   return object_error::success;
 }
 
-error_code MachOObjectFile::getSymbolFileOffset(DataRefImpl DRI,
-                                                uint64_t &Result) const {
+error_code MachOObjectFile::getSymbolOffset(DataRefImpl DRI,
+                                             uint64_t &Result) const {
+  uint64_t SectionOffset;
+  uint8_t SectionIndex;
   if (MachOObj->is64Bit()) {
     InMemoryStruct<macho::Symbol64TableEntry> Entry;
     getSymbol64TableEntry(DRI, Entry);
     Result = Entry->Value;
-    if (Entry->SectionIndex) {
-      InMemoryStruct<macho::Section64> Section;
-      getSection64(Sections[Entry->SectionIndex-1], Section);
-      Result += Section->Offset - Section->Address;
-    }
+    SectionIndex = Entry->SectionIndex;
   } else {
     InMemoryStruct<macho::SymbolTableEntry> Entry;
     getSymbolTableEntry(DRI, Entry);
     Result = Entry->Value;
-    if (Entry->SectionIndex) {
-      InMemoryStruct<macho::Section> Section;
-      getSection(Sections[Entry->SectionIndex-1], Section);
-      Result += Section->Offset - Section->Address;
-    }
+    SectionIndex = Entry->SectionIndex;
   }
+  getSectionAddress(Sections[SectionIndex-1], SectionOffset);
+  Result -= SectionOffset;
 
   return object_error::success;
 }
@@ -166,50 +162,7 @@ error_code MachOObjectFile::getSymbolAddress(DataRefImpl DRI,
 
 error_code MachOObjectFile::getSymbolSize(DataRefImpl DRI,
                                           uint64_t &Result) const {
-  uint32_t LoadCommandCount = MachOObj->getHeader().NumLoadCommands;
-  uint64_t BeginOffset;
-  uint64_t EndOffset = 0;
-  uint8_t SectionIndex;
-  if (MachOObj->is64Bit()) {
-    InMemoryStruct<macho::Symbol64TableEntry> Entry;
-    getSymbol64TableEntry(DRI, Entry);
-    BeginOffset = Entry->Value;
-    SectionIndex = Entry->SectionIndex;
-    if (!SectionIndex) {
-      Result = UnknownAddressOrSize;
-      return object_error::success;
-    }
-    DRI.d.b++;
-    moveToNextSymbol(DRI);
-    if (DRI.d.a < LoadCommandCount) {
-      getSymbol64TableEntry(DRI, Entry);
-      if (Entry->SectionIndex == SectionIndex)
-        EndOffset += Entry->Value;
-    }
-  } else {
-    InMemoryStruct<macho::SymbolTableEntry> Entry;
-    getSymbolTableEntry(DRI, Entry);
-    BeginOffset = Entry->Value;
-    SectionIndex = Entry->SectionIndex;
-    if (!SectionIndex) {
-      Result = UnknownAddressOrSize;
-      return object_error::success;
-    }
-    DRI.d.b++;
-    moveToNextSymbol(DRI);
-    if (DRI.d.a < LoadCommandCount) {
-      getSymbolTableEntry(DRI, Entry);
-      if (Entry->SectionIndex == SectionIndex)
-        EndOffset += Entry->Value;
-    }
-  }
-  if (!EndOffset) {
-    uint64_t Size;
-    getSectionSize(Sections[SectionIndex-1], Size);
-    getSectionAddress(Sections[SectionIndex-1], EndOffset);
-    EndOffset += Size;
-  }
-  Result = EndOffset - BeginOffset;
+  Result = UnknownAddressOrSize;
   return object_error::success;
 }
 
@@ -322,7 +275,7 @@ error_code MachOObjectFile::getSymbolSection(DataRefImpl Symb,
   if (index == 0)
     Res = end_sections();
   else
-    Res = section_iterator(SectionRef(Sections[index-1], this));
+    Res = section_iterator(SectionRef(Sections[index], this));
 
   return object_error::success;
 }
@@ -661,7 +614,7 @@ error_code MachOObjectFile::getRelocationAddress(DataRefImpl Rel,
   bool isScattered = (Arch != Triple::x86_64) &&
                      (RE->Word0 & macho::RF_Scattered);
   uint64_t RelAddr = 0;
-  if (isScattered)
+  if (isScattered) 
     RelAddr = RE->Word0 & 0xFFFFFF;
   else
     RelAddr = RE->Word0;
@@ -669,20 +622,6 @@ error_code MachOObjectFile::getRelocationAddress(DataRefImpl Rel,
   Res = reinterpret_cast<uintptr_t>(sectAddress + RelAddr);
   return object_error::success;
 }
-error_code MachOObjectFile::getRelocationOffset(DataRefImpl Rel,
-                                                uint64_t &Res) const {
-  InMemoryStruct<macho::RelocationEntry> RE;
-  getRelocation(Rel, RE);
-
-  unsigned Arch = getArch();
-  bool isScattered = (Arch != Triple::x86_64) &&
-                     (RE->Word0 & macho::RF_Scattered);
-  if (isScattered)
-    Res = RE->Word0 & 0xFFFFFF;
-  else
-    Res = RE->Word0;
-  return object_error::success;
-}
 error_code MachOObjectFile::getRelocationSymbol(DataRefImpl Rel,
                                                 SymbolRef &Res) const {
   InMemoryStruct<macho::RelocationEntry> RE;
index f061ea7cebedac40087ed7ac5189a7a006e8a7dc..719bf882f221dc38e360b823cceff7fbf945d1fb 100644 (file)
@@ -150,9 +150,9 @@ uint64_t LLVMGetSymbolAddress(LLVMSymbolIteratorRef SI) {
   return ret;
 }
 
-uint64_t LLVMGetSymbolFileOffset(LLVMSymbolIteratorRef SI) {
+uint64_t LLVMGetSymbolOffset(LLVMSymbolIteratorRef SI) {
   uint64_t ret;
-  if (error_code ec = (*unwrap(SI))->getFileOffset(ret))
+  if (error_code ec = (*unwrap(SI))->getOffset(ret))
     report_fatal_error(ec.message());
   return ret;
 }
@@ -172,13 +172,6 @@ uint64_t LLVMGetRelocationAddress(LLVMRelocationIteratorRef RI) {
   return ret;
 }
 
-uint64_t LLVMGetRelocationOffset(LLVMRelocationIteratorRef RI) {
-  uint64_t ret;
-  if (error_code ec = (*unwrap(RI))->getOffset(ret))
-    report_fatal_error(ec.message());
-  return ret;
-}
-
 LLVMSymbolIteratorRef LLVMGetRelocationSymbol(LLVMRelocationIteratorRef RI) {
   SymbolRef ret;
   if (error_code ec = (*unwrap(RI))->getSymbol(ret))
index 254421510f415ed788a59b1f76d5328d208cea65..e79d72d1933c4e714e59bb3fec005405794fe1e9 100644 (file)
@@ -286,7 +286,7 @@ static void DumpSymbolNamesFromObject(ObjectFile *obj) {
       if (error(i->getSize(s.Size))) break;
     }
     if (PrintAddress)
-      if (error(i->getFileOffset(s.Address))) break;
+      if (error(i->getOffset(s.Address))) break;
     if (error(i->getNMTypeChar(s.TypeChar))) break;
     if (error(i->getName(s.Name))) break;
     SymbolList.push_back(s);
index ef5258dc9b2b20a42c792d5e0e824dcbd7ec38fc..4ccae5148bd5f17c7a615fcdc4c97ba25a89d1a6 100644 (file)
@@ -419,7 +419,7 @@ void llvm::DisassembleInputMachO(StringRef Filename) {
 
       // Start at the address of the symbol relative to the section's address.
       uint64_t Start = 0;
-      Symbols[SymIdx].getFileOffset(Start);
+      Symbols[SymIdx].getOffset(Start);
 
       // Stop disassembling either at the beginning of the next symbol or at
       // the end of the section.
@@ -432,7 +432,7 @@ void llvm::DisassembleInputMachO(StringRef Filename) {
         if (NextSymType == SymbolRef::ST_Function) {
           Sections[SectIdx].containsSymbol(Symbols[NextSymIdx],
                                            containsNextSym);
-          Symbols[NextSymIdx].getFileOffset(NextSym);
+          Symbols[NextSymIdx].getOffset(NextSym);
           break;
         }
         ++NextSymIdx;
index 0f0ae1ceb7fd066e2aa5b1cf14208795ea313be7..9071d58b0e7e27a68883ae8249bdc924a3399a16 100644 (file)
@@ -186,7 +186,7 @@ static void DisassembleObject(const ObjectFile *Obj, bool InlineRelocs) {
       bool contains;
       if (!error(i->containsSymbol(*si, contains)) && contains) {
         uint64_t Address;
-        if (error(si->getFileOffset(Address))) break;
+        if (error(si->getOffset(Address))) break;
         StringRef Name;
         if (error(si->getName(Name))) break;
         Symbols.push_back(std::make_pair(Address, Name));
@@ -485,7 +485,7 @@ static void PrintSymbolTable(const ObjectFile *o) {
       uint64_t Size;
       section_iterator Section = o->end_sections();
       if (error(si->getName(Name))) continue;
-      if (error(si->getFileOffset(Offset))) continue;
+      if (error(si->getOffset(Offset))) continue;
       if (error(si->isGlobal(Global))) continue;
       if (error(si->getType(Type))) continue;
       if (error(si->isWeak(Weak))) continue;