From patchwork Mon Dec 23 14:49:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 853076 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp3435360wrq; Mon, 23 Dec 2024 06:54:10 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCU7AvsuDfcca0f/idzlx96EOw5CYZakqHZB0VDqvdBN8EDKal/PTExz3kcv6dUexHAGsljIUw==@linaro.org X-Google-Smtp-Source: AGHT+IHpRr67tFpyPrv9vlz6MML9pm8v9qgOfes6soRfkuLVWChejE8lyLNqaWXdqjp1x8w1E298 X-Received: by 2002:a05:620a:2412:b0:7b6:d5b2:e6d with SMTP id af79cd13be357-7b9ba7ac1eemr2025933785a.35.1734965650339; Mon, 23 Dec 2024 06:54:10 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1734965650; cv=pass; d=google.com; s=arc-20240605; b=ir4Ck/UQzFPBEjpdWD2XOrntNFiaabbxxHHbBm74mFdNVdWJiZ5dwAE9FPb5Fus9ZF v3dlS81KAy3RgrxW5tSrnLCTiraNccSUIqo4Z+GjPMt3aY1XBOO0e75cWIvyI/Pu0JKm 34LEGDIfFUaYxXrU3jCRDV5KskTegMyhVH2qMRqM3ymnOLxfnB0vuJLYKmpb4FrTkOtw n1866yhPfiyM9tz+JjEbsBrSAU5UB7heFVdSVL0OpAfvjr6EPrwQKIky9qesc4ixwQIw brMuCIj+QjEJLxENVNTApUDOCVYDW/aabrZsQd5aOy8ryVpux/EPzeyNNXSBqDPrPHl3 GtNQ== 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=2KIZiPYPlme8WSvRE1C5ZI0+WVUAqunh0GGKWI0hMkE=; fh=xV8Gp349bHw1ljD2lFQRwhGaJ4bIEzpeFyS/N97S3Sw=; b=KkiHv8WjaLbTv7XzzDh95981AH5JS692IRX6QsN35Znu0H/5M0OBsBQ4Yr6S2Twz+g 6dYIvSoHszPq3+ockPCAT90TseWcOmc7Oqu/ZasxtcaHbMZymPSW0psN6bl+fvhSw0Pc UNaa24PCMz2gkLihigqCcEP8DpGfnrh+ulI9xrr3CIkF+23hifKhFAW+STp2DBe1GAQV w0m/PhxJ9mdD/3R6YTkB7gxJo5bxg6Xotqdn3+j39j4eE+gimkWeI8IIgUI+a5fohOxB 5YdBB66GrhALkN8Q4ctMQzoaHmy00WuN4RKF7oHvFTVK758ptDsXSSqyFen9KHSvQNcJ m2FQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oTNih+mp; arc=pass (i=1); spf=pass (google.com: domain of libc-alpha-bounces~patch=linaro.org@sourceware.org designates 2620:52:3:1:0:246e:9693:128c 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. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id af79cd13be357-7b9ac478f2csi1098695885a.331.2024.12.23.06.54.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Dec 2024 06:54:10 -0800 (PST) Received-SPF: pass (google.com: domain of libc-alpha-bounces~patch=linaro.org@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oTNih+mp; arc=pass (i=1); spf=pass (google.com: domain of libc-alpha-bounces~patch=linaro.org@sourceware.org designates 2620:52:3:1:0:246e:9693:128c 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 E7EA6385843B for ; Mon, 23 Dec 2024 14:54:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E7EA6385843B 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=oTNih+mp X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pf1-x429.google.com (mail-pf1-x429.google.com [IPv6:2607:f8b0:4864:20::429]) by sourceware.org (Postfix) with ESMTPS id A5AE93858C35 for ; Mon, 23 Dec 2024 14:50:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A5AE93858C35 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 A5AE93858C35 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::429 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1734965407; cv=none; b=E7ojilCND6s6Q+NBDQraaI7UyE/IjcpvbX25VyFpowuICFamqMPJb8C2Ume3jhoHw/qMh1CsqnJxANa3sYm3g2Rg/xKDp/2mfBxOKiwUUW/4BKLbEaFYVyx7z03Oz14KOiCKhLvgDBGV+2lwkv4z7ugBgMSg8OMj4EjGLB3uDjE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1734965407; c=relaxed/simple; bh=VxuZJLw19iUfENrl7opP9mX5iIxeBjD9gvGI696+DuY=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=bEj9AIBAJce3J3Lkdb/gubqto533VyBp4LWeI/uiXgAfYIeAwrPfx+xfbJZ6O5XwXWxt0rxMAT3KJVDNXhtwQvd8dhj8e8qsrOoILDRaml7elgr86dr7DnwEljXBpl0m9gT/tbe9uMLvZMFhpKT8V3aEND4sUi7h+s841YAXPdg= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A5AE93858C35 Received: by mail-pf1-x429.google.com with SMTP id d2e1a72fcca58-725ee27e905so5060214b3a.2 for ; Mon, 23 Dec 2024 06:50:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734965406; x=1735570206; 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=2KIZiPYPlme8WSvRE1C5ZI0+WVUAqunh0GGKWI0hMkE=; b=oTNih+mpUW/aIy3TF7uKoeKB8F+QzJw39/YVEnzqaOBAs7Ze7VAUHMiQZpRtG9e+9W AvffZLHstJdJ8L6JcNSmXItIDFclJMIGXbhEVSnb7b2xmcvA8KXl26YbHb5rBLUapV6y F954V2/T1UlCtfOp7jjOqVCUnWD4Osv3tu1TqZ1nQWawbb4N5sfzmdquVsSPQ+ihyRfl b4wpHFEjLwASHDDNOO+aplSruZOTZqVAGYdFcJl04XSzjm1XBn2fLxhaaO/WnOOinTJA h6fsJPokoiSl+6P1QlbfNduv50EqO5boSdRtPG9yseBRHuQu5nomS+1rskma32D4MuPU jqjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734965406; x=1735570206; 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=2KIZiPYPlme8WSvRE1C5ZI0+WVUAqunh0GGKWI0hMkE=; b=l43jjLpcVs3TIcs515DBMcYUgJcsKmNJ+g/px+WEi1QUTP1nvVfE65b+rkk6bgqVMr 6LLThwRN15OWq8/XZqGe/l2wjLgC397ri5nd/U5wRroMkA3oMPygF6wwDqtw7NMylZHg 0bLMpCxtXT2zaMhhOHqO9ZlBFgI3sDLTMgChkbPNk16iee3Q8Q2B2l6wF/qrQXzTSyG8 2FwOvfkIPkqmtlnVcbAv7P63Mfy5qKX67sslD32c9nJtDd0qkx0Iyf4kZcUMw8iyFN5I tEzitz07ljbECeRmIWqy7xVD7XK21DA0/SYUm1UGOF46F1IuaDdQPtpGQwfRLoivRxzH oERw== X-Gm-Message-State: AOJu0YwxkaLTi7T7Q4SNQ0u1GXyoaszJDY1qN7Ocx0SkSH/CQxMKq6Dj W+YPUtTNRiVb9xOtpkJHoGReHFZhhM/F8yXxXTuwuEE9vP8zQXYGU6m/SuGMjWq0XHBSXGawRtm 4 X-Gm-Gg: ASbGncuaW2rcgjpsj2kRKiiZV3LAC5Kz9sfsg7LlxQ7b67D3mUXdq6toF7z8cs1u9KY XGGfI8njktvjnPYibNqDpyuLgzguiscNhu+RH8HiXQZi2LuMDfwQERlHitpGIUIQWEkJCmnIUhM EDLOrGc/J5baDsyT5v3ggYepEmssOUMtAvm5n9cxbJ6cvh2wCQiSCVEFsqHhBbxQQzt3hNaO4Uz al9rLbS4KGzRJLGgFGcrAHrTqT+CUZXJvGeS1HC+y8LyVkM34WieEi1VTmd8jnxa+CMl4IjprBN GL5lmpaECMcesjnelsokKZBTWw== X-Received: by 2002:a05:6a21:2d09:b0:1e1:afa9:d397 with SMTP id adf61e73a8af0-1e5e0463addmr20705086637.15.1734965405978; Mon, 23 Dec 2024 06:50:05 -0800 (PST) Received: from ubuntu-vm.. (189-69-57-246.dsl.telesp.net.br. [189.69.57.246]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72aad816187sm7930372b3a.16.2024.12.23.06.50.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Dec 2024 06:50:05 -0800 (PST) From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: Florian Weimer , Adhemerval Zanella Subject: [PATCH v6 2/3] elf: Add tst-execstack-prog-static Date: Mon, 23 Dec 2024 11:49:12 -0300 Message-ID: <20241223144954.3823971-3-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241223144954.3823971-1-adhemerval.zanella@linaro.org> References: <20241223144954.3823971-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. Reviewed-by: Florian Weimer --- 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 e8fc6bd65f..cea48e9537 100644 --- a/elf/Makefile +++ b/elf/Makefile @@ -567,6 +567,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 endif ifeq ($(have-depaudit),yes) @@ -662,6 +665,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 \ @@ -1982,6 +1986,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