Skip to content

Commit fbb8b04

Browse files
committed
abnativeelf: always mark static libraries for stripping
1 parent 0aed934 commit fbb8b04

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

native/abnativeelf.cpp

+17-2
Original file line numberDiff line numberDiff line change
@@ -470,8 +470,23 @@ static ELFParseResult identify_binary_data(const char *data,
470470
}
471471
result.build_id = std::move(build_id);
472472
result.soname = std::move(soname);
473-
result.has_debug_info =
474-
is_debug_info_present(section_headers, elf_file, shstrndx);
473+
switch (result.bin_type) {
474+
case BinaryType::Invalid:
475+
case BinaryType::LLVM_IR:
476+
break;
477+
case BinaryType::Static:
478+
// Let's assume static libraries have debug info
479+
// as we can't easily check them
480+
result.has_debug_info = true;
481+
break;
482+
case BinaryType::Dynamic:
483+
case BinaryType::Executable:
484+
case BinaryType::Relocatable:
485+
case BinaryType::KernelObject:
486+
result.has_debug_info =
487+
is_debug_info_present(section_headers, elf_file, shstrndx);
488+
break;
489+
}
475490
const bool is_64bit = gelf_getclass(elf_file) == ELFCLASS64;
476491

477492
// detect architecture

0 commit comments

Comments
 (0)