From: Owen Anderson Date: Wed, 12 Oct 2011 21:43:24 +0000 (+0000) Subject: Section indices in MachO symbol tables begin at 1, not 0. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=41242942fcbb2e6bc4e5bed3e8041f7b20ece8af;p=oota-llvm.git Section indices in MachO symbol tables begin at 1, not 0. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141815 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Object/MachOObjectFile.cpp b/lib/Object/MachOObjectFile.cpp index b89ff4beb7a..21fd4b6915c 100644 --- a/lib/Object/MachOObjectFile.cpp +++ b/lib/Object/MachOObjectFile.cpp @@ -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;