Skip to content

Commit 9cbd304

Browse files
committed
[LLDB][ELF] Don't match on file size.
As pointed out by @labath, if you use `objcopy --only-keep-debug`, only placeholder sections will be present so the file sizes won't match. We already ignore file offsets when doing the comparison. rdar://124467787
1 parent 9653351 commit 9cbd304

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1864,7 +1864,6 @@ static SectionSP FindMatchingSection(const SectionList &section_list,
18641864

18651865
addr_t vm_addr = section->GetFileAddress();
18661866
ConstString name = section->GetName();
1867-
offset_t file_size = section->GetFileSize();
18681867
offset_t byte_size = section->GetByteSize();
18691868
SectionType type = section->GetType();
18701869
bool thread_specific = section->IsThreadSpecific();
@@ -1875,8 +1874,7 @@ static SectionSP FindMatchingSection(const SectionList &section_list,
18751874
if (sect->GetName() == name && sect->GetType() == type &&
18761875
sect->IsThreadSpecific() == thread_specific &&
18771876
sect->GetPermissions() == permissions &&
1878-
sect->GetFileSize() == file_size && sect->GetByteSize() == byte_size &&
1879-
sect->GetFileAddress() == vm_addr &&
1877+
sect->GetByteSize() == byte_size && sect->GetFileAddress() == vm_addr &&
18801878
sect->GetLog2Align() == alignment) {
18811879
sect_sp = sect;
18821880
break;

0 commit comments

Comments
 (0)