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

Julian Lettner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 23 12:12:15 PDT 2023


yln added a comment.

Thanks Roy!  I put my suggestions, but none of them are blocking.



================
Comment at: llvm/docs/ReleaseNotes.rst:234
 ---------------------
+* 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
----------------
Here are my //suggestions//:

I feel that "weak overrides" is a bit ambiguous (what is weak? the overrider or the overridden?)

* Let's use: "overrides of weak symbols" instead of "weak overrides"
* Use `__asan_default_options()` which is more commonly used than `__asan_on_error()`
* Choose one of the 2 options (to avoid confusion)
* Mention from which deployment target / macOS version on this dyld behavior changes


================
Comment at: llvm/docs/ReleaseNotes.rst:237-239
+  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). ::
----------------



================
Comment at: llvm/docs/ReleaseNotes.rst:241-244
+    Example:
+      __attribute__((weak,unused)) unsigned __enableOverrides;
+    or:
+      __attribute__((weak)) void __asan_on_error(void) {...}
----------------



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D146745



More information about the llvm-commits mailing list