From patchwork Thu Nov 28 17:36:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 845951 Delivered-To: patch@linaro.org Received: by 2002:adf:f2c4:0:b0:382:43a8:7b94 with SMTP id d4csp376972wrp; Thu, 28 Nov 2024 09:39:48 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVd8sT76TCNsLPvK8KF48UrRPf5T2M7H6mZZNSbsWNrzxrkEPAj1Upy+pKg4X9GVsJgN5N70g==@linaro.org X-Google-Smtp-Source: AGHT+IEcPNW2atL+QcNXtf2gUjVwIzM9ZmBl8XVroUlMJyNj8t7swTZNRT1TWkGZjnbV31AyOG70 X-Received: by 2002:a05:622a:190c:b0:461:1c54:5bd5 with SMTP id d75a77b69052e-466b34d0c66mr96777971cf.9.1732815588334; Thu, 28 Nov 2024 09:39:48 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1732815588; cv=pass; d=google.com; s=arc-20240605; b=SpIVTKKlVfD6rEPFR0PIRHuFicdUH+MFmD/IAPxtVT4QhPvWc+j1Iqukhzj/Lf4VBS 5y5/D9P/k9wG20GOUScV/opON1wo9ByczxvzP0i+hAO5snL2FxiyaDXZirzpAsrGpOWl EvMjLFurQRT8K8V8ewOdY39dx+CC7iBOXVcRT2RwdxowLcNNEqDHO3eWm9fjfvEbjwi3 x34PnrcpKirFN4No+Lm7lkWqEeSSp2lSLlOIj8KmTN406xBkaSyRsgcfgWRg6BJ/E2Kv laxrrkOFn+WRnRJXRVVxnZbZDX0fY94Weg72eH4kVU5cvJ5tLsV6LGXdGNQkCEBYz97r x0wA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature:dkim-filter:arc-filter:dmarc-filter :delivered-to:dkim-filter; bh=ukMExROWCFeI5moccZONnrqyhF8WcGwn/5A5w759xI4=; fh=5vlP+0ToNsZNUEx4IDYFBtVkL7R0+LPY9AvG1oUICyQ=; b=OWBO/BLPo6To/oUKYg0nbtDt2mW837nSgOhqZp3OwGbNz/pfiajjO0g6EvDXfVlSYy WQO0KrKcUa20d5RhnQFvjPTlvliXbNlhPBOpelj5XmLz56Drw1oUDWE0ZcW35LsV3nQm Hw1VCY1j3nwvJ5b3Zya/NcLvdxjwdOJ1t1jtqyoo8UuIGrcMrFFk+PLmBXqg7ubIDc4A dHjgM/Bi7mPwOWt8lZbSzvkPZy82DHwOHfHXlUC+wK8/u3okFuzHf9/SNCzSH0tOQGZy wJXqm11Qxnp2rueFwCYb8RQe7Qn1/FyqnwEa/9PALhC79uDSwXPqxlgFIksWFnC9FxGP DStQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pWr6u3Pl; arc=pass (i=1); spf=pass (google.com: domain of libc-alpha-bounces~patch=linaro.org@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="libc-alpha-bounces~patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id d75a77b69052e-466c4461f63si21112311cf.703.2024.11.28.09.39.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Nov 2024 09:39:48 -0800 (PST) Received-SPF: pass (google.com: domain of libc-alpha-bounces~patch=linaro.org@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pWr6u3Pl; arc=pass (i=1); spf=pass (google.com: domain of libc-alpha-bounces~patch=linaro.org@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="libc-alpha-bounces~patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D9CF73858D20 for ; Thu, 28 Nov 2024 17:39:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D9CF73858D20 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=pWr6u3Pl X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pg1-x541.google.com (mail-pg1-x541.google.com [IPv6:2607:f8b0:4864:20::541]) by sourceware.org (Postfix) with ESMTPS id 47AEF3858C60 for ; Thu, 28 Nov 2024 17:38:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 47AEF3858C60 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 47AEF3858C60 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::541 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1732815538; cv=none; b=qXzJfau1vpVN8HAegrohlx9fUIXFXHHL6LNDqSgblTHma+leaVMah+OgWkTO2/47b18iJPD+WOEcYxASE1QTrO29M5VdN3Wuh48vIhJESQ0PEY9s8uhh2oMV6zYxXBju3gIHQ0zEdHQZoc9vlbXda7YTG0PQSKuPtOiQN32XjNo= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1732815538; c=relaxed/simple; bh=9+5p+DVW+1ONj47gRsDFQzRhMMK5uKZTH4iuZwY6dZs=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=XzOeMlXbx8tU6tgkPWyfQKcqQ0VdzUjWIeAu0jJCQYMoMuGL+rSXEkRdkUBCaWr4TlBaHdYmS9hVkNH1Zb60fwZb043SSKd82t6hzroeS030hW1G8ftKPMUHt1J8YKr9T1PcvedLyIuwqtSoRGJA3vjB4GqCeqNhdxK4Uoy8IlM= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 47AEF3858C60 Received: by mail-pg1-x541.google.com with SMTP id 41be03b00d2f7-7f450f7f11dso701557a12.2 for ; Thu, 28 Nov 2024 09:38:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732815537; x=1733420337; darn=sourceware.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ukMExROWCFeI5moccZONnrqyhF8WcGwn/5A5w759xI4=; b=pWr6u3PllpI7tQnRnHW/DM8Bk+a3rkEhyc9XjwwjoxgPFTH6l475QNhFWBh9yvNjnj IY4VjQfPl0TEcyYiUbfJmptvEecKGiEZoaExsYoD0Y6g7u1mMM8iFQShcjlEx1f17njp VniHzmniHDQCBBy+lwvQ48k+YtStRoY8HeqcA5qsDfs2mlwIw5lT8FLhssRguJ5pyH8g ZLACvvpn2rTD0HfB4wfL04VMbRoHvZufsfD0K073orU/zYcO63T/UAjLkyAGmh+8w/Fi 7mjiZe11RhDMCDD78AsY/cLTWg0Xt0C6Ay7QjDaJNBvY9O+UPruXdSrJq8B2sKJiJJ+N qKOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732815537; x=1733420337; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ukMExROWCFeI5moccZONnrqyhF8WcGwn/5A5w759xI4=; b=n6klQxcinitQTxfdAG25dyTkwUIKM7vCOHFabnMQSnB1QEbPVJtsfw/dhDZlGQxD+V fFmTnGBo/+m3wTio+hnT3f6rpJ9ffHWc49ti2zK5WkHUp876+nqrZl501E2rCr1bmlWF cCFk2NSqangQjj09g485waAd4gXlhFLj16fMmE1QLkyAZb2v3RYOVVmECieJ2ytoArnD hbGev92POmsy2eseYuyWWq6/V1v+KWxI/JItT7H6C0rM9o92RrcoB3LixnJSmjl/pegX YHxsXKQDX7Pe3Du48rhsRFPmobAyK093bCg0REiHmrfwmI40A9X/fhdPPifVYluEtb0D 8WMA== X-Gm-Message-State: AOJu0YyFIE4cCE3F+016ArcvTaTM6VbKlqFFe/2BccppILosY0fPgElI 3FqtQvRE3WoSJ0Fyxh5epmJo3odo4SoUeXTRCmitUWO1n5hTXNW6SesTmEWD76pjOpiVAEywx9R Xi+N9hNMA X-Gm-Gg: ASbGncvDo5CpJm/TfuvItkV5j7p3JmxBptyBMOSeb13dI97c+BxDLuj2xs2JKGz8Jzr P0U1UT2qPnuWSsEMzXI38MVZx5Jt39CAXLCDtIDTWIghRNI3kb3grNQYRPHuWRk8+NaxlKcqdPe EmAJD/oCKljTwLma0kDx+4PNfyMrNnU90TYWwNhQsl9dZINv8W1ROnj94oY8PQj/v3sgBEKs8rC BVDT+Nj9MKi8GENKVpib4dVmnO7DFVc3wtgRh4m+y9lQa/mqLQrOS5LRn0r5gM= X-Received: by 2002:a05:6a20:6f8c:b0:1e0:cbcf:8917 with SMTP id adf61e73a8af0-1e0e0b0b329mr11082606637.21.1732815536855; Thu, 28 Nov 2024 09:38:56 -0800 (PST) Received: from mandiga.. ([2804:1b3:a7c1:68c8:2c85:3a76:728e:ead2]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72541849d6csm1860356b3a.182.2024.11.28.09.38.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Nov 2024 09:38:56 -0800 (PST) From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: Florian Weimer Subject: [PATCH v5 1/4] elf: Consolidate stackinfo.h Date: Thu, 28 Nov 2024 14:36:42 -0300 Message-ID: <20241128173851.1920696-2-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241128173851.1920696-1-adhemerval.zanella@linaro.org> References: <20241128173851.1920696-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~patch=linaro.org@sourceware.org And use sane default the generic implementation. Reviewed-by: Florian Weimer --- sysdeps/aarch64/stackinfo.h | 33 --------------------- sysdeps/arc/stackinfo.h | 33 --------------------- sysdeps/csky/stackinfo.h | 29 ------------------ sysdeps/generic/stackinfo.h | 15 ++++++++-- sysdeps/loongarch/stackinfo.h | 33 --------------------- sysdeps/powerpc/{ => powerpc32}/stackinfo.h | 8 +---- sysdeps/riscv/stackinfo.h | 33 --------------------- 7 files changed, 13 insertions(+), 171 deletions(-) delete mode 100644 sysdeps/aarch64/stackinfo.h delete mode 100644 sysdeps/arc/stackinfo.h delete mode 100644 sysdeps/csky/stackinfo.h delete mode 100644 sysdeps/loongarch/stackinfo.h rename sysdeps/powerpc/{ => powerpc32}/stackinfo.h (82%) delete mode 100644 sysdeps/riscv/stackinfo.h diff --git a/sysdeps/aarch64/stackinfo.h b/sysdeps/aarch64/stackinfo.h deleted file mode 100644 index 5a4dce7309..0000000000 --- a/sysdeps/aarch64/stackinfo.h +++ /dev/null @@ -1,33 +0,0 @@ -/* Copyright (C) 2001-2024 Free Software Foundation, Inc. - - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public License as - published by the Free Software Foundation; either version 2.1 of the - License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -/* This file contains a bit of information about the stack allocation - of the processor. */ - -#ifndef _STACKINFO_H -#define _STACKINFO_H 1 - -#include - -/* On AArch64 the stack grows down. */ -#define _STACK_GROWS_DOWN 1 - -/* Default to a non-executable stack. */ -#define DEFAULT_STACK_PERMS (PF_R|PF_W) - -#endif /* stackinfo.h */ diff --git a/sysdeps/arc/stackinfo.h b/sysdeps/arc/stackinfo.h deleted file mode 100644 index 99a7f56ea0..0000000000 --- a/sysdeps/arc/stackinfo.h +++ /dev/null @@ -1,33 +0,0 @@ -/* Stack environment definitions for ARC. - Copyright (C) 2020-2024 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see - . */ - -/* This file contains a bit of information about the stack allocation - of the processor. */ - -#ifndef _STACKINFO_H -#define _STACKINFO_H 1 - -#include - -/* On ARC the stack grows down. */ -#define _STACK_GROWS_DOWN 1 - -/* Default to a non-executable stack. */ -#define DEFAULT_STACK_PERMS (PF_R|PF_W) - -#endif /* stackinfo.h */ diff --git a/sysdeps/csky/stackinfo.h b/sysdeps/csky/stackinfo.h deleted file mode 100644 index ef22fa3249..0000000000 --- a/sysdeps/csky/stackinfo.h +++ /dev/null @@ -1,29 +0,0 @@ -/* Stack environment definitions. C-SKY version. - Copyright (C) 2018-2024 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see - . */ - -#ifndef _STACKINFO_H -#define _STACKINFO_H 1 - -#include - -/* On C-SKY the stack grows down. */ -#define _STACK_GROWS_DOWN 1 - -#define DEFAULT_STACK_PERMS (PF_R|PF_W) - -#endif /* stackinfo.h */ diff --git a/sysdeps/generic/stackinfo.h b/sysdeps/generic/stackinfo.h index bf752ce94d..51e5f92055 100644 --- a/sysdeps/generic/stackinfo.h +++ b/sysdeps/generic/stackinfo.h @@ -15,6 +15,15 @@ License along with the GNU C Library; if not, see . */ -/* This file contains a bit of information about the stack allocation - of the processor. Since there is no general truth we can't say - anything here. */ +/* This file contains a bit of information about the stack allocation of the + processor. Default to a non executable stack that grows downwards. */ + +#ifndef _STACKINFO_H +#define _STACKINFO_H 1 + +#include + +#define _STACK_GROWS_DOWN 1 +#define DEFAULT_STACK_PERMS (PF_R|PF_W) + +#endif diff --git a/sysdeps/loongarch/stackinfo.h b/sysdeps/loongarch/stackinfo.h deleted file mode 100644 index 6ee50552b7..0000000000 --- a/sysdeps/loongarch/stackinfo.h +++ /dev/null @@ -1,33 +0,0 @@ -/* Stack environment definitions for LoongArch. - Copyright (C) 2022-2024 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see - . */ - -/* This file contains a bit of information about the stack allocation - of the processor. */ - -#ifndef _STACKINFO_H -#define _STACKINFO_H 1 - -#include - -/* On LoongArch the stack grows down. */ -#define _STACK_GROWS_DOWN 1 - -/* Default to a non-executable stack. */ -#define DEFAULT_STACK_PERMS (PF_R | PF_W) - -#endif /* stackinfo.h */ diff --git a/sysdeps/powerpc/stackinfo.h b/sysdeps/powerpc/powerpc32/stackinfo.h similarity index 82% rename from sysdeps/powerpc/stackinfo.h rename to sysdeps/powerpc/powerpc32/stackinfo.h index 410689bc27..2ca360068a 100644 --- a/sysdeps/powerpc/stackinfo.h +++ b/sysdeps/powerpc/powerpc32/stackinfo.h @@ -26,13 +26,7 @@ /* On PPC the stack grows down. */ #define _STACK_GROWS_DOWN 1 -#if __WORDSIZE == 64 -/* PPC64 doesn't need an executable stack and doesn't need PT_GNU_STACK - * to make the stack nonexecutable. */ -# define DEFAULT_STACK_PERMS (PF_R|PF_W) -#else /* PF_X can be overridden if PT_GNU_STACK is present but is presumed absent. */ -# define DEFAULT_STACK_PERMS (PF_R|PF_W|PF_X) -#endif +#define DEFAULT_STACK_PERMS (PF_R|PF_W|PF_X) #endif /* stackinfo.h */ diff --git a/sysdeps/riscv/stackinfo.h b/sysdeps/riscv/stackinfo.h deleted file mode 100644 index a786d4f9b0..0000000000 --- a/sysdeps/riscv/stackinfo.h +++ /dev/null @@ -1,33 +0,0 @@ -/* Stack environment definitions for RISC-V. - Copyright (C) 2011-2024 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see - . */ - -/* This file contains a bit of information about the stack allocation - of the processor. */ - -#ifndef _STACKINFO_H -#define _STACKINFO_H 1 - -#include - -/* On RISC-V the stack grows down. */ -#define _STACK_GROWS_DOWN 1 - -/* Default to a non-executable stack. */ -#define DEFAULT_STACK_PERMS (PF_R | PF_W) - -#endif /* stackinfo.h */