From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-x533.google.com (mail-pg1-x533.google.com [IPv6:2607:f8b0:4864:20::533]) by sourceware.org (Postfix) with ESMTPS id B854D3857402 for ; Fri, 20 May 2022 06:45:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B854D3857402 Received: by mail-pg1-x533.google.com with SMTP id 31so6965773pgp.8 for ; Thu, 19 May 2022 23:45:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=XypefoO95+AX/TvNsi3Fw8IjuCdzj9KMXsnu3NjsPAc=; b=NMmBEve7zWD7yK+kPUjsc4cqGBoHIBEhbvUBLt+Lr3uKTmucg0GPBLK+dvKmPrZXbU Cl0FHVqOzVHbInwvqcFuONYLJUrSFtpUIILL4lNTfH/dKNh3zSru+mG/fkDDX36eCe5E eaQhzsgO+TF+VVseACgOcilEUqzOUMhwfbtDwie13m/EWfqwkgi5O8/7Ux4agsM0DwCy 3seg787yj3UHmwFYHh7stIhEzfljSgifM/HrWp9jeRE8wBd4PlrxI/H8u7gME0PKrfjc Pie8TN3OqRItof7euqAD0acw+f/uDCSch+TH9hzDsR3IS3SAFz03oHY0dtnw/fU8TvQr 2J8g== X-Gm-Message-State: AOAM530AO6TnZuoKg/bzRSwYUGc2tAnSSI1ZH5OblX7ooDngTestm3rx BEP2C5OqNf32NLz1HeP572dbm/xaTNY= X-Google-Smtp-Source: ABdhPJwsYYIZu/QelAI62slx3ZyhanZJ+fNlNiA7wptRIupC2tqzihJ7fI94beexuIY4UFngUfQ0Iw== X-Received: by 2002:a63:941:0:b0:3c6:8d64:ec01 with SMTP id 62-20020a630941000000b003c68d64ec01mr7337341pgj.322.1653029129855; Thu, 19 May 2022 23:45:29 -0700 (PDT) Received: from squeak.grove.modra.org ([2406:3400:51d:8cc0:c013:adc3:af5d:9cf8]) by smtp.gmail.com with ESMTPSA id iw22-20020a170903045600b0015e8d4eb297sm4839849plb.225.2022.05.19.23.45.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 May 2022 23:45:29 -0700 (PDT) Received: by squeak.grove.modra.org (Postfix, from userid 1000) id 9139011400DD; Fri, 20 May 2022 16:15:26 +0930 (ACST) Date: Fri, 20 May 2022 16:15:26 +0930 From: Alan Modra To: =?iso-8859-1?Q?Cl=E9ment?= Chigot , Nick Clifton Cc: binutils@sourceware.org Subject: Re: [PATCH] ld: harmonize the value of --enable-warn-execstack=no option Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-3029.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, 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 X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2022 06:45:32 -0000 On Fri, May 20, 2022 at 03:24:23PM +0930, Alan Modra wrote: > On Tue, May 17, 2022 at 02:51:40PM +0200, Clément Chigot via Binutils wrote: > > This patch sets the configure value of warn-execstack to 2 when > > disabled as expected by bfd. > > > > ld/ChangeLog: > > > > * configure.ac: Update ac_default_ld_warn_execstack value when > > --enable-warn-execstack=no is given. > > * configure: Regenerate > > * testsuite/ld-elf/elf.exp: Add --warn-execstack to ensure > > the warning is always shown. > > Thanks for the patch, but I'm suspicious of the testsuite change and I > think we need a little more here. I agree a change is needed to make > ld/bfd values consistent but I'm going to jump the other way, changing > link_info.warn_execstack. Making it consistent that way is nicer in > that the flag becomes an "extended" boolean, ie. 0 => don't warn, > 1 => always warn, 2 or 3 => conditional warning depending on > link_info.execstack. > > Testing still in progress, I'll commit this shortly if I don't > discover the need for a testsuite change. So my patch results in aarch64_be-linux-gnu_ilp32 +FAIL: PR ld/29072 (warn about an executable .note.GNU-stack) aarch64-linux +FAIL: PR ld/29072 (warn about an executable .note.GNU-stack) armeb-linuxeabi +FAIL: PR ld/29072 (warn about an executable .note.GNU-stack) arm-linuxeabi +FAIL: PR ld/29072 (warn about an executable .note.GNU-stack) arm-nacl +FAIL: PR ld/29072 (warn about an executable .note.GNU-stack) That's really an arm/aarch64 backend problem in that those targets define a gld${EMULATION_NAME}_before_parse function that overrides the one in elf.em. So at the moment it looks like DEFAULT_LD_Z_SEPARATE_CODE, DEFAULT_LD_WARN_EXECSTACK, DEFAULT_LD_WARN_RWX_SEGMENTS and DEFAULT_LD_EXECSTACK all do nothing on arm/aarch64. The obvious fix would be to add a few lines to the arm/aarch64 before_parse functions but I'm going to leave that to an ARM maintainer. A more elegant solution might be possible. I'm going to ignore buildbots or user complaints that this change of mine introduced regressions as the truth is the new failure exposes a real bug in arm/aarch64. Committed. -- Alan Modra Australia Development Lab, IBM