File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
lldb/source/Plugins/ObjectFile/ELF Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -1987,7 +1987,9 @@ void ObjectFileELF::CreateSections(SectionList &unified_section_list) {
1987
1987
? m_arch_spec.GetDataByteSize ()
1988
1988
: eSectionTypeCode == sect_type ? m_arch_spec.GetCodeByteSize ()
1989
1989
: 1 ;
1990
-
1990
+ const addr_t sect_file_addr = header.sh_flags & SHF_ALLOC
1991
+ ? header.sh_addr
1992
+ : LLDB_INVALID_ADDRESS;
1991
1993
elf::elf_xword log2align =
1992
1994
(header.sh_addralign == 0 ) ? 0 : llvm::Log2_64 (header.sh_addralign );
1993
1995
SectionSP section_sp (new Section (
@@ -1997,7 +1999,7 @@ void ObjectFileELF::CreateSections(SectionList &unified_section_list) {
1997
1999
SectionIndex (I), // Section ID.
1998
2000
name, // Section name.
1999
2001
sect_type, // Section type.
2000
- header. sh_addr , // VM address.
2002
+ sect_file_addr , // VM address.
2001
2003
vm_size, // VM size in bytes of this section.
2002
2004
header.sh_offset , // Offset of this section in the file.
2003
2005
file_size, // Size of the section as found in the file.
You can’t perform that action at this time.
0 commit comments