From patchwork Tue Jan 9 19:30:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 83680 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E8611385E010 for ; Tue, 9 Jan 2024 19:31:40 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pl1-x636.google.com (mail-pl1-x636.google.com [IPv6:2607:f8b0:4864:20::636]) by sourceware.org (Postfix) with ESMTPS id 09FD23858284 for ; Tue, 9 Jan 2024 19:30:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 09FD23858284 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 09FD23858284 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::636 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1704828649; cv=none; b=wfWDjzVXn7nrkDJA55vVMGXvTarlP/LpJkM/WI9/zeENE4S21oDI7xOAU5m1upA+eoBIEB8YyoegaEroJnCqXhVZ4DRsHctEDKDIYDgK5x6PjHd5NSLcdvjYNmdubFG9i/PkPbHab2e/jkAe1wQrodICX7illVetUkw5CbS03pI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1704828649; c=relaxed/simple; bh=6zQYMXUKRNEazB2tW1gbM532/swO6yav4uoJhDqQL9c=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=D/6RIt8AQkLt/EnCyAl4klyHFBzvkOAOECzFTMBMraaP/NntJn58Pe29h/YIt0REPLVN97RG05YxRlvIvR9t08ufviLa5f8hVU9sJ9LgOf4pzRxn4467yF3hQS7dxE3kPwnRdy/i84oMOLOrVvt7s7+ze0QKsqqNiUxx0isTFZM= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pl1-x636.google.com with SMTP id d9443c01a7336-1d44200b976so17009505ad.2 for ; Tue, 09 Jan 2024 11:30:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1704828644; x=1705433444; 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=cPcps9uuzX3SINcJEnjw9DWnrLswevBrQRdhfYc/zC8=; b=PPmYaTwKeX3HhQB2Yey88PZXj/hIz1Tsvm9AyhI7PDV8Jxk28k3bD38aXOhAkhsvtp C51z4229jicvXQj01vjpqRJysJaZGPqTK6HHJAYVwbwFR6SDzcc0AYkjeHOVYDMsb9Rd JKD1SoAbKQx0FzuZCsGACU4lpJWMHi8lvhjZCRlAFR5O6CnDohLksTxbTvtF+0dm7/vQ 4gkr/RZ4cnoiD+0NzGN0rRCebHnT0JXlT9IMnFFawLg5ZEbn3pwWvc/77LxFz8QSK59w NL3KEM1WWM2UzYpeoN7BW52r309kB7TwN3hDYxrR5uOdAVNf+Qvq4dqY6hebWU2cRsET I1fQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704828644; x=1705433444; 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=cPcps9uuzX3SINcJEnjw9DWnrLswevBrQRdhfYc/zC8=; b=ZM8CUxIBQ15aerBnonnALiJ2HoDhEwvEGNuHo6Bg/vvm1Cd5DrH0zhhuTfOi6oZ89C xfhYEjCobYagiF5TdlrTCLhNBQr+HUKyFrHU/SvVxjbASeQ8sblE1VUik1+6q5gBplgN ymlcttTNySZLkSUn3zCympd8OsGG1fH6lq5jGI1pVc0KpBI/khC/IkfX81h8kNWJo8Pg VQnM5uY7wdTffEHkN/nW/UL2ASg0ofw8vOT/BOmGCUdpZjneU5hwXBD/YmVyMJrUOqUV qpI5Blx8Pas6lqRODoTH+GNpJs5bZpduJ9rFYjB/yf446vRPCWa0zLunLWy0mSGDGboQ nt1w== X-Gm-Message-State: AOJu0Yzq/sOaIPNfbae1vahcBKTjraL/T3wYhSchAW8Jlf+IGU2rUe6o i1JZdb1dSsdxVVJKdI0HUig= X-Google-Smtp-Source: AGHT+IH9jrj5kQNZQlHywCn9ODZPN+CgG4ie7MFJUZJwX9O5Hnq70mAUD5pxziQOO0GAnw2h2aeoVg== X-Received: by 2002:a17:902:e801:b0:1d4:1956:80d4 with SMTP id u1-20020a170902e80100b001d4195680d4mr4032512plg.47.1704828643820; Tue, 09 Jan 2024 11:30:43 -0800 (PST) Received: from gnu-cfl-3.localdomain ([172.56.169.119]) by smtp.gmail.com with ESMTPSA id f12-20020a170902ab8c00b001d3ea8ad878sm2161596plr.290.2024.01.09.11.30.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jan 2024 11:30:43 -0800 (PST) Received: from gnu-cfl-3.. (localhost [IPv6:::1]) by gnu-cfl-3.localdomain (Postfix) with ESMTP id 08769740676; Tue, 9 Jan 2024 11:30:42 -0800 (PST) From: "H.J. Lu" To: libc-alpha@sourceware.org Cc: adhemerval.zanella@linaro.org, goldstein.w.n@gmail.com Subject: [PATCH 1/4] x86: Move x86-64 shadow stack startup codes Date: Tue, 9 Jan 2024 11:30:38 -0800 Message-ID: <20240109193041.3987157-2-hjl.tools@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240109193041.3987157-1-hjl.tools@gmail.com> References: <20240109193041.3987157-1-hjl.tools@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-3024.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, KAM_SHORT, 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: 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+patchwork=sourceware.org@sourceware.org Add sysdeps/i386/libc-start.h and move x86-64 shadow stack startup codes to sysdeps/x86_64/libc-start.h --- sysdeps/i386/libc-start.h | 25 +++++++++++++++++++++++++ sysdeps/{x86 => x86_64}/libc-start.h | 2 +- 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 sysdeps/i386/libc-start.h rename sysdeps/{x86 => x86_64}/libc-start.h (98%) diff --git a/sysdeps/i386/libc-start.h b/sysdeps/i386/libc-start.h new file mode 100644 index 0000000000..c9b7d3614e --- /dev/null +++ b/sysdeps/i386/libc-start.h @@ -0,0 +1,25 @@ +/* i386 definitions for libc main startup. + 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 SHARED +# define ARCH_SETUP_IREL() apply_irel () +# define ARCH_APPLY_IREL() +# ifndef ARCH_SETUP_TLS +# define ARCH_SETUP_TLS() __libc_setup_tls () +# endif +#endif /* !SHARED */ diff --git a/sysdeps/x86/libc-start.h b/sysdeps/x86_64/libc-start.h similarity index 98% rename from sysdeps/x86/libc-start.h rename to sysdeps/x86_64/libc-start.h index c3cc05888d..63fef17029 100644 --- a/sysdeps/x86/libc-start.h +++ b/sysdeps/x86_64/libc-start.h @@ -1,4 +1,4 @@ -/* X86 definitions for libc main startup. +/* x86-64 definitions for libc main startup. Copyright (C) 2018-2024 Free Software Foundation, Inc. This file is part of the GNU C Library.