[ELF] Refine section group --gc-sections rules to not discard .debug_types
clang/gcc -fdebug-type-sections places .debug_types and .rela.debug_types in a section group, with a signature symbol which represents the type signature. The section group is for deduplication purposes. After D70146, we will discard such section groups. Refine the rule so that we will retain the group if no member has the SHF_ALLOC flag. GNU ld has a similar rule to retain the group if all members have the SEC_DEBUGGING flag. We try to be more general for future-proof purposes: if other non-SHF_ALLOC sections have deduplication needs, they may be placed in a section group. Don't discard them. Reviewed By: grimar Differential Revision: https://reviews.llvm.org/D71157
Loading
Please sign in to comment