From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) by sourceware.org (Postfix) with ESMTPS id 802CE383FB88 for ; Wed, 31 Aug 2022 15:49:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 802CE383FB88 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pl1-x62a.google.com with SMTP id d12so14497664plr.6 for ; Wed, 31 Aug 2022 08:49:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc; bh=hZAyGUz/wszCfYBGDAns0yOuBnVMdtcVV1iicZzgCJ8=; b=Gc7GH+v/o1FRO6cVnmDNWtuPcmx4gJ/9Bo55FjC6yJo7R2sWVqkdRCfja13w4gdbuv CoJgM8rCKTYnmoYhRwwUr2kDphiS8Ly+N0I4Znhkm9n6lSEG9/tSx8PS+2q9IkaX84Io WsanITLfJ/m3exRsHVcGdRnltHPLJB4gS6/3vDf+B8Eflx5410KzFWG3TqmqtPqBVx/d 3J8WoYZ0LtI4hpBJL64t3fMAaHHHqA6sKK5Vmqhr5goGjE3KvQxi95nrSgrMfJ7n1XWm VArz0m+TY6hPpod3LLFPAVU8nWLerwa6pOAAm8WiMnFYC/RkF8ZQ0+Ie2fSuH8vu+OfK AThw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc; bh=hZAyGUz/wszCfYBGDAns0yOuBnVMdtcVV1iicZzgCJ8=; b=vRzN35gvhiTCEgHhtmBY3Cp47vtvYoFWaXIxQoB91uC2OAFVoJesJ88kbYRdNWwlRb TWPguZ+QwyIRGOTPXMDHgw2ALfaDRiVl1jJ6A0JGyEb9z9iwsAjxk+hHIRrjBjqEETpo b52JUGjrXXeI0VbR+z+ng+qhqnjZwqqMP7QQRkZ4dff63QHNGd4q/qOL1zIl3oLM4wYK ty86Y7rSLpJR0qP9T4+almKGyB0DmfVTgBsbnrfk8cJeRW5xciaxXHka5jdjhwVmCEcI HM8u8i9pg5lKKgTrDZ9bnTCPwbKwbTol94W2Cdqbu2TS3d/0DXTqD3yz0HhU/YVKinFn Caew== X-Gm-Message-State: ACgBeo0Y6cjaphBmVK6olvvnWcJNbpyo+JzeWJj2jMJ84Vsz/YrYUM14 jieZxYda58mMUCxJ6JBboh0= X-Google-Smtp-Source: AA6agR667a7WVCMYcXznVJeYAXZlFAW8NKP6c+hQYFmOQ8CFv8efRX4o3FEpYIVj+Zd9Kk/1CUnRQA== X-Received: by 2002:a17:902:7602:b0:172:a064:4a2f with SMTP id k2-20020a170902760200b00172a0644a2fmr25821854pll.56.1661960958391; Wed, 31 Aug 2022 08:49:18 -0700 (PDT) Received: from [172.31.0.204] (c-73-98-188-51.hsd1.ut.comcast.net. [73.98.188.51]) by smtp.gmail.com with ESMTPSA id 187-20020a6205c4000000b0053649443f04sm11362587pff.7.2022.08.31.08.49.17 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 31 Aug 2022 08:49:17 -0700 (PDT) Message-ID: <4da3d9b2-4bf4-0c2a-224b-a821e7b391fc@gmail.com> Date: Wed, 31 Aug 2022 09:49:16 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.13.0 Subject: Re: [committed] Fix more problems with new linker warnings Content-Language: en-US To: =?UTF-8?Q?Martin_Li=c5=a1ka?= , 'GCC Patches' References: <16a40e11-e97f-59bd-9990-9b7e6dee39c9@gmail.com> <13847bc4-00e8-1680-da3c-4c95b33ce1be@suse.cz> From: Jeff Law In-Reply-To: <13847bc4-00e8-1680-da3c-4c95b33ce1be@suse.cz> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 8/22/2022 3:39 AM, Martin Liška wrote: > On 4/28/22 18:10, Jeff Law via Gcc-patches wrote: >> As I mentioned in the original thread, my change to pr94157_0 was an attempt to avoid these warnings by passing a magic flag to the linker.  Of course we may not be using GNU ld.  Or we may be on a non-elf target where the flag I used doesn't exist.  Or we may even be on a ELF target where those bits weren't added to the linker (frv).  Furthermore, we need fixes to all the nested function tests as well. >> >> So even though I initially resisted pruning the warning, that seems like the best course of action.  So this patch removes my recent change to pr94157_0 and instead uses our pruning facilities. >> >> I'll be pushing this to the trunk and gcc-12 branch. >> >> Jeff > Hello. > > I noticed this patch during my GCC test-suite run with mold linker. As you likely now, the linker defaults > to non-executable stack and so one sees test-suite crashes (not only warnings) [1]. > > So the question is if we want to explicitly fix all tests that rely on exectack? Or is it something > we can assume as it's what GNU linkers do? > > List of affected tests: > https://gist.githubusercontent.com/marxin/aadb75408a5a7867bf9fb26e879ce4c4/raw/aff2a0e4559e2dba8ea358520ca836eda6e7dc70/gistfile1.txt The problem I ran into was that there wasn't a good way to determine what to do, even if we know the test was going to need execstack. We can't just blindly pass the magic flag to the linker -- at the least that would need to be conditional on the linker being used as well as the target as some of the ELF targets don't have the linker infrastructure.  And given that the linker can vary across gnu-ld, gold, mold, it's a rats nest. jeff