Be sure to set the data offset to zero if we actually mmap the entire ELF file.

llvm-svn: 174668
This commit is contained in:
Greg Clayton 2013-02-07 21:49:54 +00:00
parent d2cc63f10b
commit 64ff6c70da
1 changed files with 2 additions and 1 deletions

View 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 // Update the data to contain the entire file if it doesn't already
if (data_sp->GetByteSize() < length) { if (data_sp->GetByteSize() < length) {
data_sp = file->MemoryMapFileContents(file_offset, 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); unsigned address_size = ELFHeader::AddressSizeInBytes(magic);
if (address_size == 4 || address_size == 8) if (address_size == 4 || address_size == 8)