aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/generic
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2002-03-01 09:44:29 +0000
committerUlrich Drepper <drepper@redhat.com>2002-03-01 09:44:29 +0000
commite6caf4e12ebb89254977a74b882757e371c5cc16 (patch)
tree294c7931b89d526659023e762272b36ad53744a3 /sysdeps/generic
parent90a77d0a958c5822ad8a2f479c466a6f4d093e74 (diff)
downloadglibc-e6caf4e12ebb89254977a74b882757e371c5cc16.tar
glibc-e6caf4e12ebb89254977a74b882757e371c5cc16.tar.gz
glibc-e6caf4e12ebb89254977a74b882757e371c5cc16.tar.bz2
glibc-e6caf4e12ebb89254977a74b882757e371c5cc16.zip
Update.
2002-03-01 Ulrich Drepper <drepper@redhat.com> * elf/Makefile (dl-routines): Add dl-origin. (elide-routines.os): Add dl-origin. * elf/Versions [ld] (GLIBC_PRIVATE): Add _dl_get_origin. * elf/dl-debug.c (_dl_debug_initialize): Add missing INTUSE around _dl_debug_state. * include/libc-symbols.c: Define attribute_hidden depending on HAVE_VISIBILITY_ATTRIBUTE. Add definition of INTVARDEF. * elf/dl-deps.c: Use INTUSE with __libc_enable_secure. * elf/dl-load.c: Likewise. * elf/rtld.c: Likewise. * include/unistd.h: Declare __libc_enable_secure_internal. * sysdeps/generic/dl-sysdep.c: Use INTVARDEF with __libc_enable_secure. Use INTUSE with __libc_enable_secure. * sysdeps/mach/hurd/dl-sysdep.c: Likewise. * elf/dl-deps.c: Use INTUSE with _dl_out_of_memory. * elf/dl-error.c: Likewise, * sysdeps/generic/ldsodefs.h: Declare _dl_out_of_memory_internal. * elf/dl-dst.h [_RTLD_GLOBAL]: Define _dl_get_origin to use INTUSE. * sysdeps/generic/dl-origin.c: Undefine _dl_get_origin macro before function definition. Use INTDEF with _dl_get_origin. * sysdeps/unix/sysv/linux/dl-origin.c: Likewise. * elf/dl-init.c: Use INTUSE with _dl_starting_up. * elf/rtld.c: Likewise. Use INTVARDEF for _dl_starting_up. * elf/dl-profile.c: Use INTDEF for _dl_mcount. * elf/dl-runtime.c: Use INTUSE with _dl_mcount. * sysdeps/generic/ldsodefs.h: Declare _dl_mcount_internal. * elf/dl-conflict.c: Use rtld_progrname instead of _dl_argv[0]. * elf/dl-deps.c: Likewise. * elf/dl-error.c: Likewise. * elf/dl-fini.c: Likewise. * elf/dl-init.c: Likewise. * elf/dl-load.c: Likewise. * elf/dl-lookup.c: Likewise. * elf/dl-reloc.c: Likewise. * elf/dl-version.c: Likewise. * elf/do-lookup.h: Likewise. * sysdeps/arm/dl-machine.h: Likewise. * sysdeps/cris/dl-machine.h: Likewise. * sysdeps/hppa/dl-machine.h: Likewise. * sysdeps/i386/dl-machine.h: Likewise. * sysdeps/m68k/dl-machine.h: Likewise. * sysdeps/powerpc/dl-machine.h: Likewise. * sysdeps/s390/s390-32/dl-machine.h: Likewise. * sysdeps/s390/s390-64/dl-machine.h: Likewise. * sysdeps/sh/dl-machine.h: Likewise. * sysdeps/sparc/sparc-32/dl-machine.h: Likewise. * sysdeps/sparc/sparc-64/dl-machine.h: Likewise. * sysdeps/x86_64/dl-machine.h: Likewise. * elf/rtld.c: Use INTDEF for _dl_argv. Use rtld_progrname instead of _dl_argv[0]. Use INTUSE with _dl_argv. * sysdeps/generic/dl-sysdep.c: Use INTUSE with _dl_argv. * sysdeps/generic/ldsodefs.h: Define rtld_progname macro.
Diffstat (limited to 'sysdeps/generic')
-rw-r--r--sysdeps/generic/dl-origin.c2
-rw-r--r--sysdeps/generic/dl-sysdep.c9
-rw-r--r--sysdeps/generic/ldsodefs.h11
3 files changed, 18 insertions, 4 deletions
diff --git a/sysdeps/generic/dl-origin.c b/sysdeps/generic/dl-origin.c
index db990e6d36..b198f70d5d 100644
--- a/sysdeps/generic/dl-origin.c
+++ b/sysdeps/generic/dl-origin.c
@@ -26,6 +26,7 @@
#include <dl-dst.h>
+#undef _dl_get_origin
const char *
_dl_get_origin (void)
{
@@ -49,3 +50,4 @@ _dl_get_origin (void)
return result;
}
+INTDEF(_dl_get_origin)
diff --git a/sysdeps/generic/dl-sysdep.c b/sysdeps/generic/dl-sysdep.c
index 3385226de0..1975fe8a66 100644
--- a/sysdeps/generic/dl-sysdep.c
+++ b/sysdeps/generic/dl-sysdep.c
@@ -47,7 +47,8 @@ extern void __libc_check_standard_fds (void);
#ifdef NEED_DL_BASE_ADDR
ElfW(Addr) _dl_base_addr;
#endif
-int __libc_enable_secure;
+int __libc_enable_secure = 0;
+INTVARDEF(__libc_enable_secure)
int __libc_multiple_libcs = 0; /* Defining this here avoids the inclusion
of init-first. */
/* This variable contains the lowest stack address ever used. */
@@ -89,7 +90,7 @@ _dl_sysdep_start (void **start_argptr,
# define set_seen(tag) seen |= M ((tag)->a_type)
#endif
- DL_FIND_ARG_COMPONENTS (start_argptr, _dl_argc, _dl_argv, _environ,
+ DL_FIND_ARG_COMPONENTS (start_argptr, _dl_argc, INTUSE(_dl_argv), _environ,
_dl_auxv);
user_entry = (ElfW(Addr)) ENTRY_POINT;
@@ -156,7 +157,7 @@ _dl_sysdep_start (void **start_argptr,
SEE (EGID, egid);
#endif
- __libc_enable_secure = uid != euid || gid != egid;
+ INTUSE(__libc_enable_secure) = uid != euid || gid != egid;
#ifndef HAVE_AUX_PAGESIZE
if (GL(dl_pagesize) == 0)
@@ -186,7 +187,7 @@ _dl_sysdep_start (void **start_argptr,
/* If this is a SUID program we make sure that FDs 0, 1, and 2 are
allocated. If necessary we are doing it ourself. If it is not
possible we stop the program. */
- if (__builtin_expect (__libc_enable_secure, 0))
+ if (__builtin_expect (INTUSE(__libc_enable_secure), 0))
__libc_check_standard_fds ();
(*dl_main) (phdr, phnum, &user_entry);
diff --git a/sysdeps/generic/ldsodefs.h b/sysdeps/generic/ldsodefs.h
index 08f5829895..4aa5621c19 100644
--- a/sysdeps/generic/ldsodefs.h
+++ b/sysdeps/generic/ldsodefs.h
@@ -394,9 +394,19 @@ extern struct rtld_global _rtld_local __rtld_local_attribute__;
/* Parameters passed to the dynamic linker. */
extern int _dl_argc;
extern char **_dl_argv;
+#ifdef _RTLD_LOCAL
+extern char **_dl_argv_internal attribute_hidden;
+# define rtld_progname (INTUSE(_dl_argv)[0])
+#else
+# define rtld_progname _dl_argv[0]
+#endif
/* The array with message we print as a last resort. */
extern const char _dl_out_of_memory[];
+#ifdef _RTLD_LOCAL
+/* XXX #ifdef should go away. */
+extern const char _dl_out_of_memory_internal[] attribute_hidden;
+#endif
/* OS-dependent function to open the zero-fill device. */
@@ -645,6 +655,7 @@ extern void _dl_start_profile_internal (struct link_map *map,
/* The actual functions used to keep book on the calls. */
extern void _dl_mcount (ElfW(Addr) frompc, ElfW(Addr) selfpc);
+extern void _dl_mcount_internal (ElfW(Addr) frompc, ElfW(Addr) selfpc);
/* This function is simply a wrapper around the _dl_mcount function
which does not require a FROMPC parameter since this is the