From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id 0BF683858D33 for ; Mon, 25 Apr 2022 12:56:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0BF683858D33 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.cz Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id D3ED321117; Mon, 25 Apr 2022 12:56:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1650891389; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UATVxNzaF4dqS1n2ZaZkNv1AIPTgguqZynYr6OIjCoM=; b=hUjQBXr5zlcKTNT1IZkhZB+VnEAMFUXkrdgb+CVPe8UUKvwxIib9ejE24N64UTYDvMKxOT M14+Dk+OAyUQQaTxKzklH3BW0knEG/BBjiR8cmWjaiAB7QLusjQZHGW+FcQYSkTm7l7us6 Iy/06DVYZ/iAv4aq+vDk3HSJkDv6/3Y= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1650891389; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UATVxNzaF4dqS1n2ZaZkNv1AIPTgguqZynYr6OIjCoM=; b=EvBa9rT+dl8mwLxYwJRXS0wRQ9a4zDI7IuJu81HdgxzcVdOdTtikXOWK+JJoVwzkwA4Ehj sMHV0lQvLhg40iAg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id B8EC913AED; Mon, 25 Apr 2022 12:56:29 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id rw4uLH2aZmK+eQAAMHmgww (envelope-from ); Mon, 25 Apr 2022 12:56:29 +0000 Message-ID: <8e46710d-573b-bd06-cb80-518575dceefc@suse.cz> Date: Mon, 25 Apr 2022 14:56:29 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Subject: Re: [committed] exec-stack warning for test which wants executable stacks Content-Language: en-US To: Jeff Law , gcc@gcc.gnu.org, binutils@sourceware.org References: From: =?UTF-8?Q?Martin_Li=c5=a1ka?= In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2022 12:56:32 -0000 On 4/24/22 19:42, Jeff Law via Gcc wrote: > About a week ago many targets started failing pr94157_0.c test like this (bfin-elf, but many other targets are also affected): > >> spawn -ignore SIGHUP /home/jlaw/test/obj/bfin-elf/obj/gcc/gcc/xgcc -B/home/jlaw/test/obj/bfin-elf/obj/gcc/gcc/ c_lto_pr94157_0.o -fdiagnostics-plain-output -dumpbase  -O0 -fipa-vrp -flto -Wa,--noexecstack -Wa,--noexecstack -Wa,--execstack -Wa,--execstack -Wa,--execstack -Wa,--execstack -Wa,--execstack -Wa,--execstack -Wa,--execstack -Wa,--execstack -Wa,--execstack -Wa,--execstack -Wa,--execstack -Wa,--execstack -Wa,--execstack -Wa,--execstack -msim -Wl,-wrap,exit -Wl,-wrap,_exit -Wl,-wrap,main -Wl,-wrap,abort -Wl,gcc_tg.o -o gcc-dg-lto-pr94157-01.exe^M >> /home/jlaw/test/obj/bfin-elf/installed/bfin-elf/bin/ld: warning: /tmp/ccfJUEvZ.ltrans0.ltrans.o: requires executable stack (because the .note.GNU-stack section is executable)^M >> FAIL: gcc.dg/lto/pr94157 c_lto_pr94157_0.o-c_lto_pr94157_0.o link,  -O0 -fipa-vrp -flto -Wa,--noexecstack -Wa,--noexecstack -Wa,--execstack  -Wa,--execstack -Wa,--execstack -Wa,--execstack -Wa,--execstack -Wa,--execstack -Wa,--execstack -Wa,--execstack -Wa,--execstack -Wa,--execstack -Wa,--execstack -Wa,--execstack -Wa,--execstack -Wa,--execstack > > This is due to a new binutils warning.  This patch just suppresses the warning for the one test where we explicitly wanted an executable stack. > > I'm guessing the repeated -Wa,--noexecstack options in this test are supposed to trigger a  buffer overflow or something similar, so I left those alone and just appended to the argument list. Yes. > > I used -z execstack rather than --no-warn-execstack as the former is recognized by older versions of ld, but the latter is a new option. Thanks for it. Martin > > The other approach would have been to prune the warning, but this seemed better since we'd like most tests to fail if somehow their stacks were executable. > > > Committed to the trunk. > > Jeff >