[PATCH] D76665: [asan] Stop instrumenting NetBSD-specific link_set sections

Michał Górny via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 1 11:53:14 PDT 2020


mgorny marked an inline comment as done.
mgorny added inline comments.


================
Comment at: llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp:1859
+    // array elements
+    if (Section.startswith("link_set")) {
+      LLVM_DEBUG(dbgs() << "Ignoring global in sorted section "
----------------
pcc wrote:
> What do the names of these sections look like? From the test I presume that they have C identifier names and are enumerated via `__start_`/`__stop_`. In that case we should exclude all C identifier named sections from instrumentation (not just `link_set*`) in order to fix similar bugs involving those sections.
They are created via the following macro:

```
#define	__link_set_make_entry(set, sym)					\
	static void const * const __link_set_##set##_sym_##sym		\
	    __section("link_set_" #set) __used = (const void *)&sym
```

So the `link_set_` name is enforced on our end. Of course, people can do any crazy things they like, so can't tell if anyone else has a similar use case.


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

https://reviews.llvm.org/D76665





More information about the llvm-commits mailing list