]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
tunables: Make tunable_list relro
authorSiddhesh Poyarekar <siddhesh@sourceware.org>
Thu, 11 May 2017 14:43:49 +0000 (20:13 +0530)
committerSiddhesh Poyarekar <siddhesh@sourceware.org>
Thu, 11 May 2017 14:45:56 +0000 (20:15 +0530)
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.

ChangeLog
scripts/gen-tunables.awk

index d886161b2055c457aeddc303fe67683eff8a6e6f..f92e871198bc9160e88830530c67b120f27d4f04 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2017-05-11  Siddhesh Poyarekar  <siddhesh@sourceware.org>
+
+       * scripts/gen-tunables.awk: Add attribute_relro to
+       tunable_list.
+
 2017-05-11  Joseph Myers  <joseph@codesourcery.com>
 
        [BZ #21457]
index 601240ac0d95b081a2faf2d57aa819ca5b6d177d..defb3e7354857fae1d6e742fc923f76651365358 100644 (file)
@@ -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]) {