diff options
author | Greg Clayton <gclayton@apple.com> | 2013-02-07 21:49:54 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2013-02-07 21:49:54 +0000 |
commit | 64ff6c70da3077c8fcafdd19b5d2377bc7bdcf13 (patch) | |
tree | 68566c3e662dca85b61542284d0fcf8598e4aee9 /lldb/source/Plugins/ObjectFile/ELF | |
parent | d2cc63f10b6add690e14e2eadb00e7285b8698df (diff) | |
download | bcm5719-llvm-64ff6c70da3077c8fcafdd19b5d2377bc7bdcf13.tar.gz bcm5719-llvm-64ff6c70da3077c8fcafdd19b5d2377bc7bdcf13.zip |
Be sure to set the data offset to zero if we actually mmap the entire ELF file.
llvm-svn: 174668
Diffstat (limited to 'lldb/source/Plugins/ObjectFile/ELF')
-rw-r--r-- | lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp index c2dc7932a2f..5500e236998 100644 --- a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp +++ b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp @@ -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) |