[uClibc-cvs] CVS uClibc/ldso/ldso/mips

CVS User jocke jocke at codepoet.org
Wed Nov 17 09:36:40 UTC 2004


Update of /var/cvs/uClibc/ldso/ldso/mips
In directory nail:/tmp/cvs-serv25254/ldso/mips

Modified Files:
	dl-sysdep.h elfinterp.c 
Log Message:
Add BIND NOW support to MIPS.

Mips did not honour the LD_BIND_NOW env. variable or the DT_BIND_NOW flag
in the dynamic section.


--- /var/cvs/uClibc/ldso/ldso/mips/dl-sysdep.h	2004/11/02 08:14:46	1.13
+++ /var/cvs/uClibc/ldso/ldso/mips/dl-sysdep.h	2004/11/17 09:36:39	1.14
@@ -59,7 +59,7 @@
 	unsigned long old_gpreg);
 
 struct elf_resolve;
-void _dl_perform_mips_global_got_relocations(struct elf_resolve *tpnt);
+void _dl_perform_mips_global_got_relocations(struct elf_resolve *tpnt, int lazy);
 
 #define do_rem(result, n, base) ((result) = (n) % (base))
 
--- /var/cvs/uClibc/ldso/ldso/mips/elfinterp.c	2004/11/10 15:27:18	1.24
+++ /var/cvs/uClibc/ldso/ldso/mips/elfinterp.c	2004/11/17 09:36:39	1.25
@@ -247,11 +247,11 @@
 }
 
 /* Relocate the global GOT entries for the object */
-void _dl_perform_mips_global_got_relocations(struct elf_resolve *tpnt)
+void _dl_perform_mips_global_got_relocations(struct elf_resolve *tpnt, int lazy)
 {
 	Elf32_Sym *sym;
 	char *strtab;
-	unsigned long i;
+	unsigned long i, tmp_lazy;
 	unsigned long *got_entry;
 
 	for (; tpnt ; tpnt = tpnt->next) {
@@ -273,11 +273,11 @@
 		if(_dl_debug_reloc)
 			_dl_dprintf(2, "_dl_perform_mips_global_got_relocations for '%s'\n", tpnt->libname);
 #endif
-
+		tmp_lazy = lazy && !tpnt->dynamic_info[DT_BIND_NOW];
 		/* Relocate the global GOT entries for the object */
 		while(i--) {
 			if (sym->st_shndx == SHN_UNDEF) {
-				if (ELF32_ST_TYPE(sym->st_info) == STT_FUNC && sym->st_value) {
+				if (ELF32_ST_TYPE(sym->st_info) == STT_FUNC && sym->st_value && tmp_lazy) {
 					*got_entry = sym->st_value + (unsigned long) tpnt->loadaddr;
 				}
 				else {
@@ -290,7 +290,7 @@
 					sym->st_name, tpnt->symbol_scope, tpnt, ELF_RTYPE_CLASS_PLT);
 			}
 			else if (ELF32_ST_TYPE(sym->st_info) == STT_FUNC &&
-				*got_entry != sym->st_value) {
+				*got_entry != sym->st_value && tmp_lazy) {
 				*got_entry += (unsigned long) tpnt->loadaddr;
 			}
 			else if (ELF32_ST_TYPE(sym->st_info) == STT_SECTION) {



More information about the uClibc-cvs mailing list