From 5f17ba1a3832450eee9c3b85ab862f73712184a4 Mon Sep 17 00:00:00 2001 From: Roy Sundahl Date: Tue, 4 Apr 2023 06:09:58 -0700 Subject: [PATCH] [sanitizers] Simplify Explainer about dyld and weak overrides on Darwin. (NFC) Presenting more than one way to satisfy the single-weak-ref requirement leads to confusing messaging for the end user. Use the introduction of a single unused weak variable as the preferred solution. This differential modifies D146745. rdar://103453678 Reviewed By: yln, thetruestblue Differential Revision: https://reviews.llvm.org/D147526 --- llvm/docs/ReleaseNotes.rst | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/llvm/docs/ReleaseNotes.rst b/llvm/docs/ReleaseNotes.rst index 98582b3..052a850 100644 --- a/llvm/docs/ReleaseNotes.rst +++ b/llvm/docs/ReleaseNotes.rst @@ -245,16 +245,14 @@ Changes to Sanitizers only consider symbols in other mach-o modules which themselves contain at least one weak symbol. A consequence is that if your program or dylib contains an intended override of a weak symbol, then it must contain at least one weak - symbol as well for the override to be effective. That weak symbol may be the - intended override itself, an otherwise usused weak symbol added solely to meet - the requirement, or an existing but unrelated weak symbol. - - Examples: - __attribute__((weak)) const char * __asan_default_options(void) {...} + symbol as well for the override to take effect. + Example: + // Add this to make sure your override takes effect __attribute__((weak,unused)) unsigned __enableOverrides; - - __attribute__((weak)) bool unrelatedWeakFlag; + + // Example override + extern "C" const char *__asan_default_options() { ... } Other Changes ------------- -- 2.7.4