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: 20374 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(-) 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]) {