From patchwork Fri Nov 15 17:39:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Adhemerval Zanella (Code Review)" X-Patchwork-Id: 1195786 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-107128-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=gnutoolchain-gerrit.osci.io Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="MAKui3re"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47F5FG5qf2z9sPT for ; Sat, 16 Nov 2019 04:39:14 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:in-reply-to:references :reply-to:mime-version:content-transfer-encoding:content-type :message-id; q=dns; s=default; b=SpoQw+Iygd9fnYBaLRjDXHcEq9XM2Ps yoMZefCPsg9ZY1crgg55sAt99fNMiARYDhDIZ//Thu8xqyAPg37AaNrlnkZw6Nw3 JTJJs4mJGF1tiSAH9nWCtTaf0V4uthEbW+V1/2g1/ExnKBrnpfU+CoWTtUdOOU1W erZuWCJstY/k= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:in-reply-to:references :reply-to:mime-version:content-transfer-encoding:content-type :message-id; s=default; bh=+cY7+gvhd+w/byoGir2bCf9N2sA=; b=MAKui 3regapJYBB2ySjO9YMAT52681cf7qmvrP7Csr+ZGVOpkwb4lLTUvnO5FbiVVefH5 LkFNh2TraPuuPLIt05OMzSQhwVo7ykd/QYwXxxBBFh2z5HRZhMk5z5O7wCkbxdOS VV3lUym7K8U/EVL8KwxiNJVnP5NUwlfukBgrF0= Received: (qmail 122212 invoked by alias); 15 Nov 2019 17:39:08 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 122204 invoked by uid 89); 15 Nov 2019 17:39:08 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-21.4 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3 autolearn=ham version=3.3.1 spammy=HX-Languages-Length:1735 X-HELO: mx1.osci.io X-Gerrit-PatchSet: 3 Date: Fri, 15 Nov 2019 12:39:04 -0500 From: "Florian Weimer (Code Review)" To: Florian Weimer , libc-alpha@sourceware.org Auto-Submitted: auto-generated X-Gerrit-MessageType: newpatchset Subject: [review v3] hurd: Fix GCC 10 -Warray-bounds warning in init-first.c X-Gerrit-Change-Id: Ided58244ca0ee48892519faac5ac222a4e02dec4 X-Gerrit-Change-Number: 657 X-Gerrit-ChangeURL: X-Gerrit-Commit: 3db2eeffc63451a4c4aa09daf4637e623139f8ec In-Reply-To: References: Reply-To: fweimer@redhat.com, fweimer@redhat.com, libc-alpha@sourceware.org MIME-Version: 1.0 Content-Disposition: inline User-Agent: Gerrit/3.0.3-76-gf8b6da0ab5 Message-Id: <20191115173904.931EF20AF6@gnutoolchain-gerrit.osci.io> Change URL: https://gnutoolchain-gerrit.osci.io/r/c/glibc/+/657 ...................................................................... hurd: Fix GCC 10 -Warray-bounds warning in init-first.c The trampoline code should really be rewritten in assembler because this is all very undefined at the C level. Change-Id: Ided58244ca0ee48892519faac5ac222a4e02dec4 --- M sysdeps/mach/hurd/i386/init-first.c 1 file changed, 9 insertions(+), 0 deletions(-) diff --git a/sysdeps/mach/hurd/i386/init-first.c b/sysdeps/mach/hurd/i386/init-first.c index f1f1c40..5c21ebb 100644 --- a/sysdeps/mach/hurd/i386/init-first.c +++ b/sysdeps/mach/hurd/i386/init-first.c @@ -30,6 +30,7 @@ #include #include +#include extern void __mach_init (void); extern void __init_misc (int, char **, char **); @@ -144,6 +145,12 @@ static inline void init (int *data) { + /* data is the address of the argc parameter to _dl_init_first or + doinit1 in _hurd_stack_setup, so the array subscripts are + undefined. */ + DIAG_PUSH_NEEDS_COMMENT; + DIAG_IGNORE_NEEDS_COMMENT (10, "-Warray-bounds"); + int argc = *data; char **argv = (void *) (data + 1); char **envp = &argv[argc + 1]; @@ -265,6 +272,8 @@ restored by function return. */ asm volatile ("# a %0 c %1" : : "a" (usercode), "c" (&init1)); } + + DIAG_POP_NEEDS_COMMENT; /* -Warray-bounds. */ } /* These bits of inline assembler used to be located inside `init'.