From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1921) id 98B0A385703B; Mon, 26 Oct 2020 13:31:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 98B0A385703B Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Sebastian Huber To: newlib-cvs@sourceware.org Subject: [newlib-cygwin] Don't sanitize linker_set X-Act-Checkin: newlib-cygwin X-Git-Author: dab X-Git-Refname: refs/heads/master X-Git-Oldrev: c25de3a3c51e3d27133947a3d943c2a2127445d5 X-Git-Newrev: b9967c3f9040c25efe0a67b59dbd05ee79d0a97d Message-Id: <20201026133132.98B0A385703B@sourceware.org> Date: Mon, 26 Oct 2020 13:31:32 +0000 (GMT) X-BeenThere: newlib-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib GIT logs List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Oct 2020 13:31:32 -0000 https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=b9967c3f9040c25efe0a67b59dbd05ee79d0a97d commit b9967c3f9040c25efe0a67b59dbd05ee79d0a97d Author: dab Date: Tue Nov 19 14:46:28 2019 +0000 Don't sanitize linker_set The assumptions of linker_set don't play nicely with AddressSanitizer. AddressSanitizer adds a 'redzone' of zeros around globals (including those in named sections), whereas linker_set assumes they are all packed consecutively like a pointer array. So: let's annotate linker_set so that AddressSanitizer ignores it. Submitted by: Matthew Bryan Reviewed by: kib, rang_acm.org Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D22239 Diff: --- newlib/libc/include/sys/cdefs.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/newlib/libc/include/sys/cdefs.h b/newlib/libc/include/sys/cdefs.h index 9a0466fff..1f2ce063d 100644 --- a/newlib/libc/include/sys/cdefs.h +++ b/newlib/libc/include/sys/cdefs.h @@ -709,6 +709,13 @@ /* Function should not be analyzed. */ #define __no_lock_analysis __lock_annotate(no_thread_safety_analysis) +/* Function or variable should not be sanitized, ie. by AddressSanitizer */ +#if __has_attribute(no_sanitize) +#define __nosanitizeaddress __attribute__((no_sanitize("address"))) +#else +#define __nosanitizeaddress +#endif + /* Guard variables and structure members by lock. */ #define __guarded_by(x) __lock_annotate(guarded_by(x)) #define __pt_guarded_by(x) __lock_annotate(pt_guarded_by(x))