This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Mark __tunables_init hidden and avoid PLT
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Siddhesh Poyarekar <siddhesh at gotplt dot org>
- Cc: GNU C Library <libc-alpha at sourceware dot org>
- Date: Thu, 25 May 2017 05:33:01 -0700
- Subject: Re: [PATCH] Mark __tunables_init hidden and avoid PLT
- Authentication-results: sourceware.org; auth=none
- References: <20170524191726.GA27395@lucon.org> <aed4e8b6-1210-70b9-dc1f-1a3a01e65f13@gotplt.org>
On Wed, May 24, 2017 at 10:57 PM, Siddhesh Poyarekar
<siddhesh@gotplt.org> wrote:
> On Thursday 25 May 2017 12:47 AM, H.J. Lu wrote:
>> Since __tunables_init is internal to ld.so, we should mark it hidden
>> to avoid PLT. We should also avoid PLT when calling __tunable_set_val
>> within ld.so.
>
> We don't export __tunables_init, so it shouldn't have a PLT anyway. As
> for __tunable_set_val, I have it in my patch 3/5:
>
> https://sourceware.org/ml/libc-alpha/2017-05/msg00654.html
>
> which needs minor rework before pushing.
>
These can be in a simpler patch. Here is the updated one.
OK for master?
--
H.J.
From ed8f688eeab70308af7240931861189d3f509e1c Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Wed, 24 May 2017 12:09:41 -0700
Subject: [PATCH] Make __tunables_init hidden and avoid PLT
Since __tunables_init is internal to ld.so, we should mark it hidden
to avoid PLT. We should also avoid PLT when calling __tunable_set_val
within ld.so.
2017-05-25 Siddhesh Poyarekar <siddhesh@sourceware.org>
H.J. Lu <hongjiu.lu@intel.com>
* elf/dl-tunables.c (__tunable_set_val): Make a hidden alias.
* elf/dl-tunables.h (__tunables_init): Mark it hidden in rtld.
(__tunable_set_val): Likewise.
---
elf/dl-tunables.c | 2 ++
elf/dl-tunables.h | 3 +++
2 files changed, 5 insertions(+)
diff --git a/elf/dl-tunables.c b/elf/dl-tunables.c
index 8d72e26..b6e6b3d 100644
--- a/elf/dl-tunables.c
+++ b/elf/dl-tunables.c
@@ -470,3 +470,5 @@ cb:
if (callback)
callback (&cur->val);
}
+
+rtld_hidden_def (__tunable_set_val)
diff --git a/elf/dl-tunables.h b/elf/dl-tunables.h
index f33adfb..20ee512 100644
--- a/elf/dl-tunables.h
+++ b/elf/dl-tunables.h
@@ -69,6 +69,9 @@ typedef struct _tunable tunable_t;
extern void __tunables_init (char **);
extern void __tunable_set_val (tunable_id_t, void *, tunable_callback_t);
+rtld_hidden_proto (__tunables_init)
+rtld_hidden_proto (__tunable_set_val)
+
/* Check if the tunable has been set to a non-default value and if it is, copy
it over into __VAL. */
# define TUNABLE_SET_VAL(__id,__val) \
--
2.9.4