1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-29 11:41:21 +03:00

Mark internal _dl_XXX functions hidden

Since internal _dl_XXX functions are only used internally in ld.so,
they can be made hidden.

	[BZ #19122]
	* elf/dl-runtime.c (_dl_fixup): Add attribute_hidden.
	* elf/dynamic-link.h (_dl_try_allocate_static_tls): Likewise.
	* sysdeps/generic/dl-cache.h (_dl_cache_libcmp): Likewise.
	* sysdeps/generic/ldsodefs.h (_dl_name_match_p): Likewise.
	(_dl_higher_prime_number): Likewise.
	(_dl_debug_printf_c): Likewise.
	(_dl_signal_cerror): Likewise.
	(_dl_receive_error): Likewise.
	(_dl_reloc_bad_type): Likewise.
	(_dl_resolve_conflicts): Likewise.
	(_dl_check_all_versions): Likewise.
	(_dl_check_map_versions): Likewise.
	(_dl_sort_fini): Likewise.
	(_dl_debug_initialize): Likewise.
	(_dl_init_paths): Likewise.
	(_dl_show_auxv): Likewise.
	(_dl_next_ld_env_entry): Likewise.
	(_dl_important_hwcaps): Likewise.
	(_dl_load_cache_lookup): Likewise.
	(_dl_update_slotinfo): Likewise.
	(_dl_show_scope): Likewise.
This commit is contained in:
H.J. Lu
2015-10-15 14:04:00 -07:00
parent b8b21bde18
commit 58c9ff1bdb
5 changed files with 50 additions and 21 deletions

View File

@ -1,6 +1,28 @@
2015-10-15 H.J. Lu <hongjiu.lu@intel.com> 2015-10-15 H.J. Lu <hongjiu.lu@intel.com>
[BZ #19122] [BZ #19122]
* elf/dl-runtime.c (_dl_fixup): Add attribute_hidden.
* elf/dynamic-link.h (_dl_try_allocate_static_tls): Likewise.
* sysdeps/generic/dl-cache.h (_dl_cache_libcmp): Likewise.
* sysdeps/generic/ldsodefs.h (_dl_name_match_p): Likewise.
(_dl_higher_prime_number): Likewise.
(_dl_debug_printf_c): Likewise.
(_dl_signal_cerror): Likewise.
(_dl_receive_error): Likewise.
(_dl_reloc_bad_type): Likewise.
(_dl_resolve_conflicts): Likewise.
(_dl_check_all_versions): Likewise.
(_dl_check_map_versions): Likewise.
(_dl_sort_fini): Likewise.
(_dl_debug_initialize): Likewise.
(_dl_init_paths): Likewise.
(_dl_show_auxv): Likewise.
(_dl_next_ld_env_entry): Likewise.
(_dl_important_hwcaps): Likewise.
(_dl_load_cache_lookup): Likewise.
(_dl_update_slotinfo): Likewise.
(_dl_show_scope): Likewise.
* sysdeps/generic/memcopy.h (_wordcopy_fwd_aligned): Add * sysdeps/generic/memcopy.h (_wordcopy_fwd_aligned): Add
attribute_hidden. attribute_hidden.
(_wordcopy_fwd_dest_aligned): Likewise. (_wordcopy_fwd_dest_aligned): Likewise.

View File

@ -57,7 +57,7 @@
function. */ function. */
DL_FIXUP_VALUE_TYPE DL_FIXUP_VALUE_TYPE
__attribute ((noinline)) ARCH_FIXUP_ATTRIBUTE attribute_hidden __attribute ((noinline)) ARCH_FIXUP_ATTRIBUTE
_dl_fixup ( _dl_fixup (
# ifdef ELF_MACHINE_RUNTIME_FIXUP_ARGS # ifdef ELF_MACHINE_RUNTIME_FIXUP_ARGS
ELF_MACHINE_RUNTIME_FIXUP_ARGS, ELF_MACHINE_RUNTIME_FIXUP_ARGS,

View File

@ -42,7 +42,8 @@
&& (__builtin_expect ((sym_map)->l_tls_offset != NO_TLS_OFFSET, 1) \ && (__builtin_expect ((sym_map)->l_tls_offset != NO_TLS_OFFSET, 1) \
|| _dl_try_allocate_static_tls (sym_map) == 0)) || _dl_try_allocate_static_tls (sym_map) == 0))
int internal_function _dl_try_allocate_static_tls (struct link_map *map); int internal_function attribute_hidden
_dl_try_allocate_static_tls (struct link_map *map);
#include <elf.h> #include <elf.h>

View File

@ -101,4 +101,4 @@ struct cache_file_new
& (~(__alignof__ (struct cache_file_new) - 1))) & (~(__alignof__ (struct cache_file_new) - 1)))
extern int _dl_cache_libcmp (const char *p1, const char *p2) extern int _dl_cache_libcmp (const char *p1, const char *p2)
internal_function; internal_function attribute_hidden;

View File

@ -235,11 +235,11 @@ struct audit_ifaces
/* Test whether given NAME matches any of the names of the given object. */ /* Test whether given NAME matches any of the names of the given object. */
extern int _dl_name_match_p (const char *__name, const struct link_map *__map) extern int _dl_name_match_p (const char *__name, const struct link_map *__map)
internal_function; internal_function attribute_hidden;
/* Compute next higher prime number. */ /* Compute next higher prime number. */
extern unsigned long int _dl_higher_prime_number (unsigned long int n) extern unsigned long int _dl_higher_prime_number (unsigned long int n)
internal_function; internal_function attribute_hidden;
/* Function used as argument for `_dl_receive_error' function. The /* Function used as argument for `_dl_receive_error' function. The
arguments are the error code, error string, and the objname the arguments are the error code, error string, and the objname the
@ -685,7 +685,7 @@ extern void _dl_debug_printf (const char *fmt, ...)
interpreted as for a `printf' call. All the lines buf the first interpreted as for a `printf' call. All the lines buf the first
start with a tag showing the PID. */ start with a tag showing the PID. */
extern void _dl_debug_printf_c (const char *fmt, ...) extern void _dl_debug_printf_c (const char *fmt, ...)
__attribute__ ((__format__ (__printf__, 1, 2))); __attribute__ ((__format__ (__printf__, 1, 2))) attribute_hidden;
/* Write a message on the specified descriptor FD. The parameters are /* Write a message on the specified descriptor FD. The parameters are
@ -728,7 +728,7 @@ extern void _dl_signal_error (int errcode, const char *object,
_dl_receive_error. */ _dl_receive_error. */
extern void _dl_signal_cerror (int errcode, const char *object, extern void _dl_signal_cerror (int errcode, const char *object,
const char *occation, const char *errstring) const char *occation, const char *errstring)
internal_function; internal_function attribute_hidden;
/* Call OPERATE, receiving errors from `dl_signal_cerror'. Unlike /* Call OPERATE, receiving errors from `dl_signal_cerror'. Unlike
`_dl_catch_error' the operation is resumed after the OPERATE `_dl_catch_error' the operation is resumed after the OPERATE
@ -736,7 +736,7 @@ extern void _dl_signal_cerror (int errcode, const char *object,
ARGS is passed as argument to OPERATE. */ ARGS is passed as argument to OPERATE. */
extern void _dl_receive_error (receiver_fct fct, void (*operate) (void *), extern void _dl_receive_error (receiver_fct fct, void (*operate) (void *),
void *args) void *args)
internal_function; internal_function attribute_hidden;
/* Open the shared object NAME and map in its segments. /* Open the shared object NAME and map in its segments.
@ -835,24 +835,25 @@ extern void _dl_protect_relro (struct link_map *map)
PLT is nonzero if this was a PLT reloc; it just affects the message. */ PLT is nonzero if this was a PLT reloc; it just affects the message. */
extern void _dl_reloc_bad_type (struct link_map *map, extern void _dl_reloc_bad_type (struct link_map *map,
unsigned int type, int plt) unsigned int type, int plt)
internal_function __attribute__ ((__noreturn__)); internal_function attribute_hidden __attribute__ ((__noreturn__));
/* Resolve conflicts if prelinking. */ /* Resolve conflicts if prelinking. */
extern void _dl_resolve_conflicts (struct link_map *l, extern void _dl_resolve_conflicts (struct link_map *l,
ElfW(Rela) *conflict, ElfW(Rela) *conflict,
ElfW(Rela) *conflictend); ElfW(Rela) *conflictend)
attribute_hidden;
/* Check the version dependencies of all objects available through /* Check the version dependencies of all objects available through
MAP. If VERBOSE print some more diagnostics. */ MAP. If VERBOSE print some more diagnostics. */
extern int _dl_check_all_versions (struct link_map *map, int verbose, extern int _dl_check_all_versions (struct link_map *map, int verbose,
int trace_mode) int trace_mode)
internal_function; internal_function attribute_hidden;
/* Check the version dependencies for MAP. If VERBOSE print some more /* Check the version dependencies for MAP. If VERBOSE print some more
diagnostics. */ diagnostics. */
extern int _dl_check_map_versions (struct link_map *map, int verbose, extern int _dl_check_map_versions (struct link_map *map, int verbose,
int trace_mode) int trace_mode)
internal_function; internal_function attribute_hidden;
/* Initialize the object in SCOPE by calling the constructors with /* Initialize the object in SCOPE by calling the constructors with
ARGC, ARGV, and ENV as the parameters. */ ARGC, ARGV, and ENV as the parameters. */
@ -866,7 +867,7 @@ extern void _dl_fini (void) internal_function;
/* Sort array MAPS according to dependencies of the contained objects. */ /* Sort array MAPS according to dependencies of the contained objects. */
extern void _dl_sort_fini (struct link_map **maps, size_t nmaps, char *used, extern void _dl_sort_fini (struct link_map **maps, size_t nmaps, char *used,
Lmid_t ns) Lmid_t ns)
internal_function; internal_function attribute_hidden;
/* The dynamic linker calls this function before and having changing /* The dynamic linker calls this function before and having changing
any shared object mappings. The `r_state' member of `struct r_debug' any shared object mappings. The `r_state' member of `struct r_debug'
@ -879,10 +880,11 @@ rtld_hidden_proto (_dl_debug_state)
argument is the run-time load address of the dynamic linker, to be put argument is the run-time load address of the dynamic linker, to be put
in the `r_ldbase' member. Returns the address of the structure. */ in the `r_ldbase' member. Returns the address of the structure. */
extern struct r_debug *_dl_debug_initialize (ElfW(Addr) ldbase, Lmid_t ns) extern struct r_debug *_dl_debug_initialize (ElfW(Addr) ldbase, Lmid_t ns)
internal_function; internal_function attribute_hidden;
/* Initialize the basic data structure for the search paths. */ /* Initialize the basic data structure for the search paths. */
extern void _dl_init_paths (const char *library_path) internal_function; extern void _dl_init_paths (const char *library_path)
internal_function attribute_hidden;
/* Gather the information needed to install the profiling tables and start /* Gather the information needed to install the profiling tables and start
the timers. */ the timers. */
@ -898,23 +900,25 @@ rtld_hidden_proto (_dl_mcount)
extern void _dl_mcount_wrapper (void *selfpc); extern void _dl_mcount_wrapper (void *selfpc);
/* Show the members of the auxiliary array passed up from the kernel. */ /* Show the members of the auxiliary array passed up from the kernel. */
extern void _dl_show_auxv (void) internal_function; extern void _dl_show_auxv (void)
internal_function attribute_hidden;
/* Return all environment variables starting with `LD_', one after the /* Return all environment variables starting with `LD_', one after the
other. */ other. */
extern char *_dl_next_ld_env_entry (char ***position) internal_function; extern char *_dl_next_ld_env_entry (char ***position)
internal_function attribute_hidden;
/* Return an array with the names of the important hardware capabilities. */ /* Return an array with the names of the important hardware capabilities. */
extern const struct r_strlenpair *_dl_important_hwcaps (const char *platform, extern const struct r_strlenpair *_dl_important_hwcaps (const char *platform,
size_t paltform_len, size_t paltform_len,
size_t *sz, size_t *sz,
size_t *max_capstrlen) size_t *max_capstrlen)
internal_function; internal_function attribute_hidden;
/* Look up NAME in ld.so.cache and return the file name stored there, /* Look up NAME in ld.so.cache and return the file name stored there,
or null if none is found. Caller must free returned string. */ or null if none is found. Caller must free returned string. */
extern char *_dl_load_cache_lookup (const char *name) extern char *_dl_load_cache_lookup (const char *name)
internal_function; internal_function attribute_hidden;
/* If the system does not support MAP_COPY we cannot leave the file open /* If the system does not support MAP_COPY we cannot leave the file open
all the time since this would create problems when the file is replaced. all the time since this would create problems when the file is replaced.
@ -1014,7 +1018,8 @@ extern void _dl_add_to_slotinfo (struct link_map *l) attribute_hidden;
/* Update slot information data for at least the generation of the /* Update slot information data for at least the generation of the
module with the given index. */ module with the given index. */
extern struct link_map *_dl_update_slotinfo (unsigned long int req_modid); extern struct link_map *_dl_update_slotinfo (unsigned long int req_modid)
attribute_hidden;
/* Look up the module's TLS block as for __tls_get_addr, /* Look up the module's TLS block as for __tls_get_addr,
but never touch anything. Return null if it's not allocated yet. */ but never touch anything. Return null if it's not allocated yet. */
@ -1024,7 +1029,8 @@ extern int _dl_addr_inside_object (struct link_map *l, const ElfW(Addr) addr)
internal_function attribute_hidden; internal_function attribute_hidden;
/* Show show of an object. */ /* Show show of an object. */
extern void _dl_show_scope (struct link_map *new, int from); extern void _dl_show_scope (struct link_map *new, int from)
attribute_hidden;
extern struct link_map *_dl_find_dso_for_object (const ElfW(Addr) addr) extern struct link_map *_dl_find_dso_for_object (const ElfW(Addr) addr)
internal_function; internal_function;