[uClibc-cvs] uClibc/ldso/libdl dlib.c,1.22,1.23

Erik Andersen andersen at codepoet.org
Fri Jan 3 19:55:51 UTC 2003


Update of /var/cvs/uClibc/ldso/libdl
In directory winder:/tmp/cvs-serv17222

Modified Files:
	dlib.c 
Log Message:
If they call dlopen with anything other than RTLD_LAZY 
or RTLD_NOW then we need to error out.


Index: dlib.c
===================================================================
RCS file: /var/cvs/uClibc/ldso/libdl/dlib.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- dlib.c	12 Dec 2002 22:22:03 -0000	1.22
+++ dlib.c	3 Jan 2003 19:55:47 -0000	1.23
@@ -132,6 +132,12 @@
 	int (*dl_elf_init) (void);
 #endif
 
+	/* A bit of sanity checking... */
+	if (!(flag & RTLD_LAZY|RTLD_NOW)) {
+		_dl_error_number = LD_BAD_HANDLE;
+		return NULL;
+	}
+
 	from = __builtin_return_address(0);
 
 	/* Have the dynamic linker use the regular malloc function now */
@@ -320,14 +326,15 @@
 			return goof;
 		tpnt->init_flag |= JMP_RELOCS_DONE;
 
-		if (flag == RTLD_LAZY)
+		if (flag == RTLD_LAZY) {
 			_dl_parse_lazy_relocation_information(tpnt, 
 				tpnt->dynamic_info[DT_JMPREL], 
 				tpnt->dynamic_info[DT_PLTRELSZ], 0);
-		else
+		} else {
 			goof += _dl_parse_relocation_information(tpnt, 
 				tpnt->dynamic_info[DT_JMPREL], 
 				tpnt->dynamic_info[DT_PLTRELSZ], 0);
+		}
 	};
 	return goof;
 }




More information about the uClibc-cvs mailing list