diff options
author | Nitesh Jain <nitesh.jain@imgtec.com> | 2017-08-14 16:30:25 +0000 |
---|---|---|
committer | Nitesh Jain <nitesh.jain@imgtec.com> | 2017-08-14 16:30:25 +0000 |
commit | 8ac63e8f9f58a44c2512d019b4ead10b37895d15 (patch) | |
tree | f420768259e3b136d454934ed751a9e3c5970c2f /lldb/source/Plugins/ObjectFile | |
parent | c3f6b2806f2a73e3b98d6c2e3aa36b0e8795eef7 (diff) | |
download | bcm5719-llvm-8ac63e8f9f58a44c2512d019b4ead10b37895d15.tar.gz bcm5719-llvm-8ac63e8f9f58a44c2512d019b4ead10b37895d15.zip |
[LLDB][MIPS] Set the Section's file address for
ELF section to LLDB_INVALID_ADDRESS if SHF_ALLOC is not set.
Reviewers: labath, clayborg
Subscribers: jaydeep, bhushan, lldb-commits
Differential Revision: https://reviews.llvm.org/D35784
llvm-svn: 310855
Diffstat (limited to 'lldb/source/Plugins/ObjectFile')
-rw-r--r-- | lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp index 3b33cf1601f..83cab432311 100644 --- a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp +++ b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp @@ -1987,7 +1987,9 @@ void ObjectFileELF::CreateSections(SectionList &unified_section_list) { ? m_arch_spec.GetDataByteSize() : eSectionTypeCode == sect_type ? m_arch_spec.GetCodeByteSize() : 1; - + const addr_t sect_file_addr = header.sh_flags & SHF_ALLOC + ? header.sh_addr + : LLDB_INVALID_ADDRESS; elf::elf_xword log2align = (header.sh_addralign == 0) ? 0 : llvm::Log2_64(header.sh_addralign); SectionSP section_sp(new Section( @@ -1997,7 +1999,7 @@ void ObjectFileELF::CreateSections(SectionList &unified_section_list) { SectionIndex(I), // Section ID. name, // Section name. sect_type, // Section type. - header.sh_addr, // VM address. + sect_file_addr, // VM address. vm_size, // VM size in bytes of this section. header.sh_offset, // Offset of this section in the file. file_size, // Size of the section as found in the file. |