section flags in the ELF assembler. This matches the defaults
given in the rest of MC.
Fixes PR37997 where we couldn't assemble our own assembly output
without warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@336072
91177308-0d34-0410-b5e6-
96231b3b80d8
// defaults.
static unsigned defaultSectionFlags(StringRef SectionName) {
+ if (hasPrefix(SectionName, ".rodata.cst"))
+ return ELF::SHF_ALLOC | ELF::SHF_MERGE;
+
if (hasPrefix(SectionName, ".rodata.") || SectionName == ".rodata1")
return ELF::SHF_ALLOC;
# RUN: llvm-mc -triple x86_64-unknown-unknown -filetype=obj %s -o /dev/null 2>&1 | FileCheck %s
-
+
.section .rodata, "ax"
# CHECK: warning: setting incorrect section attributes for .rodata
nop
.section .rodata, "a"
-# CHECK-NOT: warning:
nop
+.section .rodata.cst4, "aM",@progbits,8
+nop
+# CHECK-NOT: warning: