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 X-Patchwork-Id: 814376 Delivered-To: patch@linaro.org Received: by 2002:adf:e641:0:b0:367:895a:4699 with SMTP id b1csp556581wrn; Thu, 25 Jul 2024 13:13:54 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW90iyj1h/CIvRGTO0JsvEuhKweAc2uYqfJyQO1s/m4QKh23SXw5hXOZLxYirdwo16GdPqjeYoxHIDZgo5g9z6e X-Google-Smtp-Source: AGHT+IFx+eYfDwdKaT98HCL6uomzZvevkMf7eCmsInonRQdQk5X6krA++68N8LB7fY64Fj/9pU3K X-Received: by 2002:a05:622a:1885:b0:445:e9:e67b with SMTP id d75a77b69052e-44fe32a01edmr79508541cf.23.1721938434406; Thu, 25 Jul 2024 13:13:54 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1721938434; cv=pass; d=google.com; s=arc-20160816; b=tVK8DIJmbRjcwDd/sYVjg+W3EWF/vFr2MShDjIV9pQfeQIJZlKsDW8Wc6wGdHUoL2V xZuMOBMm1svhJpU1IVkdpwBAfbJu29K1Ym69JlIFKDxT/cQadC8oEBU9k9IcnRDLS7dY y4afwNRoq1xToKkV0b+Vj2wCvlrr5htiqAcoPnNPAdgQomSet02fGcSytZHI6YQR4TfN 6ZuVrTEoRBp/xQORJdLdZAA8rzg/mMmZ9V9lDlWHSGizWgpvJYHK1bkHPKVHA0DYICaF Flj8eqEPjLF8P6q4+s/8kk9cYp0WNBZy/NCiZdhr3QOEWqgrZolXR2BmAqjaYMBn1gv5 JddQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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:to:from :dkim-signature:arc-filter:dmarc-filter:delivered-to; bh=XGKJLU9fcSS1glrtUAzLsWULpSFPOnYO4O4Nn3Qa988=; fh=dHLBnA+MhGtNtN2B2JMAELi4oD+gmgMg7DL8H0jYbkI=; b=sMHBgZcVyWq/NYJhw+zPGLMl+4d3XI/w8giKe09c7bqHrkCIO/Hbxd3MJznM8iBtv0 YPdm2CEWAg+mcGrGUHQYE1qTlCLTxVmIrZxkCvC4r4tk5SUHRsBWcIW8tncyDm//4qcf w98xmstaAtT0635K4dGOp763QTboJfOosYldSXe6er0ciCMWWU9SNVwkUDR6VPNeaH0S o1EoSHfVAyd7JIeX3JyFsIjCLQSb4vqpAx/v1ktb6Z83hGL28eL+Vs/OPJM+12CHW13j cwMlUPuT1a13zFsTAeVh/aVKBVPsQN2oIWMU/yNqh3+iUofWSiPpZ5paquicaAw42ldM aLRQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dp+4V3vu; 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 d75a77b69052e-44fe815b51esi25886141cf.215.2024.07.25.13.13.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 13:13:54 -0700 (PDT) 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=dp+4V3vu; 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 F16F23858401 for ; Thu, 25 Jul 2024 20:13:53 +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-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~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 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