See [GRP_COMDAT group with STB_LOCAL signature](https://groups.google.com/g/generic-abi/c/2X6mR-s2zoc) objcopy PR: https://sourceware.org/bugzilla/show_bug.cgi?id=27931 GRP_COMDAT deduplication is purely based on the signature symbol name in ld.lld/GNU ld/gold. The local/global status is not part of the equation. If the signature symbol is localized by --localize-hidden or --keep-global-symbol, the intention is likely to make the group fully localized. Drop GRP_COMDAT to suppress deduplication. Reviewed By: jhenderson Differential Revision: https://reviews.llvm.org/D106782
38 lines
923 B
Plaintext
38 lines
923 B
Plaintext
## This checks that the group section is shrunk when its member is removed.
|
|
|
|
# RUN: yaml2obj %s -o - \
|
|
# RUN: | llvm-objcopy -R .foo - - \
|
|
# RUN: | obj2yaml - \
|
|
# RUN: | FileCheck %s
|
|
|
|
# CHECK: - Name: .group
|
|
# CHECK: Members:
|
|
# CHECK-NEXT: - SectionOrType: GRP_COMDAT
|
|
# CHECK-NEXT: - SectionOrType: .bar
|
|
# CHECK-NOT: - SectionOrType:
|
|
|
|
--- !ELF
|
|
FileHeader:
|
|
Class: ELFCLASS64
|
|
Data: ELFDATA2LSB
|
|
Type: ET_REL
|
|
Machine: EM_X86_64
|
|
Sections:
|
|
- Name: .group
|
|
Type: SHT_GROUP
|
|
Info: foo_bar_grp
|
|
Members:
|
|
- SectionOrType: GRP_COMDAT
|
|
- SectionOrType: .foo
|
|
- SectionOrType: .bar
|
|
- Name: .foo
|
|
Type: SHT_PROGBITS
|
|
Flags: [ SHF_ALLOC, SHF_GROUP ]
|
|
- Name: .bar
|
|
Type: SHT_PROGBITS
|
|
Flags: [ SHF_ALLOC, SHF_GROUP ]
|
|
Symbols:
|
|
- Name: foo_bar_grp
|
|
Section: .group
|
|
Binding: STB_GLOBAL
|