Index: lib/Target/X86/X86MCInstLower.cpp =================================================================== --- lib/Target/X86/X86MCInstLower.cpp +++ lib/Target/X86/X86MCInstLower.cpp @@ -1098,7 +1098,7 @@ if (Subtarget->isTargetELF()) { auto *Section = OutContext.getELFSection( "xray_instr_map", ELF::SHT_PROGBITS, - ELF::SHF_ALLOC | ELF::SHF_GROUP | ELF::SHF_MERGE, 0, + ELF::SHF_ALLOC | ELF::SHF_GROUP | ELF::SHF_MERGE, 32, CurrentFnSym->getName()); auto PrevSection = OutStreamer->getCurrentSectionOnly(); OutStreamer->SwitchSection(Section); Index: test/CodeGen/X86/xray-section-group.ll =================================================================== --- /dev/null +++ test/CodeGen/X86/xray-section-group.ll @@ -0,0 +1,7 @@ +; RUN: llc -filetype=asm -o - -mtriple=x86_64-unknown-linux-gnu -function-sections < %s | FileCheck %s + +define i32 @foo() nounwind noinline uwtable "function-instrument"="xray-always" { +; CHECK: .section .text.foo,"ax",@progbits + ret i32 0 +; CHECK: .section xray_instr_map,"aGM",@progbits,32,foo,comdat +}