Skip to content
Commit a8d3ae71 authored by Fangrui Song's avatar Fangrui Song
Browse files

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

-fsanitize-address-globals-dead-stripping is the default for non-ELF
platforms. For ELF, we disabled it to work around an ancient gold 2.26
bug. However, some platforms (Fuchsia and PS) default the option to
true.

This patch changes -fsanitize-address-globals-dead-stripping to true for all ELF
platforms. Without specifying -fdata-sections (non-default for most ELF
platforms), `asan_globals` can only be GCed if the monolithic .data/.bss section
is GCed, which makes it less effective.
However, I think this simplified rule is better than making the
-fsanitize-address-globals-dead-stripping default dependent on another option.

Related: D120394
Close https://github.com/llvm/llvm-project/issues/63127

Reviewed By: #sanitizers, eugenis, phosek

Differential Revision: https://reviews.llvm.org/D152604
parent c981f0b4
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment