From patchwork Wed May 10 14:47:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Siddhesh Poyarekar X-Patchwork-Id: 99008 Delivered-To: patch@linaro.org Received: by 10.182.142.97 with SMTP id rv1csp237739obb; Wed, 10 May 2017 07:48:11 -0700 (PDT) X-Received: by 10.98.13.17 with SMTP id v17mr6456163pfi.89.1494427691704; Wed, 10 May 2017 07:48:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1494427691; cv=none; d=google.com; s=arc-20160816; b=WJj9Zi+sUit//WkecyspyOW+e4vVmMGNx3AND+VukfYiTkbvu1KitdAh3sEtIiorK2 TBxdPuZimvMg9Lxzu8Yz51iAU0fsKRYlk6aGSHJx+46D+i7Mqk4nde0NUxISUnbPa6jz 1gILMYaoTdaKjgoBEctzo+1TamDKrczNtOasHRXprrBJSe6isY/mOtrW9lsqQXUHNjWh FVyfncSTa+9l9POIwSBIjQMPp6lgIvX393VSFJ+B4yFU4MPMHgMZgAi2aEL6XR2JU0UK CPDPXc0xbqfmmy47yfFTbHUQFEVhdoYmbK6QqHMEPoAneavmb/gFfMiX+Bhn80s/UCEz Y3Vg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :delivered-to:sender:list-help:list-post:list-archive:list-subscribe :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature:arc-authentication-results; bh=jO9PEdhXLVPB/t69uf+puVXiNFgqrnQJmtVUovZQ3Ds=; b=MQcZiHqvzZE4V7rjF8Xur5AXIO2ZSDdCtCboqW17AETr7WzwBJMLzdYeCdHfz6nONQ L/Vi2PC+VWLeL1Tt5GzalkDQTXq74DOyeucp0tG2FjexnaKpn5zGo+tUj7mLKv0qxOcd HVX8PfuF3x0Df35UQ8DmOa91fg7bKfO0ZcYMVBEDVoK7Mjmqb57ekCgzgpdaRkbhm94l mJ1bV3ZLGCiVp//5bLaLe21jpaE33aUYZ6U1HxpYIVF6hNW0DGIkhPmTTf+UwgYI97HG wgrYnhnyucBiUUWxKFIJ2+a3T9NBXDLMHALqQVzcDFBe4TiGq7g8aPmOVNBWiS3Hb9bm ovig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org; spf=pass (google.com: domain of libc-alpha-return-79217-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-79217-patch=linaro.org@sourceware.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id o5si3190965pgk.200.2017.05.10.07.48.11 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 May 2017 07:48:11 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-79217-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org; spf=pass (google.com: domain of libc-alpha-return-79217-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-79217-patch=linaro.org@sourceware.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=IT5WQOI8Uga1B/lwKQmUlK4w7Fk1LMJ C7KUX0dGFAexq4pzrXROnKpTZbEhZOsovaM+ndTbDlHceZuLBktZSBMZucQNc3t5 qlheYoi9lP5kVMJz3AbfxyZ8NMHTbL5M1myjyqEWylILDXY8QaCvKY4/cpb5zTFA 3F8MgVlseu60= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; s=default; bh=J9GJvV+jMcrRg84ze+iOOT/N+O0=; b=P2+MH 5Y+IoTxIYARourzV9pLd9jETr4K1N0ruAkUtVnONdYA/oGCVD9pwXR29DjCYYCgQ 5CHus2tWhBwOw1C2ulwbQaasYGQsoFVsUe0jzdJSbwM5EU9z4J0rKqc/04ey6W7X mJp8Lrcz74BflDoEP+iSvh+4/ovzrBPQIK0rgw= Received: (qmail 65088 invoked by alias); 10 May 2017 14:47:55 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 64515 invoked by uid 89); 10 May 2017 14:47:55 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_NEUTRAL autolearn=ham version=3.3.2 spammy=Hx-languages-length:1280 X-HELO: homiemail-a58.g.dreamhost.com From: Siddhesh Poyarekar To: libc-alpha@sourceware.org Cc: Siddhesh Poyarekar Subject: [PATCH 1/8] tunables: Make tunable_list relro Date: Wed, 10 May 2017 20:17:10 +0530 Message-Id: <1494427637-14555-2-git-send-email-siddhesh@sourceware.org> In-Reply-To: <1494427637-14555-1-git-send-email-siddhesh@sourceware.org> References: <1494427637-14555-1-git-send-email-siddhesh@sourceware.org> From: Siddhesh Poyarekar As of now we don't need tunables to be writable after they have been set initially, so there is no point in having them writable. Put tunable_list in .data.rel.ro so that it is set as read-only after relocation. This also allows us to move some of the dl_* variables that are tunables controlled into the tunables infrastructure instead of having two copies. In future if we ever need specific tunables to be writable at runtime, we can split the tunable_list into two. Regression tested on x86_64 to verify that tests continue to pass. * scripts/gen-tunables.awk: Add attribute_relro to tunable_list. Change-Id: Ibb398bf3c7f1ea3c5d0a7fdd4cb794005a94b02f --- scripts/gen-tunables.awk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.9.3 diff --git a/scripts/gen-tunables.awk b/scripts/gen-tunables.awk index 601240a..defb3e7 100644 --- a/scripts/gen-tunables.awk +++ b/scripts/gen-tunables.awk @@ -141,7 +141,7 @@ END { # Finally, the tunable list. print "\n#ifdef TUNABLES_INTERNAL" - print "static tunable_t tunable_list[] = {" + print "static tunable_t tunable_list[] attribute_relro = {" for (t in types) { for (n in types[t]) { for (m in types[t][n]) {