Skip to content

Commit fa7a397

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 dd66036 commit fa7a397

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
@@ -1851,7 +1851,6 @@ static SectionSP FindMatchingSection(const SectionList &section_list,
18511851

18521852
addr_t vm_addr = section->GetFileAddress();
18531853
ConstString name = section->GetName();
1854-
offset_t file_size = section->GetFileSize();
18551854
offset_t byte_size = section->GetByteSize();
18561855
SectionType type = section->GetType();
18571856
bool thread_specific = section->IsThreadSpecific();
@@ -1862,8 +1861,7 @@ static SectionSP FindMatchingSection(const SectionList &section_list,
18621861
if (sect->GetName() == name && sect->GetType() == type &&
18631862
sect->IsThreadSpecific() == thread_specific &&
18641863
sect->GetPermissions() == permissions &&
1865-
sect->GetFileSize() == file_size && sect->GetByteSize() == byte_size &&
1866-
sect->GetFileAddress() == vm_addr &&
1864+
sect->GetByteSize() == byte_size && sect->GetFileAddress() == vm_addr &&
18671865
sect->GetLog2Align() == alignment) {
18681866
sect_sp = sect;
18691867
break;

0 commit comments

Comments
 (0)