Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:derselbst:n64
cross-mips-glibc
glibc-2.1.95-mips.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File glibc-2.1.95-mips.patch of Package cross-mips-glibc
diff -urN libc-cygnus/linuxthreads/sysdeps/mips/pspinlock.c libc/linuxthreads/sysdeps/mips/pspinlock.c --- libc-cygnus/linuxthreads/sysdeps/mips/pspinlock.c Sun Aug 13 00:29:17 2000 +++ libc/linuxthreads/sysdeps/mips/pspinlock.c Wed Oct 25 20:28:06 2000 @@ -23,7 +23,8 @@ #include <sys/tas.h> -#if (_MIPS_ISA >= _MIPS_ISA_MIPS2) +//#if (_MIPS_ISA >= _MIPS_ISA_MIPS2) +#if 1 /* This implementation is similar to the one used in the Linux kernel. */ int diff -urN libc-cygnus/linuxthreads/sysdeps/mips/pt-machine.h libc/linuxthreads/sysdeps/mips/pt-machine.h --- libc-cygnus/linuxthreads/sysdeps/mips/pt-machine.h Sun Aug 13 00:29:17 2000 +++ libc/linuxthreads/sysdeps/mips/pt-machine.h Wed Oct 25 20:28:06 2000 @@ -33,7 +33,8 @@ /* Spinlock implementation; required. */ -#if (_MIPS_ISA >= _MIPS_ISA_MIPS2) +// #if (_MIPS_ISA >= _MIPS_ISA_MIPS2) +#if 1 PT_EI long int testandset (int *spinlock) @@ -79,7 +80,8 @@ /* Compare-and-swap for semaphores. */ -#if (_MIPS_ISA >= _MIPS_ISA_MIPS2) +//#if (_MIPS_ISA >= _MIPS_ISA_MIPS2) +#if 1 #define HAS_COMPARE_AND_SWAP PT_EI int diff -urN libc-cygnus/sysdeps/mips/dl-machine.h libc/sysdeps/mips/dl-machine.h --- libc-cygnus/sysdeps/mips/dl-machine.h Wed Oct 25 03:47:50 2000 +++ libc/sysdeps/mips/dl-machine.h Wed Oct 25 20:37:25 2000 @@ -22,6 +22,64 @@ #ifndef dl_machine_h #define dl_machine_h +#undef DEBUG + +#ifdef DEBUG +static inline void __rtld_debug_write(int fd, const char *string, int len) +{ + __asm__ __volatile__("move $4, %0\n\t" + "move $5, %1\n\t" + "move $6, %2\n\t" + "li $2, 4004\n\t" + "syscall" : : + "r" (fd), "r" (string), "r" (len) : + "$2", "$3", "$4", "$5", "$6", "$7","$8","$9", \ + "$10","$11","$12","$13","$14","$15","$24"); +} + +static inline void __rtld_debug_putc(int fd, const char c) +{ + __asm__ __volatile__( + "move $4, %0\n\t" + "la $5, %1\n\t" + "li $6, 1\n\t" + "li $2, 4004\n\t" + "syscall" + : + : "r" (fd), "m" (c) + : "$2", "$3", "$4", "$5", "$6", "$7","$8","$9", \ + "$10","$11","$12","$13","$14","$15","$24","$25"); +} + +static inline int __rtld_debug_strlen(char *s) +{ + char *sc; + + for (sc = s; *sc != '\0'; ++sc) + /* nothing */; + return sc - s; +} + +static inline void __rtld_debug_printaddr(unsigned long addr) +{ + char c; + int i; + + __rtld_debug_putc(2, ' '); + __rtld_debug_putc(2, '0'); + __rtld_debug_putc(2, 'x'); + + for (i = 28; i >= 0; i -= 4) { + c = '0' + ((addr >> i) & 0xf); + if (c > '9') + c += ('a' - '0' - 10); + __rtld_debug_putc(2, c); + } +} + +#define printk(s) __rtld_debug_write(2, s, __rtld_debug_strlen(s)) +#define printkaddr(x) __rtld_debug_printaddr((unsigned long)(x)) +#endif #define ELF_MACHINE_NAME "MIPS" #define ELF_MACHINE_NO_PLT @@ -508,11 +566,25 @@ switch (ELFW(R_TYPE) (reloc->r_info)) { case R_MIPS_REL32: + { + const Elf32_Sym *symtab; + Elf32_Addr loadbase; + + symtab = (const ElfW(Sym) *) (map->l_addr + + map->l_info[DT_SYMTAB]->d_un.d_ptr); + + if (sym - symtab < map->l_info[DT_MIPS (GOTSYM)]->d_un.d_val) + { #ifndef RTLD_BOOTSTRAP - if (map != &_dl_rtld_map) + if (map != &_dl_rtld_map) #endif - *reloc_addr += map->l_addr; - break; + *reloc_addr += map->l_addr; + break; + } + + loadbase = RESOLVE (&sym, version, R_MIPS_REL32); + *reloc_addr += (sym ? loadbase + sym->st_value : 0); + } case R_MIPS_NONE: /* Alright, Wilbur. */ break; default:
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor