From patchwork Thu Jul 25 20:05:19 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: 1964862 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=dp+4V3vu; 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 4WVMXn1JkFz1yY9 for ; Fri, 26 Jul 2024 06:14:01 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6DFB43858288 for ; Thu, 25 Jul 2024 20:13:59 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pf1-x42d.google.com (mail-pf1-x42d.google.com [IPv6:2607:f8b0:4864:20::42d]) by sourceware.org (Postfix) with ESMTPS id 7DC3D385828E for ; Thu, 25 Jul 2024 20:12:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7DC3D385828E 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 7DC3D385828E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::42d ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1721938338; cv=none; b=DhZjAgT7MKR+Q4Hjo5Vfqee33xbSUeLMib1kCkzFd6dGTbYKOBBMnyBaeRTfkNuOfUlGX0pBZH+x093CGxK7S/l+h1HQmb1CQBWHrTFknKUqGtAICitvkeG1+xFAC7EipkvQuGie9gDjDEHLraUuTHnvzic/5UOPpLmVS7A9BmQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1721938338; c=relaxed/simple; bh=qFYxuIllmNjSJZzM7dlSEFtk6459K0tFiYtTjt2poPY=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=TFB4sV8wDdKvDR4vKDleCjYYtifhw6HpG9rFNdgJ2ZYw5bX9Dqgd8tRawPmxJqKvt+vPErdhDrr4+dficriX3xp8dJv+jFuLacKREWjRA9Kakl3CMZuk/Y8RQn51Om48Tg+yBrt6zVLUMQus9BNE2I8VagxxmyLUe1z7zIeEk+M= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pf1-x42d.google.com with SMTP id d2e1a72fcca58-70d18112b60so167355b3a.1 for ; Thu, 25 Jul 2024 13:12:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721938333; x=1722543133; darn=sourceware.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=XGKJLU9fcSS1glrtUAzLsWULpSFPOnYO4O4Nn3Qa988=; b=dp+4V3vujEUxLquHGpPIful6e8Kmg1DPM9mO5YcxiQzCf8qwkCz7V4b2/DD+Dtr8Bq lR5sOvu47qKcoEeNNCq7+q3kIMCNOcNpHkJdPPbjmoATzKfP7pPb+pYPDiMoys0twEdZ d1rN13DN9HCkMDmvChOU3ncKUCvbNdBypJPcFrYOhpKyyTrRrLU+6u0sNFKxMghtFfd4 ODWCxO/bTOuHvuWMDnrfk68z2xI9ibMNo9gH6dtKfsejUapXMiak825q362UcqBnHTJK 68KFvXi+sOqbmJh6nud+TTPQzucvD9W/yfkpqTxplGP8weB6pRmq+FKpLjA0o+I08QVL 6H2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721938333; x=1722543133; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XGKJLU9fcSS1glrtUAzLsWULpSFPOnYO4O4Nn3Qa988=; b=Err4cbXaX6cMgqqwIGdT6AkoY96fo8Wv0GoMGVVe/pNGTWRsb/9oq5OjCtx7g68pR/ oomTWL3gGzdUTZpMK5nK8VXIFTCMnaAFM4OMEpa0Kx6ae/4xr6IdPgU1WqlP7CvBOGUh KbmJtg2S0HAiOYSwCOkPmR3P5sp+kainBoMnSIIBvkFiQ78udfX89k7s6ZdMX5XdFTHh vuYS7ssEtIXMhrAOcgt8DBsNQm59v0DhVjX9WA8K8oEggktSgHhCHEwMAvhrdXw8Ir5Z ONdyso/KWGU2ABCRMY/76sMB7ET+x7LfyXguXWd7tlo+pDPvxCSYQm7lSuR8MtZNrkdb +JXQ== X-Gm-Message-State: AOJu0YydhKOTUJOfwnXmdVPpYbH/kCBwiMqeV3WlP0RjdYyqWNx/N7dF +qouFUgVzHp15FruTgo041BQPr7/LvuZpjwq8jF+/LWZkG87YCnkceaaOtcv9gTI2yk7np/D/B+ h X-Google-Smtp-Source: AGHT+IGDFr4wUBGWyWyXeVQ2aZk3q0QEyyHXEoLU2yK9DuE9N262tWUnJ4PBla4ZdNJNAPsOLMraxA== X-Received: by 2002:a05:6a20:258f:b0:1c4:8694:6be8 with SMTP id adf61e73a8af0-1c486946e41mr2244547637.3.1721938333428; Thu, 25 Jul 2024 13:12:13 -0700 (PDT) Received: from mandiga.. ([2804:1b3:a7c1:1944:71e3:2ede:b2a5:f38e]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7a9f884d12csm1334994a12.55.2024.07.25.13.12.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 13:12:11 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH v4 3/4] elf: Add tst-execstack-prog-static Date: Thu, 25 Jul 2024 17:05:19 -0300 Message-ID: <20240725201159.3286231-4-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240725201159.3286231-1-adhemerval.zanella@linaro.org> References: <20240725201159.3286231-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.5 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 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 a3475f3fb5..a555346492 100644 --- a/elf/Makefile +++ b/elf/Makefile @@ -544,6 +544,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 += \ @@ -631,6 +634,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)tst-ldconfig-X.out \ @@ -1879,6 +1883,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