Section indices in MachO symbol tables begin at 1, not 0.
authorOwen Anderson <resistor@mac.com>
Wed, 12 Oct 2011 21:43:24 +0000 (21:43 +0000)
committerOwen Anderson <resistor@mac.com>
Wed, 12 Oct 2011 21:43:24 +0000 (21:43 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141815 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Object/MachOObjectFile.cpp

index b89ff4beb7af350bf8bf00bc0f2a97a99abff840..21fd4b6915c18d68ff68ae99e282d389f335b83a 100644 (file)
@@ -153,7 +153,7 @@ error_code MachOObjectFile::getSymbolAddress(DataRefImpl DRI,
     SymbolOffset = Entry->Value;
     SectionIndex = Entry->SectionIndex;
   }
-  getSectionAddress(Sections[SectionIndex], Result);
+  getSectionAddress(Sections[SectionIndex-1], Result);
   Result += SymbolOffset;
 
   return object_error::success;