[PATCH] D102973: [ELF] Suppress GRP_COMDAT deduplication if the signature symbol is STB_LOCAL
Fangrui Song via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 7 13:25:33 PDT 2021
MaskRay abandoned this revision.
MaskRay added a comment.
See https://groups.google.com/g/generic-abi/c/2X6mR-s2zoc
I'll abandon this patch but add test coverage. Here is the test I want to add:
comdat-local.s
# REQUIRES: x86
## COMDAT groups are deduplicated by the name of the signature symbol.
## The local/global status is not part of the equation.
# RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t.o
# RUN: ld.lld %t.o %t.o -o %t
# RUN: llvm-readelf -s -x .zero -x .comdat %t | FileCheck %s
# CHECK: NOTYPE LOCAL DEFAULT [[#A:]] zero
# CHECK-NEXT: NOTYPE LOCAL DEFAULT [[#]] comdat
# CHECK-NEXT: NOTYPE LOCAL DEFAULT [[#A]] zero
# CHECK-NOT: {{.}}
## Non-GRP_COMDAT groups are never deduplicated.
# CHECK: Hex dump of section '.zero':
# CHECK-NEXT: [[#%x,]] 0202
## GRP_COMDAT groups are deduplicated.
# CHECK: Hex dump of section '.comdat':
# CHECK-NEXT: [[#%x,]] 01 .{{$}}
.section .zero,"aG", at progbits,zero
zero:
.byte 2
.section .comdat,"aG", at progbits,comdat,comdat
comdat:
.byte 1
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D102973/new/
https://reviews.llvm.org/D102973
More information about the llvm-commits
mailing list