From patchwork Tue Jun 18 19:40:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 1949457 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=RvzaFvag; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W3cbZ3q6Yz20Ws for ; Wed, 19 Jun 2024 05:42:34 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C9957388450F for ; Tue, 18 Jun 2024 19:42:32 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pg1-x529.google.com (mail-pg1-x529.google.com [IPv6:2607:f8b0:4864:20::529]) by sourceware.org (Postfix) with ESMTPS id 386EA3883022 for ; Tue, 18 Jun 2024 19:41:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 386EA3883022 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 386EA3883022 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::529 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718739681; cv=none; b=uGfBrsz5ky79F4bL+dPmyn4p8R095YyE6CPKpC2VKhFLJGbe1c9H+JvOhMoQ4/wHZTTMMbCkArXhk8pX5HfzmOTLgq26fBDS+TW5wKdWu+utLASA2XfhUI4c7S6J7YHv/TvgZKMFa1Us4+ynXvU0mHz6ULsxWUVRF84leX/00bQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718739681; c=relaxed/simple; bh=qXjTLwA1GKgQ83QYUwsp0VN/aCyLjm37BBQ//IH+KS8=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=GMNX0GMcQusAKZrtbHL289SctAGGEHBqMY3RGesy7gFAIP5nAdQnRBncBHLWp37rHpkQwen7ZV2Mdz6lszoaNcUFFo0u2rBreOB1dvTUwD9K8qVfEv6puRH8pWhKWgDvD11fUYymECqa45kLyyE/vwzIu2lWhpQbkdFM76nYnWg= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pg1-x529.google.com with SMTP id 41be03b00d2f7-6e41550ae5bso4314533a12.3 for ; Tue, 18 Jun 2024 12:41:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1718739676; x=1719344476; 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=qkkHnyhbUER4+85Hxpq9m7J9UiE8+pyGgsjA6Opb4Ds=; b=RvzaFvagI32yUyx5/KOoRKHOIt+tvAipF/DCnUD6MlljCoPtBEVKoZo8aoVLv+NnqZ uMx7KI8OYjqw5h18kLUYDmVzQZU8ev501WfntnVwxB2k34RQYvjCHMFteiqKeIQ2bLHE VkP+cNKC0xoLLA2JEkDqiF5xD2y9Sv+eYTOdszqW7oHG9wSEFcoGaTYOKzBDATYCWVwP dkz38NK9yTcvl4BK3x9v9zON6NpNvy88+9UwspNWlHnOEH25KIy64pogzg1w4tgIycQp 08v135Y+k2FqTh5zgCpzy0JD5lJknL8k9NXeX+mTADsl0R5mGXjarjEghYU0kfaZSXnD QvMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718739676; x=1719344476; 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=qkkHnyhbUER4+85Hxpq9m7J9UiE8+pyGgsjA6Opb4Ds=; b=wJWT2NCbupaGDVbHIiKNZGM9bDhD6bGnvNPbGQHrawC/Kd/8gqD/7dyfpCdKx2JHnh 9Gv3dJVl7A682KYlTfP/Djdb9G7PgGrcEL2Sc34KcsBiEYZA6SBdTJ3bmVNElPFxYN6E jPvYgTR1QkAPSeg3N43tRO9iVkG6oFu/+sis5PYqoagC3HnyEv99s4oLjC1l7472HnyH CM0yJ+ivpRdPCCYxVAcMIZQOb0ZCvXJEm8jzZZhHyNc+OeQzUaTLojyDtrqGTeV9tHQJ JLvFYCFbVyoqHoxlQD+C0/CyqM4WBHpsHkq4+JFtzDpZeDRFQYjBWPbReMUqUOeLHe2Y 4kCA== X-Gm-Message-State: AOJu0YwLFl4DZVrYYHtkT06GA6OB5yImE/7Vjf6uH1wc5+O4tkVuwOs8 dI2sWQooiqdFEFeZ89LJW5JLUDFVxENwcnjoe77ni6nGVrZrQhmgxZnKqJacAkfCPfbH07/WR1k v X-Google-Smtp-Source: AGHT+IE1ug+nkiqDh/9MSc3308KjrH2avmv5vhZczkujxuzG7EI+Jp/qDt8NvxZpPKmnxNKeaofh5Q== X-Received: by 2002:a17:90a:be15:b0:2c7:ab29:a751 with SMTP id 98e67ed59e1d1-2c7b5cfcaedmr646015a91.29.1718739676521; Tue, 18 Jun 2024 12:41:16 -0700 (PDT) Received: from mandiga.. ([2804:1b3:a7c1:5c0d:de56:b6f3:eeae:13e7]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2c50c4ce173sm6209093a91.23.2024.06.18.12.41.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Jun 2024 12:41:15 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: "H . J . Lu" , Florian Weimer , Zack Weinberg Subject: [PATCH v3 3/4] elf: Add tst-execstack-prog-static Date: Tue, 18 Jun 2024 16:40:21 -0300 Message-ID: <20240618194102.2059389-4-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240618194102.2059389-1-adhemerval.zanella@linaro.org> References: <20240618194102.2059389-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, 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+incoming=patchwork.ozlabs.org@sourceware.org Similar to tst-execstack-prog, check if executable stacks works for statically linked programs. --- elf/Makefile | 7 +++++++ elf/tst-execstack-prog-static.c | 1 + 2 files changed, 8 insertions(+) create mode 100644 elf/tst-execstack-prog-static.c diff --git a/elf/Makefile b/elf/Makefile index bb6cd06dec..604b7df1cc 100644 --- a/elf/Makefile +++ b/elf/Makefile @@ -543,6 +543,9 @@ tests-execstack-yes = \ tst-execstack-needed \ tst-execstack-prog \ # tests-execstack-yes +tests-execstack-static-yes = \ + tst-execstack-prog-static + # tests-execstack-static-yes endif ifeq ($(have-depaudit),yes) tests += \ @@ -630,6 +633,7 @@ $(objpfx)tst-rtld-does-not-exist.out: tst-rtld-does-not-exist.sh $(objpfx)ld.so $(evaluate-test) tests += $(tests-execstack-$(have-z-execstack)) +tests-static+= $(tests-execstack-static-$(have-z-execstack)) ifeq ($(run-built-tests),yes) tests-special += \ $(objpfx)noload-mem.out \ @@ -1856,6 +1860,9 @@ LDFLAGS-tst-execstack-needed = -Wl,-z,noexecstack LDFLAGS-tst-execstack-prog = -Wl,-z,execstack CFLAGS-tst-execstack-prog.c += -Wno-trampolines CFLAGS-tst-execstack-mod.c += -Wno-trampolines + +LDFLAGS-tst-execstack-prog-static = -Wl,-z,execstack +CFLAGS-tst-execstack-prog-static.c += -Wno-trampolines endif LDFLAGS-tst-array2 = -Wl,--no-as-needed diff --git a/elf/tst-execstack-prog-static.c b/elf/tst-execstack-prog-static.c new file mode 100644 index 0000000000..328065dd9c --- /dev/null +++ b/elf/tst-execstack-prog-static.c @@ -0,0 +1 @@ +#include