From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp1.axis.com (smtp1.axis.com [195.60.68.17]) by sourceware.org (Postfix) with ESMTPS id C10D5384B0C9 for ; Thu, 26 May 2022 01:17:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C10D5384B0C9 From: Hans-Peter Nilsson To: CC: Jeff Law , , , In-Reply-To: (message from Jeff Law via Binutils on Mon, 25 Apr 2022 17:30:59 +0200) Subject: Re: [committed] exec-stack warning for test which wants executable stacks MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8BIT References: <8e46710d-573b-bd06-cb80-518575dceefc@suse.cz> <615c917b-1109-da5e-9727-a47f60f3e6bf@redhat.com> Message-ID: <20220526011701.1D73B2045A@pchp3.se.axis.com> Date: Thu, 26 May 2022 03:17:01 +0200 X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, SPF_HELO_PASS, 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 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: Thu, 26 May 2022 01:17:04 -0000 > From: Jeff Law via Binutils > Date: Mon, 25 Apr 2022 17:30:59 +0200 > On 4/25/2022 9:26 AM, Nick Clifton wrote: > > Hi Jeff, > > > > Just FYI - I am also looking at adding in another warning. This > > time for > > when the linker creates a PT_LOAD segment which has all of the RWX > > flags > > set. At the moment my testing seems to show that it only causes > > problems > > when a custom linker script is used that defines its own program > > headers > > and does not provide separate headers for code and data. > That also sounds quite reasonable. My biggest worry would be the > embedded targets which have their own linker scripts -- but like the > executable stack warning, I think you should go for it and we'll deal > with the fallout. (Looks like I'm first to be hit by the --enable-warn-rwx-segments default, or the first one to bother, lucky me.) So, with my autotester for cris-elf not able to update binutils on its own because of all the warnings in the gcc test-suite (all code and data get a single LOAD header, which naturally is RWX), let's discuss a method for a binutils target to default turn off this configure-time-default-on warning. I just don't think its reasonable to require an extra configure option for the intended default behavior for a target. How about the usual method, a line in the ld emulparams file for the target? brgds, H-P