summary refs log tree commit diff
path: root/elf
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2001-09-23 02:10:30 +0000
committerUlrich Drepper <drepper@redhat.com>2001-09-23 02:10:30 +0000
commit9d0881aa76b399e6a025c5cf44bebe2ae0efa8af (patch)
treebe1194cddcc8909fe82713a2341725453848689a /elf
parent9461da69cccd07de98e7a348537bae313df01b4d (diff)
downloadglibc-9d0881aa76b399e6a025c5cf44bebe2ae0efa8af.tar.gz
glibc-9d0881aa76b399e6a025c5cf44bebe2ae0efa8af.tar.xz
glibc-9d0881aa76b399e6a025c5cf44bebe2ae0efa8af.zip
Update.
2001-09-20  H.J. Lu  <hjl@gnu.org>

	* include/dlfcn.h (__RTLD_SPROF): New definiton.
	* elf/dl-open.c (dl_open_worker): Return immediately after loading
	for __RTLD_SPROF.
	* elf/sprof.c (main): Default to the filename if soname doesn't exist.
	(load_shobj): Call dlopen with `RTLD_LAZY | __RTLD_SPROF.

2001-09-20  H.J. Lu  <hjl@gnu.org>

	* elf/dl-profile.c (_dl_mcount): Use old *narcsp value for newarc,
	don't add 1.

2001-09-22  Ulrich Drepper  <drepper@redhat.com>

	* nss/getent.c: Accept -s parameter to overwrite rules in
	nsswitch.conf.  Patch by Nalin Dahyabhai <nalin@redhat.com>.

	* nss/nss_files/files-network.c (LINE_PARSER): Pad addr string
	with as many ".0" as necessary to form a complete address
	inet_network understands.

	* nss/getent.c: Various cleanups.  Use simpler and fewer function
	calls.

2001-09-20  Martin Schwidefsky  <schwidefsky@de.ibm.com>

	* sysdeps/s390/s390-32/bits/setjmp.h: Correct pointer comparison in
	_JMPBUF_UNWINDS.
	* sysdeps/s390/s390-64/bits/setjmp.h: Likewise.

2001-09-22  Ulrich Drepper  <drepper@redhat.com>

	* iconvdata/Makefile: Add rules to build and distribute IBM1160 and
	IBM1161.
	* iconvdata/gconv-modules: Add entries for IBM1160 and IBM1161.
	* iconvdata/ibm1160.c: New file.
	* iconvdata/ibm1160.h: New file.
	* iconvdata/ibm1161.c: New file.
	* iconvdata/ibm1161.h: New file.

2001-09-19  Jakub Jelinek  <jakub@redhat.com>

	* sysdeps/alpha/dl-machine.h (elf_machine_load_address): Compute the
	difference between base address and first PT_LOAD's virtual address,
	not the base address.

2001-09-11  Tom Rix  <trix@redhat.com>

	* sysdeps/unix/sysv/aix/init-first.c (init):  Use USE_NONONPTION_FLAG
	ifdef for __getopt_clean_environment.
	* sysdeps/unix/sysv/aix/libc-start.c: Add real implementation.

	* sysdeps/unix/sysv/linux/x86_64/Dist: New file.
	* sysdeps/x86_64/Dist: New file.
	* sysdeps/x86_64/soft-fp/Dist: New file.
Diffstat (limited to 'elf')
-rw-r--r--elf/dl-open.c4
-rw-r--r--elf/dl-profile.c2
-rw-r--r--elf/sprof.c22
3 files changed, 13 insertions, 15 deletions
diff --git a/elf/dl-open.c b/elf/dl-open.c
index d10ab8ac65..6d07e445d9 100644
--- a/elf/dl-open.c
+++ b/elf/dl-open.c
@@ -225,6 +225,10 @@ dl_open_worker (void *a)
       return;
     }
 
+  if (__builtin_expect (mode & __RTLD_SPROF, 0))
+    /* This happens only if we load a DSO for 'sprof'.  */
+    return;
+
   /* It was already open.  */
   if (new->l_searchlist.r_list != NULL)
     {
diff --git a/elf/dl-profile.c b/elf/dl-profile.c
index a29347a369..3165517914 100644
--- a/elf/dl-profile.c
+++ b/elf/dl-profile.c
@@ -507,7 +507,7 @@ _dl_mcount (ElfW(Addr) frompc, ElfW(Addr) selfpc)
 	  /* If we still have no entry stop searching and insert.  */
 	  if (*topcindex == 0)
 	    {
-	      uint_fast32_t newarc = 1 + exchange_and_add (narcsp, 1);
+	      uint_fast32_t newarc = exchange_and_add (narcsp, 1);
 
 	      /* In rare cases it could happen that all entries in FROMS are
 		 occupied.  So we cannot count this anymore.  */
diff --git a/elf/sprof.c b/elf/sprof.c
index 37472ab516..ea334f3472 100644
--- a/elf/sprof.c
+++ b/elf/sprof.c
@@ -264,19 +264,13 @@ main (int argc, char *argv[])
   if (profdata == NULL)
     {
       char *newp;
+      const char *soname;
+      size_t soname_len;
 
-      if (shobj_handle->soname == NULL)
-	{
-	  unload_shobj (shobj_handle);
-
-	  error (EXIT_FAILURE, 0, _("\
-no filename for profiling data given and shared object `%s' has no soname"),
-		 shobj);
-	}
-
-      newp = (char *) alloca (strlen (shobj_handle->soname)
-			      + sizeof ".profile");
-      stpcpy (stpcpy (newp, shobj_handle->soname), ".profile");
+      soname = shobj_handle->soname ?: basename (shobj);
+      soname_len = strlen (soname);
+      newp = (char *) alloca (soname_len + sizeof ".profile");
+      stpcpy (mempcpy (newp, soname, soname_len), ".profile");
       profdata = newp;
     }
 
@@ -394,11 +388,11 @@ load_shobj (const char *name)
       char *load_name = (char *) alloca (strlen (name) + 3);
       stpcpy (stpcpy (load_name, "./"), name);
 
-      map = (struct link_map *) dlopen (load_name, RTLD_LAZY);
+      map = (struct link_map *) dlopen (load_name, RTLD_LAZY | __RTLD_SPROF);
     }
   if (map == NULL)
     {
-      map = (struct link_map *) dlopen (name, RTLD_LAZY);
+      map = (struct link_map *) dlopen (name, RTLD_LAZY | __RTLD_SPROF);
       if (map == NULL)
 	{
 	  error (0, errno, _("failed to load shared object `%s'"), name);