[uClibc][PATCH] Add more relocs to SH ldso

M. R. Brown mrbrown at 0xd6.org
Thu Oct 31 03:05:31 UTC 2002


The attached patch adds support for the R_SH_GLOB_DAT and R_SH_JMP_SLOT
relocs to both the bootstrap loader and shared lib loader.  Tested using
GCC 3.2 / binutils 2.13 on a SH4 (Dreamcast).

BTW, any luck with the initfini.{awk,c} fixes?  I'm still getting segfaults
and error messages from the _init/_fini code (I assume) on shared and
static executables.  I assume this is the _init/_fini code since
executables without _init/_fini initializations run normally.

Other than that, uClibc now seems to run beautifully :P.

M. R.
-------------- next part --------------
Index: ldso/ldso/sh/elfinterp.c
===================================================================
RCS file: /var/cvs/uClibc/ldso/ldso/sh/elfinterp.c,v
retrieving revision 1.4
diff -u -3 -p -u -r1.4 elfinterp.c
--- ldso/ldso/sh/elfinterp.c	2002/10/01 05:30:23	1.4
+++ ldso/ldso/sh/elfinterp.c	2002/10/31 02:37:45
@@ -290,6 +290,9 @@ _dl_do_reloc (struct elf_resolve *tpnt,s
 		case R_SH_DIR32:
 			*reloc_addr = symbol_addr + rpnt->r_addend;
 			break;
+		case R_SH_GLOB_DAT:
+			*reloc_addr = symbol_addr + rpnt->r_addend;
+			break;
 		case R_SH_JMP_SLOT:
 			*reloc_addr = symbol_addr + rpnt->r_addend;
 			break;
Index: ldso/ldso/sh/ld_sysdep.h
===================================================================
RCS file: /var/cvs/uClibc/ldso/ldso/sh/ld_sysdep.h,v
retrieving revision 1.4
diff -u -3 -p -u -r1.4 ld_sysdep.h
--- ldso/ldso/sh/ld_sysdep.h	2002/10/01 05:30:23	1.4
+++ ldso/ldso/sh/ld_sysdep.h	2002/10/31 02:37:45
@@ -40,6 +40,12 @@
 	case R_SH_DIR32:					\
 		*(REL)  = (SYMBOL) + (RELP)->r_addend;		\
 		break;						\
+	case R_SH_GLOB_DAT:					\
+		*(REL)  = (SYMBOL) + (RELP)->r_addend;		\
+		break;						\
+	case R_SH_JMP_SLOT:					\
+		*(REL)  = (SYMBOL) + (RELP)->r_addend;		\
+		break;						\
 	case R_SH_RELATIVE:					\
 		*(REL)  = (LOAD) + (RELP)->r_addend;		\
 		break;						\

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/uclibc/attachments/20021030/1edbaf60/attachment.pgp 


More information about the uClibc mailing list