[PATCH] D152604: [Driver] Default -fsanitize-address-globals-dead-stripping to true for ELF

Reid Kleckner via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 13 15:55:42 PDT 2023


rnk added a comment.

In D152604#4415403 <https://reviews.llvm.org/D152604#4415403>, @MaskRay wrote:

> I have thought about not applying `-fsanitize-address-globals-dead-stripping` in `-fno-data-sections` mode, so that we won't have sections like `.bss.a`, but the driver complexity/cognitive load is high, so I think let's just simplify things and make `-fsanitize-address-globals-dead-stripping` default to true. (PS defaults to `-fdata-sections`, but Fuchsia doesn't.)

I'd like to get further simplifications by always emitting globals into the `asan_globals` section on ELF (whether the global data is sliced and associated or not) and always making the module ctor comdat, so there is only one initializer per DSO. I think there is cognitive overhead to the way that ELF objects only *sometimes* use the fancy comdat scheme if they provide a unique module signature, but fallback on the portable global registration scheme when a unique signature cannot be computed because all global symbols have local linkage. I'll look into sending a patch.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D152604



More information about the cfe-commits mailing list