https://bugs.llvm.org/show_bug.cgi?id=47925
Bug ID: 47925
Summary: [ASan] -fno-common generates a comdat with asan
options
Product: clang
Version: trunk
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P
Component: LLVM Codegen
Assignee: unassignedclangb...@nondot.org
Reporter: wolfgang_p...@playstation.sony.com
CC: llvm-bugs@lists.llvm.org, neeil...@live.com,
richard-l...@metafoo.co.uk
The following trivial source generates a comdat for 'bar' when using ASan:
/*==================*/
char bar;
/*==================*/
clang -emit-llvm -S -fsanitize=address -fdata-sections
-fsanitize-address-globals-dead-stripping -c bar.c
bar.ll:
<snip>
@bar = dso_local global { i8, [63 x i8] } zeroinitializer, comdat, align 32
<snip>
Without either -fsanitize-address-globals-dead-stripping or -fdata-sections no
comdat is generated.
The consequence is that we don't find some ODR violations at link time with
these options.
Note that commit
https://github.com/llvm/llvm-project/commit/3d9a0445cce368b55dc3a573bc91fe902bbb977f
changed the default to -fno-common. Before, you would have to give -fno-common
on the command line to trigger this behaviour.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs