Browse Source

Remove usage of _dl_parse_copy_information() from generic code.
Remove definition of _dl_parse_copy_information() for powerpc.
Remaining archs can do the same.
Make debugging output of "relocation processing: xxx" a bit more sane.

Joakim Tjernlund 20 years ago
parent
commit
c8473092e0
5 changed files with 8 additions and 33 deletions
  1. 0 2
      ldso/include/dl-elf.h
  2. 4 5
      ldso/include/dl-hash.h
  3. 2 15
      ldso/ldso/dl-elf.c
  4. 2 2
      ldso/ldso/ldso.c
  5. 0 9
      ldso/ldso/powerpc/elfinterp.c

+ 0 - 2
ldso/include/dl-elf.h

@@ -20,8 +20,6 @@ static inline void _dl_unmap_cache(void) { }
 
 
 /* Function prototypes for non-static stuff in readelflib1.c */
-extern int _dl_parse_copy_information(struct dyn_elf *rpnt,
-	unsigned long rel_addr, unsigned long rel_size);
 extern void _dl_parse_lazy_relocation_information(struct dyn_elf *rpnt,
 	unsigned long rel_addr, unsigned long rel_size);
 extern int _dl_parse_relocation_information(struct dyn_elf *rpnt,

+ 4 - 5
ldso/include/dl-hash.h

@@ -61,11 +61,10 @@ struct elf_resolve{
 #endif
 };
 
-#define COPY_RELOCS_DONE    1
-#define RELOCS_DONE         2
-#define JMP_RELOCS_DONE     4
-#define INIT_FUNCS_CALLED   8
-#define FINI_FUNCS_CALLED   16
+#define RELOCS_DONE         1
+#define JMP_RELOCS_DONE     2
+#define INIT_FUNCS_CALLED   4
+#define FINI_FUNCS_CALLED   8
 
 extern struct dyn_elf     * _dl_symbol_tables;
 extern struct elf_resolve * _dl_loaded_modules;

+ 2 - 15
ldso/ldso/dl-elf.c

@@ -741,7 +741,8 @@ int _dl_fixup(struct dyn_elf *rpnt, int now_flag)
 	tpnt = rpnt->dyn;
 
 #if defined (__SUPPORT_LD_DEBUG__)
-	if(_dl_debug) _dl_dprintf(_dl_debug_file,"\nrelocation processing: %s", tpnt->libname);
+	if(_dl_debug && !(tpnt->init_flag & RELOCS_DONE)) 
+		_dl_dprintf(_dl_debug_file,"\nrelocation processing: %s\n", tpnt->libname);
 #endif
 
 	if (unlikely(tpnt->dynamic_info[UNSUPPORTED_RELOC_TYPE])) {
@@ -784,20 +785,6 @@ int _dl_fixup(struct dyn_elf *rpnt, int now_flag)
 		}
 	}
 
-	if (tpnt->init_flag & COPY_RELOCS_DONE)
-		return goof;
-	tpnt->init_flag |= COPY_RELOCS_DONE;
-	goof += _dl_parse_copy_information(rpnt,
-			tpnt->dynamic_info[DT_RELOC_TABLE_ADDR],
-			tpnt->dynamic_info[DT_RELOC_TABLE_SIZE]);
-
-#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;
 }
 

+ 2 - 2
ldso/ldso/ldso.c

@@ -759,14 +759,14 @@ next_lib2:
 		tpnt->rtld_flags = RTLD_NOW | RTLD_GLOBAL; /* Must not be LAZY */
 #ifdef RERELOCATE_LDSO
 		/* Only rerelocate functions for now. */
-		tpnt->init_flag = RELOCS_DONE | COPY_RELOCS_DONE;
+		tpnt->init_flag = RELOCS_DONE;
 		lpnt = (unsigned long *) (tpnt->dynamic_info[DT_PLTGOT] + load_addr);
 # ifdef ALLOW_ZERO_PLTGOT
 		if (tpnt->dynamic_info[DT_PLTGOT])
 # endif
 			INIT_GOT(lpnt, tpnt);
 #else
-		tpnt->init_flag = RELOCS_DONE | JMP_RELOCS_DONE | COPY_RELOCS_DONE;
+		tpnt->init_flag = RELOCS_DONE | JMP_RELOCS_DONE;
 #endif
 		tpnt = NULL;
 	}

+ 0 - 9
ldso/ldso/powerpc/elfinterp.c

@@ -477,12 +477,3 @@ int _dl_parse_relocation_information(struct dyn_elf *rpnt,
 {
 	return _dl_parse(rpnt->dyn, rpnt->dyn->symbol_scope, rel_addr, rel_size, _dl_do_reloc);
 }
-
-/* Should be a static inline instead, but that conflicts with ld_elf.h */
-int _dl_parse_copy_information(struct dyn_elf *rpnt,
-	unsigned long rel_addr, unsigned long rel_size)
-{
-	/* Not used! */
-	return 0;
-}
-