Be sure to set the data offset to zero if we actually mmap the entire ELF file.
authorGreg Clayton <gclayton@apple.com>
Thu, 7 Feb 2013 21:49:54 +0000 (21:49 +0000)
committerGreg Clayton <gclayton@apple.com>
Thu, 7 Feb 2013 21:49:54 +0000 (21:49 +0000)
llvm-svn: 174668

lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp

index c2dc793..5500e23 100644 (file)
@@ -192,7 +192,8 @@ ObjectFileELF::CreateInstance (const lldb::ModuleSP &module_sp,
             // Update the data to contain the entire file if it doesn't already
             if (data_sp->GetByteSize() < length) {
                 data_sp = file->MemoryMapFileContents(file_offset, length);
-                magic = data_sp->GetBytes() + data_offset;
+                data_offset = 0;
+                magic = data_sp->GetBytes();
             }
             unsigned address_size = ELFHeader::AddressSizeInBytes(magic);
             if (address_size == 4 || address_size == 8)