From patchwork Thu Nov 28 17:36:44 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: 845954 Delivered-To: patch@linaro.org Received: by 2002:adf:f2c4:0:b0:382:43a8:7b94 with SMTP id d4csp379180wrp; Thu, 28 Nov 2024 09:44:18 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXWEyGrD7Eg1no5IRNY7hxBIKCHzxIukKF5Yy7DzothnfNqOmIBFKZtUuWXizJOo58W6UK9Yw==@linaro.org X-Google-Smtp-Source: AGHT+IFqW/VWA7YJc+t9bvyThd8iXvDlCH9dyYD5qbOBUxBY0kbGEongSaNLrdiL+AxsiGsX6Nim X-Received: by 2002:a05:6102:3708:b0:4af:4cd4:2923 with SMTP id ada2fe7eead31-4af4cd42b5emr8041192137.3.1732815858224; Thu, 28 Nov 2024 09:44:18 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1732815858; cv=pass; d=google.com; s=arc-20240605; b=CY+6u7aw9SCvAGfiomNcdonbmQ7h3DEzN5lnHIVqHcocD2BrJTYH57nWObRA4nNfPd 0u2UEI2RlZls/G6C4G7tWMuJovVNjQ2K5C0j+f6vUzswL5p3NLJsx22Sm+OSVUCVhF5J ie39ASFvacZWhZXiNMWpI6jsZuxT7v12T2StGCVlE9ZJ24+t54FuZfaP4XMSWy5oGQ+5 Kq9OEeEhz7jyHNeML/lYhbD+x0HniEZljNLS43mMCHJ5w/o1DtVr6LdbsaO4BFZ238c0 CpYJqIIJKz3q0ZfO//qO4jtGVCyO2yDeBRNLW0eCvkTInOLSNmNostUJOIcSQ/vWEA0I ErKQ== 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=qcPXfGC7xd7XUl3EcMpXBmjQcyhiTXZ2yJEVUnb/y/A=; fh=5vlP+0ToNsZNUEx4IDYFBtVkL7R0+LPY9AvG1oUICyQ=; b=LbGxHRMI1B0NRFtA/cNTIu+LgV2msk+luU1UGQqw1WIurn1CIIsmR6NPQhN7oz5wVW AJIx/MrGFXHXW+4ioSabbMfLgRw728vqeR45dWY3cNk3Xn8K+BGDfuNaarTwgy8YGr73 Fqm+s3xed6BYgV97+3QjEr3Cca5nSz3yMIQun2H1h5xMVfiOJoLtem0EJxvPj4zB1c61 W1Tijp65+ZJW04R2kedkAsBZpW4ODdexzA/zQtsdgv3aZiT3HAAyaVxseyCkXVUCXH/f N78VA1X4W1rgVAQxaMjRvUv+DU60aT4wsoZvZo9XtwMIwsWQWB+0g3fyNnybwKhQZuUh FlLg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="F/mWhrm0"; arc=pass (i=1); spf=pass (google.com: domain of libc-alpha-bounces~patch=linaro.org@sourceware.org designates 8.43.85.97 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. [8.43.85.97]) by mx.google.com with ESMTPS id ada2fe7eead31-4af593a1820si633530137.556.2024.11.28.09.44.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Nov 2024 09:44:18 -0800 (PST) Received-SPF: pass (google.com: domain of libc-alpha-bounces~patch=linaro.org@sourceware.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="F/mWhrm0"; arc=pass (i=1); spf=pass (google.com: domain of libc-alpha-bounces~patch=linaro.org@sourceware.org designates 8.43.85.97 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 CB4283858C53 for ; Thu, 28 Nov 2024 17:44:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CB4283858C53 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=F/mWhrm0 X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pf1-x42e.google.com (mail-pf1-x42e.google.com [IPv6:2607:f8b0:4864:20::42e]) by sourceware.org (Postfix) with ESMTPS id 466EF3858C3A for ; Thu, 28 Nov 2024 17:39:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 466EF3858C3A 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 466EF3858C3A Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::42e ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1732815541; cv=none; b=Pvi4YO1zUWpOnfb7A5BAQCOFfsF9wcHBmnF+MDG63IVQdFE9rdqFGnl5OjHdIiqjuf0hsF+58iO0J7s/DhRQNvoMtdedW6aOBGP4T8ACrFg/Dn30TmrsBMUvPOLswzCEuMTWo7X5cKtH/QmVySJGeHqFX4dpk3XoMzN4EWA8cKA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1732815541; c=relaxed/simple; bh=K2oO4tXSzKSoK5XUBAefyG8djK9ADVBwbgREEEnWyDQ=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=fcbymGcjdPquxhuvTIZjynJJJGdMAlBN/8djoIHfZljAx2CWJ7Y9v2xJTS979kxOAdHI6BpF0PKkt6LgRQAREDqxN69T/VsYc6zbTygtIGZqNtIVuX+vLpatzpjgF5thePLqwLbb2EquU9VM3KHPbm6qCjw6qroFJLPs+3VCSDM= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 466EF3858C3A Received: by mail-pf1-x42e.google.com with SMTP id d2e1a72fcca58-7251d20e7f2so1092878b3a.0 for ; Thu, 28 Nov 2024 09:39:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732815540; x=1733420340; 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=qcPXfGC7xd7XUl3EcMpXBmjQcyhiTXZ2yJEVUnb/y/A=; b=F/mWhrm0CkX113bwAOpHGYqGCZlQ2YFoDNG3tTkwnogbJLqc69cCkm8luL08YpdxCD IelbR4oc/hhhji7wVuYx0iBXjibZTMDVlryAlid5O4kAhcpNAfMw+HZVaIj2diBUgX4Z aWfdxATL913FT9LCQJhoG13gW2tH10N/DIK0U0oXOfiQ1xWmSXrgtDvUL9/fnxQL6zPT 09tQ1FHr+YNITnwMvRfX4hrubyvBEB2eZoRzO1T9YHcg3gN6OWB91Er2Tgh4ef2kiTs2 O/asB7ZtvgLJZ1X9uOGHxkJh6jxHPj7L5zLay/Y+0oPobPBTxrUIOgP9kKvxDGv10KqU z2eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732815540; x=1733420340; 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=qcPXfGC7xd7XUl3EcMpXBmjQcyhiTXZ2yJEVUnb/y/A=; b=a3nKFptO71cDA4kUt5WuHN3G8rOavNSVyiIDG0BCqHWZgeARMBhH+he87/gl10j4he 4KVTgXVLmy/2Wgp4OFma3bORKakIy3dGa2+cRfNZ37331xAcuQIHKStGzdDPjp4q2Jvz RcFUCH4a0pYyFql82dI/leKVO470i8JPlhMJ+eHo+gmWG+AFXBWufSUIEVO7uu1Poq5K W7Kf7Pp5Qc7Mtsposo2hUmq4O/FP+grACwpxx6nkyXIMxWGGEWeS0Fp0qn4KT4HyP2IN hAyAcXr/M/dS2Yp495qP7UwAKfjLVq4bNMSIIOMecCUBOWB+VPwWJ8MWt+FHkpwuKjFx ubNg== X-Gm-Message-State: AOJu0YyCj2VhmWLsUReYWRfxP3oqUH1y1fpqqrQvxETlZ7Ec/0gpfABx 5zBxrvxEFtVyrIWf03sA2aAN/n44aQlT1yi8XGbAtrqCDokz9akdDJz9EA+tlFw9Atk0Tnynv3V oMcq/5w== X-Gm-Gg: ASbGncsixpYxbUPKLAOA5sHcyozkux/cvLOcs+dGU61ResvWO+p1n+DnCk3kq+tUnPA NGlkfKQuvVWoMvav0tXvatV/nnQHjdo5RHvAKqydGsdaQsMw71ElCFhHiLIlHSnpbu8s4XbCBia y6NtfgXxELLhghh3In4q/asJ1J5TXwzJ50Iu5Dpp00xN3++5fL5M/W96vGqDoqUR6DjQ+qcmYG9 Xn6Vjge1oUmVwMnmVAQhdvY5uNxzbm9PPOg1h042IcvuN7AVQUaTcft+junwaA= X-Received: by 2002:a05:6a00:1390:b0:71e:5a1d:ecdc with SMTP id d2e1a72fcca58-7253012f56dmr10609866b3a.17.1732815540024; Thu, 28 Nov 2024 09:39:00 -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.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Nov 2024 09:38:59 -0800 (PST) From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: Florian Weimer Subject: [PATCH v5 3/4] elf: Add tst-execstack-prog-static Date: Thu, 28 Nov 2024 14:36:44 -0300 Message-ID: <20241128173851.1920696-4-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 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 ba6b022a2f..bdd169f4e8 100644 --- a/elf/Makefile +++ b/elf/Makefile @@ -553,6 +553,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 += \ @@ -647,6 +650,7 @@ $(objpfx)tst-rtld-dash-dash.out: tst-rtld-dash-dash.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)tst-ldconfig-X.out \ @@ -1916,6 +1920,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