From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by sourceware.org (Postfix) with ESMTPS id ED49D3858403 for ; Mon, 25 Jul 2022 08:35:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org ED49D3858403 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 33C4E3796B; Mon, 25 Jul 2022 08:35:10 +0000 (UTC) Received: from hawking.suse.de (unknown [10.168.4.11]) by relay2.suse.de (Postfix) with ESMTP id A25332C193; Mon, 25 Jul 2022 08:35:09 +0000 (UTC) Received: by hawking.suse.de (Postfix, from userid 17005) id 7EA04444B2F; Mon, 25 Jul 2022 10:35:09 +0200 (CEST) From: Andreas Schwab To: Xi Ruoyao Cc: liuzhensong , xuchenghua@loongson.cn, chenglulu@loongson.cn, binutils@sourceware.org, maskray@google.com, caiyinyu@loongson.cn, Huacai Chen Subject: Re: [PATCH] LoongArch: Set defaults to exec stack 0. References: <20220725022227.16266-1-liuzhensong@loongson.cn> <4a264fe57282c1a191204775ffe033512240d2eb.camel@xry111.site> X-Yow: Now, let's SEND OUT for QUICHE!! Date: Mon, 25 Jul 2022 10:35:09 +0200 In-Reply-To: <4a264fe57282c1a191204775ffe033512240d2eb.camel@xry111.site> (Xi Ruoyao's message of "Mon, 25 Jul 2022 16:14:26 +0800") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1.90 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, SPF_HELO_NONE, SPF_PASS, TXREP 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: Mon, 25 Jul 2022 08:35:12 -0000 On Jul 25 2022, Xi Ruoyao wrote: > The doc of elf_backend_default_execstack says: > > /* True if an object file lacking a .note.GNU-stack section > should be assumed to be requesting exec stack. At least one > other file in the link needs to have a .note.GNU-stack section > for a PT_GNU_STACK segment to be created. */ > > So I think it only controls the default behavior of bfd library and is > not related to the kernel? The kernel always controls the ultimate decision. It also means that if no input file has a GNU-stack note, no PT_GNU_STACK segment is created for the output, in which case the kernel default (which is PF_X for loongarch) applies. The value of DEFAULT_STACK_PERMS in glibc must also agree with the kernel. -- Andreas Schwab, SUSE Labs, schwab@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."