diff options
Diffstat (limited to 'elf/dl-support.c')
-rw-r--r-- | elf/dl-support.c | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/elf/dl-support.c b/elf/dl-support.c index c30194c7b7..b5f10d5aa5 100644 --- a/elf/dl-support.c +++ b/elf/dl-support.c @@ -1,5 +1,5 @@ /* Support for dynamic linking code in static libc. - Copyright (C) 1996-2016 Free Software Foundation, Inc. + Copyright (C) 1996-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -126,6 +126,7 @@ int _dl_starting_up = 1; void *_dl_random; /* Get architecture specific initializer. */ +#include <dl-procruntime.c> #include <dl-procinfo.c> /* Initial value of the CPU clock. */ @@ -164,6 +165,7 @@ uint64_t _dl_hwcap2 __attribute__ ((nocommon)); /* The value of the FPU control word the kernel will preset in hardware. */ fpu_control_t _dl_fpu_control = _FPU_DEFAULT; +#if !HAVE_TUNABLES /* This is not initialized to HWCAP_IMPORTANT, matching the definition of _dl_important_hwcaps, below, where no hwcap strings are ever used. This mask is still used to mediate the lookups in the cache @@ -171,6 +173,7 @@ fpu_control_t _dl_fpu_control = _FPU_DEFAULT; LD_HWCAP_MASK environment variable here), there is no real point in setting _dl_hwcap nonzero below, but we do anyway. */ uint64_t _dl_hwcap_mask __attribute__ ((nocommon)); +#endif /* Prevailing state of the stack. Generally this includes PF_X, indicating it's * executable but this isn't true for all platforms. */ @@ -179,13 +182,15 @@ ElfW(Word) _dl_stack_flags = DEFAULT_STACK_PERMS; /* If loading a shared object requires that we make the stack executable when it was not, we do it by calling this function. It returns an errno code or zero on success. */ -int (*_dl_make_stack_executable_hook) (void **) internal_function - = _dl_make_stack_executable; +int (*_dl_make_stack_executable_hook) (void **) = _dl_make_stack_executable; /* Function in libpthread to wait for termination of lookups. */ void (*_dl_wait_lookup_done) (void); +#if !THREAD_GSCOPE_IN_TCB +int _dl_thread_gscope_count; +#endif struct dl_scope_free_list *_dl_scope_free_list; #ifdef NEED_DL_SYSINFO @@ -220,7 +225,6 @@ __rtld_lock_define_initialized_recursive (, _dl_load_write_lock) int _dl_clktck; void -internal_function _dl_aux_init (ElfW(auxv_t) *av) { int seen = 0; @@ -304,7 +308,6 @@ _dl_aux_init (ElfW(auxv_t) *av) void -internal_function _dl_non_dynamic_init (void) { _dl_main_map.l_origin = _dl_get_origin (); @@ -354,8 +357,10 @@ _dl_non_dynamic_init (void) cp = (const char *) __rawmemchr (cp, '\0') + 1; } +#if !HAVE_TUNABLES if (__access ("/etc/suid-debug", F_OK) != 0) __unsetenv ("MALLOC_CHECK_"); +#endif } #ifdef DL_PLATFORM_INIT @@ -383,3 +388,14 @@ _dl_non_dynamic_init (void) #ifdef DL_SYSINFO_IMPLEMENTATION DL_SYSINFO_IMPLEMENTATION #endif + +#if ENABLE_STATIC_PIE +/* Since relocation to hidden _dl_main_map causes relocation overflow on + aarch64, a function is used to get the address of _dl_main_map. */ + +struct link_map * +_dl_get_dl_main_map (void) +{ + return &_dl_main_map; +} +#endif |