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

Roy Sundahl via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 23 10:54:47 PDT 2023


rsundahl created this revision.
Herald added a project: All.
rsundahl requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

rdar://103453678


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D146745

Files:
  llvm/docs/ReleaseNotes.rst


Index: llvm/docs/ReleaseNotes.rst
===================================================================
--- llvm/docs/ReleaseNotes.rst
+++ llvm/docs/ReleaseNotes.rst
@@ -231,6 +231,17 @@
 
 Changes to Sanitizers
 ---------------------
+* For users of weak overrides on Darwin, the dynamic linker (dyld) will only
+  consider symbols from other mach-o modules (dylibs and main executable), which
+  themselves contain at least one weak symbol. A consequence of this is that if
+  your main program contains an intended override of a sanitizer weak reference,
+  then it must contain at least one weak symbol. (NB: This symbol may be the
+  intended override itself). ::
+
+    Example:
+      __attribute__((weak,unused)) unsigned __enableOverrides;
+    or:
+      __attribute__((weak)) void __asan_on_error(void) {...}
 
 Other Changes
 -------------


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D146745.507819.patch
Type: text/x-patch
Size: 850 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230323/f2548a78/attachment.bin>


More information about the llvm-commits mailing list