[sanitizers] Simplify Explainer about dyld and weak overrides on Darwin. (NFC)
authorRoy Sundahl <rsundahl@apple.com>
Tue, 4 Apr 2023 13:09:58 +0000 (06:09 -0700)
committerRoy Sundahl <rsundahl@apple.com>
Wed, 5 Apr 2023 17:04:29 +0000 (10:04 -0700)
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

index 98582b3..052a850 100644 (file)
@@ -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
 -------------