about summary refs log tree commit diff
path: root/elf
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-09-08 05:49:02 +0000
committerUlrich Drepper <drepper@redhat.com>2000-09-08 05:49:02 +0000
commit48da10925964e02aa3dd4f7d7373984e3ccd250e (patch)
treee99c8ea52524113feb1b2856089c76fd4ca07a8a /elf
parent63e18f77e2e1cfadfd7d6daa0c2c6583c7c7d7d9 (diff)
downloadglibc-48da10925964e02aa3dd4f7d7373984e3ccd250e.tar.gz
glibc-48da10925964e02aa3dd4f7d7373984e3ccd250e.tar.xz
glibc-48da10925964e02aa3dd4f7d7373984e3ccd250e.zip
Update.
	* elf/dl-load.c (lose): Decrement _nl_loaded.
	(_dl_map_object_from_fd): Don't try to dlopen executables.
Diffstat (limited to 'elf')
-rw-r--r--elf/dl-load.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/elf/dl-load.c b/elf/dl-load.c
index 4fd4dfbe2e..2911e0778d 100644
--- a/elf/dl-load.c
+++ b/elf/dl-load.c
@@ -709,6 +709,7 @@ lose (int code, int fd, const char *name, char *realname, struct link_map *l,
 	l->l_prev->l_next = l->l_next;
       if (l->l_next)
 	l->l_next->l_prev = l->l_prev;
+      --_dl_nloaded;
       free (l);
     }
   free (realname);
@@ -997,6 +998,13 @@ _dl_map_object_from_fd (const char *name, int fd, char *realname,
       }
     else
       {
+	/* This object is loaded at a fixed address.  This must never
+           happen for objects loaded with dlopen().  */
+	if (mode & __RTLD_DLOPEN)
+	  {
+	    LOSE (0, N_("cannot dynamically load executable"));
+	  }
+
 	/* Notify ELF_PREFERRED_ADDRESS that we have to load this one
 	   fixed.  */
 	ELF_FIXED_ADDRESS (loader, c->mapstart);