https://bugs.llvm.org/show_bug.cgi?id=38449
Bug ID: 38449
Summary: ELFAsmParser warns on COMDAT sections since r335558
Product: libraries
Version: trunk
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P
Component: MC
Assignee: unassignedb...@nondot.org
Reporter: hah...@hahnjo.de
CC: llvm-bugs@lists.llvm.org
Commit r335558 says: "Add a warning if someone attempts to add extra section
flags to sections with well defined semantics like .rodata."
In other words: Many sections are not allowed to have different than their
default flags.
As a result LLVM warns on COMDAT sections. Consider the following LLVM IR:
$test = comdat any
define void @test() comdat {
ret void
}
Compilation to an object file works without problems:
$ clang -c comdat.ll
$ objdump -h comdat.o
[...]
1 .group 00000008 0000000000000000 0000000000000000 00000078 2**2
CONTENTS, READONLY, EXCLUDE, GROUP, LINK_ONCE_DISCARD
2 .text.test 00000001 0000000000000000 0000000000000000 00000040 2**4
CONTENTS, ALLOC, LOAD, READONLY, CODE
[...]
However LLVM complains when reading its own assembly file:
$ clang --save-temps -c comdat.ll
comdat.s:3:2: warning: setting incorrect section attributes for .text.test
.section .text.test,"axG",@progbits,test,comdat
^
The object file is still fine though:
$ objdump -h comdat.o
[...]
1 .group 00000008 0000000000000000 0000000000000000 00000078 2**2
CONTENTS, READONLY, EXCLUDE, GROUP, LINK_ONCE_DISCARD
2 .text.test 00000001 0000000000000000 0000000000000000 00000040 2**4
CONTENTS, ALLOC, LOAD, READONLY, CODE
[...]
I'm seeing the same problem for OpenMP offloading which also makes use of
COMDAT sections.
(1) Is the above LLVM IR incorrect? or
(2) Is the check overly strict? Maybe there is a valid set of (optional) flags
that can be attached to these sections?
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs