[PATCH] D146745: [sanitizers] Explainer about dyld and weak overrides on Darwin. (NFC)

Roy Sundahl via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 31 08:56:09 PDT 2023


This revision was automatically updated to reflect the committed changes.
Closed by commit rGf1c5c84ae1a8: [sanitizers] Explainer about dyld and weak overrides on Darwin. (NFC) (authored by rsundahl).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D146745

Files:
  llvm/docs/ReleaseNotes.rst


Index: llvm/docs/ReleaseNotes.rst
===================================================================
--- llvm/docs/ReleaseNotes.rst
+++ llvm/docs/ReleaseNotes.rst
@@ -238,6 +238,20 @@
 
 Changes to Sanitizers
 ---------------------
+* For Darwin users that override weak symbols, note that the dynamic linker will
+  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) {...}
+
+      __attribute__((weak,unused)) unsigned __enableOverrides;
+      
+      __attribute__((weak)) bool unrelatedWeakFlag;
 
 Other Changes
 -------------


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D146745.510052.patch
Type: text/x-patch
Size: 1032 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230331/13b1fdc0/attachment.bin>


More information about the llvm-commits mailing list