[uClibc-cvs] svn commit: branches/uClibc-nptl: include ldso ldso/include ldso/ldso lds etc...

sjhill at uclibc.org sjhill at uclibc.org
Wed Aug 10 02:29:12 UTC 2005


Author: sjhill
Date: 2005-08-09 20:29:10 -0600 (Tue, 09 Aug 2005)
New Revision: 11092

Log:
Merge with latest trunk.


Modified:
   branches/uClibc-nptl/TODO
   branches/uClibc-nptl/include/elf.h
   branches/uClibc-nptl/ldso/Makefile
   branches/uClibc-nptl/ldso/include/dl-string.h
   branches/uClibc-nptl/ldso/ldso/dl-startup.c
   branches/uClibc-nptl/ldso/ldso/sh/elfinterp.c
   branches/uClibc-nptl/utils/Makefile


Changeset:
Modified: branches/uClibc-nptl/TODO
===================================================================
--- branches/uClibc-nptl/TODO	2005-08-09 23:05:06 UTC (rev 11091)
+++ branches/uClibc-nptl/TODO	2005-08-10 02:29:10 UTC (rev 11092)
@@ -102,6 +102,9 @@
     ldso needs to have lazy bindings checked
     pthread isn't working really at all (pthreads tests)
 
+  cris rfv nios nios2 sh64:
+    need to be updated to new ldso changes and unification of the 
+     two uClibc_main funcs (__uClibc_start_main doesnt exist anymore)
 
 
 

Modified: branches/uClibc-nptl/include/elf.h
===================================================================
--- branches/uClibc-nptl/include/elf.h	2005-08-09 23:05:06 UTC (rev 11091)
+++ branches/uClibc-nptl/include/elf.h	2005-08-10 02:29:10 UTC (rev 11092)
@@ -1910,7 +1910,7 @@
 #define LITUSE_ALPHA_TLS_LDM	5
 
 /* Legal values for d_tag of Elf64_Dyn.  */
-#define DT_ALPHA_PLTRO		0x70000000
+#define DT_ALPHA_PLTRO		(DT_LOPROC + 0)
 #define DT_ALPHA_NUM		1
 
 /* PowerPC specific declarations */

Modified: branches/uClibc-nptl/ldso/Makefile
===================================================================
--- branches/uClibc-nptl/ldso/Makefile	2005-08-09 23:05:06 UTC (rev 11091)
+++ branches/uClibc-nptl/ldso/Makefile	2005-08-10 02:29:10 UTC (rev 11092)
@@ -1,6 +1,6 @@
 # Makefile for uClibc
 #
-# Copyright (C) 2000-2004 Erik Andersen <andersen at uclibc.org>
+# Copyright (C) 2000-2005 Erik Andersen <andersen at uclibc.org>
 #
 # This program is free software; you can redistribute it and/or modify it under
 # the terms of the GNU Library General Public License as published by the Free
@@ -35,21 +35,21 @@
 	echo "Skipping $@ target"
 endif
 
-HEADERS = $(patsubst %, include/%, elf.h dl-startup.h dl-syscalls.h dl-sysdep.h dl-debug.h)
-headers: $(HEADERS) include/dl-progname.h
+LN_HEADERS      := $(patsubst %, include/%, elf.h)
+LN_ARCH_HEADERS := $(patsubst %, include/%, dl-startup.h dl-syscalls.h dl-sysdep.h dl-debug.h)
+HEADERS         := $(LN_HEADERS) $(LN_ARCH_HEADERS) include/dl-progname.h
+headers: $(HEADERS)
+$(LN_HEADERS):
+	$(LN) -fs $(TOPDIR)../$@ $@
+$(LN_ARCH_HEADERS):
+	$(LN) -fs ../ldso/$(TARGET_ARCH)/$(patsubst include/%,%,$@) $@
 include/dl-progname.h:
-	echo "const char *_dl_progname=\""$(UCLIBC_LDSO)"\";" \
+	echo 'const char *_dl_progname="$(UCLIBC_LDSO)";' \
 		> include/dl-progname.h
-	echo "#include \"$(TARGET_ARCH)/elfinterp.c\"" \
+	echo '#include "$(TARGET_ARCH)/elfinterp.c"' \
 		>> include/dl-progname.h
-$(HEADERS):
-	$(LN) -fs $(TOPDIR)../include/elf.h include/
-	$(LN) -fs ../ldso/$(TARGET_ARCH)/dl-startup.h include/
-	$(LN) -fs ../ldso/$(TARGET_ARCH)/dl-syscalls.h include/
-	$(LN) -fs ../ldso/$(TARGET_ARCH)/dl-sysdep.h include/
-	$(LN) -fs ../ldso/$(TARGET_ARCH)/dl-debug.h include/
 
 clean:
 	set -e ; for d in $(DIRS) ; do $(MAKE) -C $$d $@ ; done
 	-find . -name '*~' | xargs $(RM)
-	$(RM) $(HEADERS) include/dl-progname.h
+	$(RM) $(HEADERS)

Modified: branches/uClibc-nptl/ldso/include/dl-string.h
===================================================================
--- branches/uClibc-nptl/ldso/include/dl-string.h	2005-08-09 23:05:06 UTC (rev 11091)
+++ branches/uClibc-nptl/ldso/include/dl-string.h	2005-08-10 02:29:10 UTC (rev 11092)
@@ -281,6 +281,7 @@
                      || defined(__sh__) ||  defined(__powerpc__)
 # define CONSTANT_STRING_GOT_FIXUP(X) \
 	if ((X) < (const char *) load_addr) (X) += load_addr
+# define NO_EARLY_SEND_STDERR
 #else
 # define CONSTANT_STRING_GOT_FIXUP(X)
 #endif

Modified: branches/uClibc-nptl/ldso/ldso/dl-startup.c
===================================================================
--- branches/uClibc-nptl/ldso/ldso/dl-startup.c	2005-08-09 23:05:06 UTC (rev 11091)
+++ branches/uClibc-nptl/ldso/ldso/dl-startup.c	2005-08-10 02:29:10 UTC (rev 11092)
@@ -136,12 +136,14 @@
 	aux_dat += argc;			/* Skip over the argv pointers */
 	aux_dat++;					/* Skip over NULL at end of argv */
 	envp = (char **) aux_dat;
+#ifndef NO_EARLY_SEND_STDERR
 	SEND_STDERR_DEBUG("argc=");
 	SEND_NUMBER_STDERR_DEBUG(argc, 0);
 	SEND_STDERR_DEBUG(" argv=");
 	SEND_ADDRESS_STDERR_DEBUG(argv, 0);
 	SEND_STDERR_DEBUG(" envp=");
 	SEND_ADDRESS_STDERR_DEBUG(envp, 1);
+#endif
 	while (*aux_dat)
 		aux_dat++;				/* Skip over the envp pointers */
 	aux_dat++;					/* Skip over NULL at end of envp */

Modified: branches/uClibc-nptl/ldso/ldso/sh/elfinterp.c
===================================================================
--- branches/uClibc-nptl/ldso/ldso/sh/elfinterp.c	2005-08-09 23:05:06 UTC (rev 11091)
+++ branches/uClibc-nptl/ldso/ldso/sh/elfinterp.c	2005-08-10 02:29:10 UTC (rev 11092)
@@ -61,21 +61,19 @@
 	symtab_index = ELF32_R_SYM(this_reloc->r_info);
 
 	symtab = (Elf32_Sym *)(intptr_t) tpnt->dynamic_info[DT_SYMTAB];
-	strtab = (char *) tpnt->dynamic_info[DT_STRTAB];
+	strtab = (char *)tpnt->dynamic_info[DT_STRTAB];
 	symname = strtab + symtab[symtab_index].st_name;
 
 	if (unlikely(reloc_type != R_SH_JMP_SLOT)) {
-	  _dl_dprintf(2, "%s: Incorrect relocation type in jump relocations\n",
-		       _dl_progname);
-	  _dl_exit(1);
+		_dl_dprintf(2, "%s: Incorrect relocation type in jump relocations\n",
+		            _dl_progname);
+		_dl_exit(1);
 	}
 
 	/* Address of jump instruction to fix up */
-	instr_addr = ((unsigned long) this_reloc->r_offset +
-			(unsigned long) tpnt->loadaddr);
+	instr_addr = (unsigned long) (this_reloc->r_offset + tpnt->loadaddr);
 	got_addr = (char **) instr_addr;
 
-
 	/* Get the address of the GOT entry */
 	new_addr = _dl_find_hash(symname, tpnt->symbol_scope, tpnt, ELF_RTYPE_CLASS_PLT);
 	if (unlikely(!new_addr)) {
@@ -84,18 +82,15 @@
 	}
 
 #if defined (__SUPPORT_LD_DEBUG__)
-	if ((unsigned long) got_addr < 0x20000000)
-	{
-		if (_dl_debug_bindings)
-		{
+	if ((unsigned long) got_addr < 0x20000000) {
+		if (_dl_debug_bindings) {
 			_dl_dprintf(_dl_debug_file, "\nresolve function: %s", symname);
 			if(_dl_debug_detail) _dl_dprintf(_dl_debug_file,
 					"\n\tpatched %x ==> %x @ %x\n", *got_addr, new_addr, got_addr);
 		}
 	}
-	if (!_dl_debug_nofixups) {
+	if (!_dl_debug_nofixups)
 		*got_addr = new_addr;
-	}
 #else
 	*got_addr = new_addr;
 #endif
@@ -123,25 +118,24 @@
 	symtab = (Elf32_Sym *)(intptr_t)tpnt->dynamic_info[DT_SYMTAB];
 	strtab = (char *)tpnt->dynamic_info[DT_STRTAB];
 
-	  for (i = 0; i < rel_size; i++, rpnt++) {
-	        int res;
+	for (i = 0; i < rel_size; i++, rpnt++) {
+		int res;
 
 		symtab_index = ELF32_R_SYM(rpnt->r_info);
 		debug_sym(symtab,strtab,symtab_index);
 		debug_reloc(symtab,strtab,rpnt);
 
-		res = reloc_fnc (tpnt, scope, rpnt, symtab, strtab);
+		res = reloc_fnc(tpnt, scope, rpnt, symtab, strtab);
 
-		if (res==0) continue;
+		if (res == 0) continue;
 
 		_dl_dprintf(2, "\n%s: ",_dl_progname);
 
 		if (symtab_index)
-		  _dl_dprintf(2, "symbol '%s': ", strtab + symtab[symtab_index].st_name);
+			_dl_dprintf(2, "symbol '%s': ", strtab + symtab[symtab_index].st_name);
 
-		if (unlikely(res <0))
-		{
-		        int reloc_type = ELF32_R_TYPE(rpnt->r_info);
+		if (unlikely(res < 0)) {
+			int reloc_type = ELF32_R_TYPE(rpnt->r_info);
 #if defined (__SUPPORT_LD_DEBUG__)
 			_dl_dprintf(2, "can't handle reloc type %s\n ", _dl_reltypes(reloc_type));
 #else
@@ -149,13 +143,12 @@
 #endif
 			_dl_exit(-res);
 		}
-		if (unlikely(res >0))
-		{
+		if (unlikely(res > 0)) {
 			_dl_dprintf(2, "can't resolve symbol\n");
 			return res;
 		}
-	  }
-	  return 0;
+	}
+	return 0;
 }
 
 
@@ -163,7 +156,7 @@
 _dl_do_reloc (struct elf_resolve *tpnt,struct dyn_elf *scope,
 	      ELF_RELOC *rpnt, Elf32_Sym *symtab, char *strtab)
 {
-        int reloc_type;
+	int reloc_type;
 	int symtab_index;
 	char *symname;
 	unsigned long *reloc_addr;
@@ -176,7 +169,7 @@
 	reloc_type = ELF32_R_TYPE(rpnt->r_info);
 	symtab_index = ELF32_R_SYM(rpnt->r_info);
 	symbol_addr = 0;
-	symname      = strtab + symtab[symtab_index].st_name;
+	symname = strtab + symtab[symtab_index].st_name;
 
 	if (symtab_index) {
 		symbol_addr = (unsigned long) _dl_find_hash(symname, scope, tpnt,
@@ -188,17 +181,16 @@
 		 * here, so all bases should be covered.
 		 */
 		if (!symbol_addr && ELF32_ST_BIND(symtab[symtab_index].st_info) != STB_WEAK) {
-			_dl_dprintf (2, "%s: can't resolve symbol '%s'\n",
-				     _dl_progname, strtab + symtab[symtab_index].st_name);
+			_dl_dprintf(2, "%s: can't resolve symbol '%s'\n",
+			            _dl_progname, strtab + symtab[symtab_index].st_name);
 			_dl_exit (1);
 		}
 	}
 
-
 #if defined (__SUPPORT_LD_DEBUG__)
 	old_val = *reloc_addr;
 #endif
-	    switch (reloc_type) {
+	switch (reloc_type) {
 		case R_SH_NONE:
 			break;
 		case R_SH_COPY:
@@ -226,7 +218,7 @@
 			break;
 		default:
 			return -1; /*call _dl_exit(1) */
-	    }
+	}
 #if defined (__SUPPORT_LD_DEBUG__)
 	    if(_dl_debug_reloc && _dl_debug_detail)
 		_dl_dprintf(_dl_debug_file, "\tpatched: %x ==> %x @ %x", old_val, *reloc_addr, reloc_addr);
@@ -255,17 +247,17 @@
 #if defined (__SUPPORT_LD_DEBUG__)
 	old_val = *reloc_addr;
 #endif
-	    switch (reloc_type) {
-	      case R_SH_NONE:
-		break;
-	      case R_SH_JMP_SLOT:
-		*reloc_addr += (unsigned long) tpnt->loadaddr;
-		break;
-	      default:
-	        return -1; /*call _dl_exit(1) */
-	    }
+	switch (reloc_type) {
+		case R_SH_NONE:
+			break;
+		case R_SH_JMP_SLOT:
+			*reloc_addr += (unsigned long) tpnt->loadaddr;
+			break;
+		default:
+			return -1; /*call _dl_exit(1) */
+	}
 #if defined (__SUPPORT_LD_DEBUG__)
-	    if(_dl_debug_reloc && _dl_debug_detail)
+	if(_dl_debug_reloc && _dl_debug_detail)
 		_dl_dprintf(_dl_debug_file, "\tpatched: %x ==> %x @ %x", old_val, *reloc_addr, reloc_addr);
 #endif
 	return 0;
@@ -283,4 +275,3 @@
 {
 	return _dl_parse(rpnt->dyn, rpnt->dyn->symbol_scope, rel_addr, rel_size, _dl_do_reloc);
 }
-

Modified: branches/uClibc-nptl/utils/Makefile
===================================================================
--- branches/uClibc-nptl/utils/Makefile	2005-08-09 23:05:06 UTC (rev 11091)
+++ branches/uClibc-nptl/utils/Makefile	2005-08-10 02:29:10 UTC (rev 11092)
@@ -43,28 +43,28 @@
 readelf.c ldconfig.c ldd.c:	headers
 
 readelf: readelf.c
-	$(CC) $(CFLAGS) -Wl,-s $^ -o $@
-	$(STRIPTOOL) -x -R .note -R .comment $@
+	$(CC) $(CFLAGS) $^ -o $@
+	$(STRIPTOOL) -s -x -R .note -R .comment $@
 
 ldconfig: ldconfig.c
-	$(CC) $(CFLAGS) -Wl,-s $(if $(filter $(UCLIBC_STATIC_LDCONFIG),y),-static) \
+	$(CC) $(CFLAGS) $(if $(filter $(UCLIBC_STATIC_LDCONFIG),y),-static) \
 		-DUCLIBC_RUNTIME_PREFIX=\"$(RUNTIME_PREFIX)\" \
 		-DUCLIBC_LDSO=$(UCLIBC_LDSO) -I. -I../ldso/include \
 		$^ -o $@
-	$(STRIPTOOL) -x -R .note -R .comment $@
+	$(STRIPTOOL) -s -x -R .note -R .comment $@
 
 ldd: ldd.c
-	$(CC) $(CFLAGS) $(PIEFLAG) -Wl,-s \
+	$(CC) $(CFLAGS) $(PIEFLAG) \
 		-DUCLIBC_RUNTIME_PREFIX=\"$(RUNTIME_PREFIX)\" \
 		-DUCLIBC_LDSO=$(UCLIBC_LDSO) -I. -I../ldso/include \
 		$^ -o $@
-	$(STRIPTOOL) -x -R .note -R .comment $@
+	$(STRIPTOOL) -s -x -R .note -R .comment $@
 
 iconv: ../libc/misc/wchar/wchar.c
 	$(CC) $(CFLAGS) $(PIEFLAG) -Wl,-s \
 		-DL_iconv_main \
 		$^ -o $@
-	$(STRIPTOOL) -x -R .note -R .comment $@
+	$(STRIPTOOL) -s -x -R .note -R .comment $@
 
 ifeq ($(strip $(HAVE_SHARED)),y)
 hostutils: ldd.host ldconfig.host readelf.host




More information about the uClibc-cvs mailing list