about summary refs log tree commit diff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2002-01-29 20:56:09 +0000
committerUlrich Drepper <drepper@redhat.com>2002-01-29 20:56:09 +0000
commite66d0a4c940c8643299de621a951f2dfa44d998b (patch)
tree6ac075401c543e6b12aec1058521ad134d5fc11b
parent9d7810d8c509258fe776a2b7f51aee1375d660af (diff)
downloadglibc-e66d0a4c940c8643299de621a951f2dfa44d998b.tar.gz
glibc-e66d0a4c940c8643299de621a951f2dfa44d998b.tar.xz
glibc-e66d0a4c940c8643299de621a951f2dfa44d998b.zip
Update.
2002-01-29  Ulrich Drepper  <drepper@redhat.com>

	* elf/rtld.c (_dl_start): Use __builtin_memset if available.
-rw-r--r--ChangeLog4
-rw-r--r--elf/rtld.c13
2 files changed, 13 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index ea804c3ea4..f95c953517 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2002-01-29  Ulrich Drepper  <drepper@redhat.com>
+
+	* elf/rtld.c (_dl_start): Use __builtin_memset if available.
+
 2002-01-29  Ben Collins  <bcollins@debian.org>
 
 	* string/bits/string2.h (__mempcpy): Protect size arg for
diff --git a/elf/rtld.c b/elf/rtld.c
index a05bbe9a62..b3698ad1b8 100644
--- a/elf/rtld.c
+++ b/elf/rtld.c
@@ -1,5 +1,5 @@
 /* Run time dynamic linker.
-   Copyright (C) 1995-1999, 2000, 2001 Free Software Foundation, Inc.
+   Copyright (C) 1995-1999, 2000, 2001, 2002 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
@@ -166,13 +166,18 @@ _dl_start (void *arg)
   if (HP_TIMING_INLINE && HP_TIMING_AVAIL)
     HP_TIMING_NOW (start_time);
 
-  /* Partly clean the `bootstrap_map' structure up.  Don't use `memset'
-     since it might not be built in or inlined and we cannot make function
-     calls at this point.  */
+  /* Partly clean the `bootstrap_map' structure up.  Don't use
+     `memset' since it might not be built in or inlined and we cannot
+     make function calls at this point.  Use '__builtin_memset' if we
+     know it is available.  */
+#if __GNUC_PREREQ (2, 96)
+  __builtin_memset (bootstrap_map.l_info, '\0', sizeof (bootstrap_map.l_info));
+#else
   for (cnt = 0;
        cnt < sizeof (bootstrap_map.l_info) / sizeof (bootstrap_map.l_info[0]);
        ++cnt)
     bootstrap_map.l_info[cnt] = 0;
+#endif
 
   /* Figure out the run-time load address of the dynamic linker itself.  */
   bootstrap_map.l_addr = elf_machine_load_address ();