@@ -344,6 +344,7 @@ maybe_enable_malloc_check (void)
/* Initialize the tunables list from the environment. For now we only use the
ENV_ALIAS to find values. Later we will also use the tunable names to find
values. */
+__attribute__ ((visibility ("hidden")))
void
__tunables_init (char **envp)
{
@@ -423,6 +424,10 @@ __tunables_init (char **envp)
}
}
+extern void __rtld_tunable_set_val (tunable_id_t, void *,
+ tunable_callback_t)
+ __attribute__ ((alias ("__tunable_set_val"), visibility ("hidden")));
+
/* Set the tunable value. This is called by the module that the tunable exists
in. */
void
@@ -66,14 +66,24 @@ typedef struct _tunable tunable_t;
# include "dl-tunable-list.h"
-extern void __tunables_init (char **);
+extern void __tunables_init (char **)
+ __attribute__ ((visibility ("hidden")));
extern void __tunable_set_val (tunable_id_t, void *, tunable_callback_t);
+extern void __rtld_tunable_set_val (tunable_id_t, void *, tunable_callback_t)
+ __attribute__ ((visibility ("hidden")));
+
+/* Avoid PLT when calling __tunable_set_val within ld.so. */
+#if IS_IN (rtld)
+# define DL_TUNABLE_SET_VAL __rtld_tunable_set_val
+#else
+# define DL_TUNABLE_SET_VAL __tunable_set_val
+#endif
/* 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) \
({ \
- __tunable_set_val \
+ DL_TUNABLE_SET_VAL \
(TUNABLE_ENUM_NAME (TOP_NAMESPACE, TUNABLE_NAMESPACE, __id), (__val), \
NULL); \
})
@@ -81,7 +91,7 @@ extern void __tunable_set_val (tunable_id_t, void *, tunable_callback_t);
/* Same as TUNABLE_SET_VAL, but also call the callback function __CB. */
# define TUNABLE_SET_VAL_WITH_CALLBACK(__id,__val,__cb) \
({ \
- __tunable_set_val \
+ DL_TUNABLE_SET_VAL \
(TUNABLE_ENUM_NAME (TOP_NAMESPACE, TUNABLE_NAMESPACE, __id), (__val), \
DL_TUNABLE_CALLBACK (__cb)); \
})