[uClibc-cvs] uClibc/ldso/ldso ldso.c, 1.74, 1.75 readelflib1.c, 1.51, 1.52

Erik Andersen andersen at uclibc.org
Fri Dec 5 20:24:30 UTC 2003


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

Modified Files:
	ldso.c readelflib1.c 
Log Message:
move _dl_fixup so staticly linked apps using dlopen have a 
chance of actually working


Index: readelflib1.c
===================================================================
RCS file: /var/cvs/uClibc/ldso/ldso/readelflib1.c,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -d -r1.51 -r1.52
--- readelflib1.c	3 Dec 2003 21:35:01 -0000	1.51
+++ readelflib1.c	5 Dec 2003 20:24:26 -0000	1.52
@@ -903,3 +903,69 @@
 	return retval;
 }
 
+int _dl_fixup(struct elf_resolve *tpnt, int flag)
+{
+	int goof = 0;
+
+	if (tpnt->next)
+		goof += _dl_fixup(tpnt->next, flag);
+#if defined (__SUPPORT_LD_DEBUG__)
+	if(_dl_debug) _dl_dprintf(_dl_debug_file,"\nrelocation processing: %s", tpnt->libname);	
+#endif    
+	
+	if (tpnt->dynamic_info[DT_REL]) {
+#ifdef ELF_USES_RELOCA
+#if defined (__SUPPORT_LD_DEBUG__)
+		if(_dl_debug) _dl_dprintf(2, "%s: can't handle REL relocation records\n", _dl_progname);
+#endif    
+		goof++;
+		return goof;
+#else
+		if (tpnt->init_flag & RELOCS_DONE)
+			return goof;
+		tpnt->init_flag |= RELOCS_DONE;
+		goof += _dl_parse_relocation_information(tpnt, 
+				tpnt->dynamic_info[DT_REL], 
+				tpnt->dynamic_info[DT_RELSZ], 0);
+#endif
+	}
+	if (tpnt->dynamic_info[DT_RELA]) {
+#ifndef ELF_USES_RELOCA
+#if defined (__SUPPORT_LD_DEBUG__)
+		if(_dl_debug) _dl_dprintf(2, "%s: can't handle RELA relocation records\n", _dl_progname);
+#endif    
+		goof++;
+		return goof;
+#else
+		if (tpnt->init_flag & RELOCS_DONE)
+			return goof;
+		tpnt->init_flag |= RELOCS_DONE;
+		goof += _dl_parse_relocation_information(tpnt, 
+				tpnt->dynamic_info[DT_RELA], 
+				tpnt->dynamic_info[DT_RELASZ], 0);
+#endif
+	}
+	if (tpnt->dynamic_info[DT_JMPREL]) {
+		if (tpnt->init_flag & JMP_RELOCS_DONE)
+			return goof;
+		tpnt->init_flag |= JMP_RELOCS_DONE;
+		if (flag & RTLD_LAZY) {
+			_dl_parse_lazy_relocation_information(tpnt, 
+					tpnt->dynamic_info[DT_JMPREL], 
+					tpnt->dynamic_info [DT_PLTRELSZ], 0);
+		} else {
+			goof += _dl_parse_relocation_information(tpnt, 
+					tpnt->dynamic_info[DT_JMPREL], 
+					tpnt->dynamic_info[DT_PLTRELSZ], 0);
+		}
+	}
+#if defined (__SUPPORT_LD_DEBUG__)
+	if(_dl_debug) {
+		_dl_dprintf(_dl_debug_file,"\nrelocation processing: %s", tpnt->libname);     
+		_dl_dprintf(_dl_debug_file,"; finished\n\n");
+	}
+#endif    
+	return goof;
+}
+
+

Index: ldso.c
===================================================================
RCS file: /var/cvs/uClibc/ldso/ldso/ldso.c,v
retrieving revision 1.74
retrieving revision 1.75
diff -u -d -r1.74 -r1.75
--- ldso.c	4 Oct 2003 17:31:22 -0000	1.74
+++ ldso.c	5 Dec 2003 20:24:26 -0000	1.75
@@ -1259,71 +1259,6 @@
 {
 }
 
-int _dl_fixup(struct elf_resolve *tpnt, int flag)
-{
-	int goof = 0;
-
-	if (tpnt->next)
-		goof += _dl_fixup(tpnt->next, flag);
-#if defined (__SUPPORT_LD_DEBUG__)
-	if(_dl_debug) _dl_dprintf(_dl_debug_file,"\nrelocation processing: %s", tpnt->libname);	
-#endif    
-	
-	if (tpnt->dynamic_info[DT_REL]) {
-#ifdef ELF_USES_RELOCA
-#if defined (__SUPPORT_LD_DEBUG__)
-		if(_dl_debug) _dl_dprintf(2, "%s: can't handle REL relocation records\n", _dl_progname);
-#endif    
-		goof++;
-		return goof;
-#else
-		if (tpnt->init_flag & RELOCS_DONE)
-			return goof;
-		tpnt->init_flag |= RELOCS_DONE;
-		goof += _dl_parse_relocation_information(tpnt, 
-				tpnt->dynamic_info[DT_REL], 
-				tpnt->dynamic_info[DT_RELSZ], 0);
-#endif
-	}
-	if (tpnt->dynamic_info[DT_RELA]) {
-#ifndef ELF_USES_RELOCA
-#if defined (__SUPPORT_LD_DEBUG__)
-		if(_dl_debug) _dl_dprintf(2, "%s: can't handle RELA relocation records\n", _dl_progname);
-#endif    
-		goof++;
-		return goof;
-#else
-		if (tpnt->init_flag & RELOCS_DONE)
-			return goof;
-		tpnt->init_flag |= RELOCS_DONE;
-		goof += _dl_parse_relocation_information(tpnt, 
-				tpnt->dynamic_info[DT_RELA], 
-				tpnt->dynamic_info[DT_RELASZ], 0);
-#endif
-	}
-	if (tpnt->dynamic_info[DT_JMPREL]) {
-		if (tpnt->init_flag & JMP_RELOCS_DONE)
-			return goof;
-		tpnt->init_flag |= JMP_RELOCS_DONE;
-		if (flag & RTLD_LAZY) {
-			_dl_parse_lazy_relocation_information(tpnt, 
-					tpnt->dynamic_info[DT_JMPREL], 
-					tpnt->dynamic_info [DT_PLTRELSZ], 0);
-		} else {
-			goof += _dl_parse_relocation_information(tpnt, 
-					tpnt->dynamic_info[DT_JMPREL], 
-					tpnt->dynamic_info[DT_PLTRELSZ], 0);
-		}
-	}
-#if defined (__SUPPORT_LD_DEBUG__)
-	if(_dl_debug) {
-		_dl_dprintf(_dl_debug_file,"\nrelocation processing: %s", tpnt->libname);     
-		_dl_dprintf(_dl_debug_file,"; finished\n\n");
-	}
-#endif    
-	return goof;
-}
-
 char *_dl_getenv(const char *symbol, char **envp)
 {
 	char *pnt;




More information about the uClibc-cvs mailing list