This change introduces support for zero flag ELF section groups to LLVM. LLVM already supports COMDAT sections, which in ELF are a special type of ELF section groups. These are generally useful to enable linker GC where you want a group of sections to always travel together, that is to be either retained or discarded as a whole, but without the COMDAT semantics. Other ELF assemblers already support zero flag ELF section groups and this change helps us reach feature parity. Differential Revision: https://reviews.llvm.org/D95851
20 lines
463 B
LLVM
20 lines
463 B
LLVM
; Checks that comdat with noduplicates kind is lowered to a zero-flag ELF
|
|
; section group.
|
|
; RUN: llc < %s -mtriple=x86_64-unknown-linux | FileCheck %s
|
|
|
|
; CHECK: .section .text.f1,"axG",@progbits,f1{{$}}
|
|
; CHECK: .section .text.f2,"axG",@progbits,f1{{$}}
|
|
; CHECK: .section .bss.g1,"aGw",@nobits,f1{{$}}
|
|
|
|
$f1 = comdat noduplicates
|
|
|
|
define void @f1() comdat {
|
|
unreachable
|
|
}
|
|
|
|
define hidden void @f2() comdat($f1) {
|
|
unreachable
|
|
}
|
|
|
|
@g1 = global i32 0, comdat($f1)
|