mirror of
git://sourceware.org/git/glibc.git
synced 2024-12-09 04:11:27 +08:00
ec935dea63
This function is defined in libc.so, and the dynamic loader calls right after relocation has been finished, before any ELF constructors or the preinit function is invoked. It is also used in the static build for initializing parts of the static libc. To locate __libc_early_init, a direct symbol lookup function is used, _dl_lookup_direct. It does not search the entire symbol scope and consults merely a single link map. This function could also be used to implement lookups in the vDSO (as an optimization). A per-namespace variable (libc_map) is added for locating libc.so, to avoid repeated traversals of the search scope. It is similar to GL(dl_initfirst). An alternative would have been to thread a context argument from _dl_open down to _dl_map_object_from_fd (where libc.so is identified). This could have avoided the global variable, but the change would be larger as a result. It would not have been possible to use this to replace GL(dl_initfirst) because that global variable is used to pass the function pointer past the stack switch from dl_main to the main program. Replacing that requires adding a new argument to _dl_init, which in turn needs changes to the architecture-specific libc.so startup code written in assembler. __libc_early_init should not be used to replace _dl_var_init (as it exists today on some architectures). Instead, _dl_lookup_direct should be used to look up a new variable symbol in libc.so, and that should then be initialized from the dynamic loader, immediately after the object has been loaded in _dl_map_object_from_fd (before relocation is run). This way, more IFUNC resolvers which depend on these variables will work. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
81 lines
2.0 KiB
Plaintext
81 lines
2.0 KiB
Plaintext
libc {
|
|
GLIBC_2.0 {
|
|
%ifdef EXPORT_UNWIND_FIND_FDE
|
|
__deregister_frame_info; __register_frame_info;
|
|
%endif
|
|
}
|
|
GLIBC_2.1 {
|
|
# functions used in other libraries
|
|
_dl_mcount_wrapper; _dl_mcount_wrapper_check;
|
|
}
|
|
GLIBC_2.2.4 {
|
|
dl_iterate_phdr;
|
|
}
|
|
%ifdef EXPORT_UNWIND_FIND_FDE
|
|
# Needed for SHLIB_COMPAT calls using this version.
|
|
GLIBC_2.2.5 {
|
|
}
|
|
GCC_3.0 {
|
|
__deregister_frame_info_bases; __register_frame_info_bases;
|
|
__register_frame_info_table_bases; _Unwind_Find_FDE;
|
|
}
|
|
%endif
|
|
GLIBC_PRIVATE {
|
|
# functions used in other libraries
|
|
_dl_addr;
|
|
_dl_open_hook; _dl_open_hook2;
|
|
_dl_sym; _dl_vsym;
|
|
__libc_dlclose; __libc_dlopen_mode; __libc_dlsym; __libc_dlvsym;
|
|
__libc_early_init;
|
|
|
|
# Internal error handling support. Interposes the functions in ld.so.
|
|
_dl_signal_exception; _dl_catch_exception;
|
|
_dl_signal_error; _dl_catch_error;
|
|
}
|
|
}
|
|
|
|
ld {
|
|
GLIBC_2.0 {
|
|
_r_debug;
|
|
}
|
|
GLIBC_2.1 {
|
|
# functions used in other libraries
|
|
_dl_mcount;
|
|
# historically used by Garbage Collectors
|
|
__libc_stack_end;
|
|
}
|
|
GLIBC_2.3 {
|
|
# runtime interface to TLS
|
|
__tls_get_addr;
|
|
}
|
|
GLIBC_2.4 {
|
|
# stack canary
|
|
__stack_chk_guard;
|
|
}
|
|
GLIBC_PRIVATE {
|
|
# Those are in the dynamic linker, but used by libc.so.
|
|
__libc_enable_secure;
|
|
_dl_allocate_tls; _dl_allocate_tls_init;
|
|
_dl_argv; _dl_find_dso_for_object; _dl_get_tls_static_info;
|
|
_dl_deallocate_tls; _dl_make_stack_executable;
|
|
_dl_rtld_di_serinfo; _dl_starting_up;
|
|
_rtld_global; _rtld_global_ro;
|
|
|
|
# Only here for gdb while a better method is developed.
|
|
_dl_debug_state;
|
|
|
|
# Pointer protection.
|
|
__pointer_chk_guard;
|
|
|
|
# Internal error handling support.
|
|
_dl_exception_create; _dl_exception_create_format; _dl_exception_free;
|
|
|
|
# Internal error handling support. Interposed by libc.so.
|
|
_dl_signal_exception; _dl_catch_exception;
|
|
_dl_signal_error; _dl_catch_error;
|
|
|
|
# Set value of a tunable.
|
|
__tunable_get_val;
|
|
}
|
|
}
|