[PATCH] D80805: [KernelAddressSanitizer] Make globals constructors compatible with kernel

Nico Weber via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 5 14:03:10 PDT 2020


thakis added inline comments.


================
Comment at: clang/test/CodeGen/asan-globals.cpp:14
 int blacklisted_global;
+int __attribute__((section(".foo.bar"))) sectioned_global;
 
----------------
nickdesaulniers wrote:
> /Users/thakis/src/llvm-project/clang/test/CodeGen/asan-globals.cpp:14:28: error: argument to 'section' attribute is not valid for this target: mach-o section specifier requires a segment and section separated by a comma
> int __attribute__((section(".foo.bar"))) sectioned_global;
>                            ^
> http://45.33.8.238/mac/14998/step_7.txt
> 
> Using an explicit Linux target triple would avoid this.
> 
> See also attribute-section-data-common.c for the OSX portable example.
> Using an explicit Linux target triple would avoid this.

It'd also make the test fewer things, since it currently tests asan on mac (when run on mac).

If the attribute-section-data-common.c approach works here, great. If not, maybe the linux-specific bits could go in a new test file?

Are you planning on fixing the test, or should we revert for now so we can figure things out without the tree being red?




Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D80805/new/

https://reviews.llvm.org/D80805





More information about the cfe-commits mailing list