1 --- uClibc-0.9.26/ldso/include/ld_string.h.orig 2003-09-29 21:46:00.000000000 +0000
2 +++ uClibc-0.9.26/ldso/include/ld_string.h 2004-05-27 20:47:48.000000000 +0000
4 static inline char *_dl_simple_ltoa(char * local, unsigned long i)
6 /* 21 digits plus null terminator, good for 64-bit or smaller ints */
7 - char *p = &local[22];
8 + char *p = &local[21];
11 - *p-- = '0' + i % 10;
14 + do_rem(temp, i, 10);
16 + i /= 10; /* XXX: .udiv() on sparc! */
21 static inline char *_dl_simple_ltoahex(char * local, unsigned long i)
23 /* 21 digits plus null terminator, good for 64-bit or smaller ints */
24 - char *p = &local[22];
25 + char *p = &local[21];
28 - char temp = i % 0x10;
29 + char temp = i & 0xf; /* % 0x10, to be sure .urem is not used */
33 *p-- = 'a' - 0x0a + temp;
35 + i >>= 4; /* /= 0x10, to be sure .udiv is not used */
39 --- uClibc-0.9.26/ldso/include/ld_syscall.h.orig 2003-08-19 06:05:30.000000000 +0000
40 +++ uClibc-0.9.26/ldso/include/ld_syscall.h 2004-05-25 22:20:36.000000000 +0000
42 static inline _syscall1(int, _dl_close, int, fd);
45 -#if defined(__powerpc__) || defined(__mips__) || defined(__sh__)
46 +#if defined(__powerpc__) || defined(__mips__) || defined(__sh__) || defined(__sparc__)
47 /* PowerPC, MIPS and SuperH have a different calling convention for mmap(). */
48 #define __NR__dl_mmap __NR_mmap
49 static inline _syscall6(void *, _dl_mmap, void *, start, size_t, length,
50 --- uClibc-0.9.26/ldso/ldso/sparc/ld_syscalls.h.orig 2004-05-25 19:03:47.000000000 +0000
51 +++ uClibc-0.9.26/ldso/ldso/sparc/ld_syscalls.h 2004-05-25 22:41:08.000000000 +0000
57 +#define _syscall6(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \
58 + type5,arg5,type6,arg6) \
59 +type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5,type6 arg6) \
62 +register long __g1 __asm__ ("g1") = __NR_##name; \
63 +register long __o0 __asm__ ("o0") = (long)(arg1); \
64 +register long __o1 __asm__ ("o1") = (long)(arg2); \
65 +register long __o2 __asm__ ("o2") = (long)(arg3); \
66 +register long __o3 __asm__ ("o3") = (long)(arg4); \
67 +register long __o4 __asm__ ("o4") = (long)(arg5); \
68 +register long __o5 __asm__ ("o5") = (long)(arg6); \
69 +__asm__ __volatile__ ("t 0x10\n\t" \
71 + "mov %%o0, %0\n\t" \
72 + "sub %%g0, %%o0, %0\n\t" \
74 + : "=r" (__res), "=&r" (__o0) \
75 + : "1" (__o0), "r" (__o1), "r" (__o2), "r" (__o3), "r" (__o4), "r" (__o5), "r" (__g1) \
77 +if (__res < -255 || __res>=0) \
78 + return (type) __res; \
79 +/*errno = -__res; */\
82 --- uClibc-0.9.26/ldso/ldso/sparc/ld_sysdep.h.orig 2003-12-17 08:05:44.000000000 +0000
83 +++ uClibc-0.9.26/ldso/ldso/sparc/ld_sysdep.h 2004-05-27 19:41:50.000000000 +0000
86 * Define this if you want a dynamic loader that works on Solaris.
89 #define SOLARIS_COMPATIBLE
93 +/* Cheap modulo implementation, taken from arm/ld_sysdep.h. */
94 +static inline unsigned long
95 +sparc_mod(unsigned long m, unsigned long p)
97 + unsigned long i, t, inc;
102 + while (!(i & (1 << 31))) {
109 + for (inc = t; inc > 2; inc--) {
131 -#define do_rem(result, n, base) result = (n % base)
132 +#define do_rem(result, n, base) result = sparc_mod(n, base);
136 * dbx wants the binder to have a specific name. Mustn't disappoint it.
140 /* 4096 bytes alignment */
141 -#define PAGE_ALIGN 0xfffff000
142 -#define ADDR_ALIGN 0xfff
143 -#define OFFS_ALIGN 0x7ffff000
144 +/* ...but 8192 is required for mmap() on sparc64 kernel */
145 +#define PAGE_ALIGN 0xffffe000
146 +#define ADDR_ALIGN 0x1fff
147 +#define OFFS_ALIGN 0x7fffe000
148 --- uClibc-0.9.26/ldso/ldso/sparc/elfinterp.c.orig 2004-05-25 19:03:47.000000000 +0000
149 +++ uClibc-0.9.26/ldso/ldso/sparc/elfinterp.c 2004-05-27 19:16:15.000000000 +0000
152 * Generate the correct relocation index into the .rela.plt section.
154 - reloc_entry = (reloc_entry >> 12) - 0xc;
155 + reloc_entry = (reloc_entry >> 10) - 0xc;
157 this_reloc = (Elf32_Rela *) ((char *) rel_addr + reloc_entry);
160 symtab = (Elf32_Sym *) (tpnt->dynamic_info[DT_SYMTAB] + tpnt->loadaddr);
161 strtab = (char *) (tpnt->dynamic_info[DT_STRTAB] + tpnt->loadaddr);
163 +#ifdef __SUPPORT_LD_DEBUG__
164 + if (_dl_debug_symbols) {
165 _dl_dprintf(2, "tpnt = %x\n", tpnt);
166 _dl_dprintf(2, "reloc = %x\n", this_reloc);
167 _dl_dprintf(2, "symtab = %x\n", symtab);
168 _dl_dprintf(2, "strtab = %x\n", strtab);
173 if (reloc_type != R_SPARC_JMP_SLOT) {
175 instr_addr = ((int)this_reloc->r_offset + (int)tpnt->loadaddr);
176 got_addr = (char **) instr_addr;
178 - _dl_dprintf(2, "symtab_index %d\n", symtab_index);
180 #ifdef __SUPPORT_LD_DEBUG__
181 if (_dl_debug_symbols) {
182 + _dl_dprintf(2, "symtab_index %x\n", symtab_index);
184 _dl_dprintf(2, "Resolving symbol %s\n",
185 strtab + symtab[symtab_index].st_name);
187 --- uClibc-0.9.26/ldso/ldso/ldso.c.orig 2004-05-25 19:03:47.000000000 +0000
188 +++ uClibc-0.9.26/ldso/ldso/ldso.c 2004-05-25 21:27:59.000000000 +0000
190 /* Check the ELF header to make sure everything looks ok. */
191 if (!header || header->e_ident[EI_CLASS] != ELFCLASS32 ||
192 header->e_ident[EI_VERSION] != EV_CURRENT
193 -#if !defined(__powerpc__) && !defined(__mips__) && !defined(__sh__)
194 +#if !defined(__powerpc__) && !defined(__mips__) && !defined(__sh__) && !defined(__sparc__)
195 || _dl_strncmp((void *) header, ELFMAGIC, SELFMAG) != 0
197 || header->e_ident[EI_MAG0] != ELFMAG0
198 --- uClibc-0.9.26/ldso/ldso/readelflib1.c.orig 2003-12-17 18:34:15.000000000 +0000
199 +++ uClibc-0.9.26/ldso/ldso/readelflib1.c 2004-05-27 20:41:34.000000000 +0000
201 _dl_dprintf(2, "\n\tfile='%s'; generating link map\n", libname);
202 _dl_dprintf(2, "\t\tdynamic: %x base: %x size: %x\n",
203 dynamic_addr, libaddr, dynamic_size);
204 - _dl_dprintf(2, "\t\t entry: %x phdr: %x phnum: %d\n\n",
205 + _dl_dprintf(2, "\t\t entry: %x phdr: %x phnum: %x\n\n",
206 epnt->e_entry + libaddr, tpnt->ppnt, tpnt->n_phent);