[llvm] Warn on align directive with non-zero fill value in virtual sections (PR #66792)

Matthias Braun via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 22 14:51:48 PDT 2023


MatzeB wrote:

Hey this seems to produce a lot of invalid warnings for me. Example on a linux x86-64 system:

```
$ cat hello.cpp
template<typename T> struct C { static T comdat_global; };
template<typename T> T C<T>::comdat_global;
void* use = (void*)&C<int>::comdat_global;
```
Results in:
```
$ clang -S hello.cpp && clang -Wall -c hello.s
hello.s:6:14: warning: ignoring non-zero fill value in SHT_NOBITS section '.bss._ZN1CIiE13comdat_globalE'
        .p2align        2, 0x0
```

it seems this just checks for the presence of fill-expression but not if it is actually non-zero...

https://github.com/llvm/llvm-project/pull/66792


More information about the llvm-commits mailing list