diff options
author | David Schleef <ds@schleef.org> | 2001-07-12 10:11:33 +0000 |
---|---|---|
committer | David Schleef <ds@schleef.org> | 2001-07-12 10:11:33 +0000 |
commit | 6e0b24b426c91b93f863a5187ce9e0577f00c4dd (patch) | |
tree | 6af1cfa79b7fc2fb799e87e317e3aff708f3354e | |
parent | ce8ee8d9b401c9c2828df3457815c2f4ceed4900 (diff) |
Small fixups for powerpc
-rw-r--r-- | ldso/ldso/boot1.c | 2 | ||||
-rw-r--r-- | ldso/ldso/hash.h | 4 | ||||
-rw-r--r-- | ldso/ldso/ld-uClibc.c | 2 | ||||
-rw-r--r-- | ldso/ldso/ld_hash.h | 4 | ||||
-rw-r--r-- | ldso/ldso/ld_syscall.h | 8 | ||||
-rw-r--r-- | ldso/ldso/ldso.c | 2 | ||||
-rw-r--r-- | ldso/ldso/syscall.h | 8 | ||||
-rw-r--r-- | ldso/ldso/vsprintf.c | 2 |
8 files changed, 28 insertions, 4 deletions
diff --git a/ldso/ldso/boot1.c b/ldso/ldso/boot1.c index 9e11cee10..920779dcd 100644 --- a/ldso/ldso/boot1.c +++ b/ldso/ldso/boot1.c @@ -244,6 +244,8 @@ DL_BOOT(unsigned long args) __asm__("\tmov %%l7,%0\n\t" : "=r" (got)) #elif defined(__arm__) __asm__("\tmov %0, r10\n\t" : "=r"(got)); +#elif defined(__powerpc__) + __asm__("\tbl _GLOBAL_OFFSET_TABLE_-4@local\n\t" : "=l"(got)); #else /* Do things the slow way in C */ { diff --git a/ldso/ldso/hash.h b/ldso/ldso/hash.h index f38361090..1ee32672b 100644 --- a/ldso/ldso/hash.h +++ b/ldso/ldso/hash.h @@ -86,7 +86,7 @@ extern int _dl_linux_dynamic_link(void); #define SEND_ADDRESS_STDERR(X, add_a_newline) { \ char tmp[13], *tmp1; \ _dl_memset_inline(tmp, 0, sizeof(tmp)); \ - tmp1=_dl_simple_ltoahex( tmp, (unsigned long)(X)); \ + tmp1=_dl_simple_ltoahex_inline( tmp, (unsigned long)(X)); \ _dl_write(2, tmp1, _dl_strlen_inline(tmp1)); \ if (add_a_newline) { \ tmp[0]='\n'; \ @@ -97,7 +97,7 @@ extern int _dl_linux_dynamic_link(void); #define SEND_NUMBER_STDERR(X, add_a_newline) { \ char tmp[13], *tmp1; \ _dl_memset_inline(tmp, 0, sizeof(tmp)); \ - tmp1=_dl_simple_ltoahex( tmp, (unsigned long)(X)); \ + tmp1=_dl_simple_ltoahex_inline( tmp, (unsigned long)(X)); \ _dl_write(2, tmp1, _dl_strlen_inline(tmp1)); \ if (add_a_newline) { \ tmp[0]='\n'; \ diff --git a/ldso/ldso/ld-uClibc.c b/ldso/ldso/ld-uClibc.c index 9e11cee10..920779dcd 100644 --- a/ldso/ldso/ld-uClibc.c +++ b/ldso/ldso/ld-uClibc.c @@ -244,6 +244,8 @@ DL_BOOT(unsigned long args) __asm__("\tmov %%l7,%0\n\t" : "=r" (got)) #elif defined(__arm__) __asm__("\tmov %0, r10\n\t" : "=r"(got)); +#elif defined(__powerpc__) + __asm__("\tbl _GLOBAL_OFFSET_TABLE_-4@local\n\t" : "=l"(got)); #else /* Do things the slow way in C */ { diff --git a/ldso/ldso/ld_hash.h b/ldso/ldso/ld_hash.h index f38361090..1ee32672b 100644 --- a/ldso/ldso/ld_hash.h +++ b/ldso/ldso/ld_hash.h @@ -86,7 +86,7 @@ extern int _dl_linux_dynamic_link(void); #define SEND_ADDRESS_STDERR(X, add_a_newline) { \ char tmp[13], *tmp1; \ _dl_memset_inline(tmp, 0, sizeof(tmp)); \ - tmp1=_dl_simple_ltoahex( tmp, (unsigned long)(X)); \ + tmp1=_dl_simple_ltoahex_inline( tmp, (unsigned long)(X)); \ _dl_write(2, tmp1, _dl_strlen_inline(tmp1)); \ if (add_a_newline) { \ tmp[0]='\n'; \ @@ -97,7 +97,7 @@ extern int _dl_linux_dynamic_link(void); #define SEND_NUMBER_STDERR(X, add_a_newline) { \ char tmp[13], *tmp1; \ _dl_memset_inline(tmp, 0, sizeof(tmp)); \ - tmp1=_dl_simple_ltoahex( tmp, (unsigned long)(X)); \ + tmp1=_dl_simple_ltoahex_inline( tmp, (unsigned long)(X)); \ _dl_write(2, tmp1, _dl_strlen_inline(tmp1)); \ if (add_a_newline) { \ tmp[0]='\n'; \ diff --git a/ldso/ldso/ld_syscall.h b/ldso/ldso/ld_syscall.h index 013cc6fb7..322c618f6 100644 --- a/ldso/ldso/ld_syscall.h +++ b/ldso/ldso/ld_syscall.h @@ -17,6 +17,12 @@ static inline _syscall1(void, _dl_exit, int, status); static inline _syscall1(int, _dl_close, int, fd); +#ifdef __powerpc__ +/* PowerPC has a different calling convention for mmap(). */ +#define __NR__dl_mmap __NR_mmap +static inline _syscall6(void *, _dl_mmap, void *, start, size_t, length, + int, prot, int, flags, int, fd, off_t, offset); +#else #define __NR__dl_mmap_real __NR_mmap static inline _syscall1(void *, _dl_mmap_real, unsigned long *, buffer); @@ -33,6 +39,8 @@ static inline void * _dl_mmap(void * addr, unsigned long size, int prot, buffer[5] = (unsigned long) offset; return (void *) _dl_mmap_real(buffer); } +#endif + #ifndef _dl_MAX_ERRNO #define _dl_MAX_ERRNO 4096 #endif diff --git a/ldso/ldso/ldso.c b/ldso/ldso/ldso.c index 9e11cee10..920779dcd 100644 --- a/ldso/ldso/ldso.c +++ b/ldso/ldso/ldso.c @@ -244,6 +244,8 @@ DL_BOOT(unsigned long args) __asm__("\tmov %%l7,%0\n\t" : "=r" (got)) #elif defined(__arm__) __asm__("\tmov %0, r10\n\t" : "=r"(got)); +#elif defined(__powerpc__) + __asm__("\tbl _GLOBAL_OFFSET_TABLE_-4@local\n\t" : "=l"(got)); #else /* Do things the slow way in C */ { diff --git a/ldso/ldso/syscall.h b/ldso/ldso/syscall.h index 013cc6fb7..322c618f6 100644 --- a/ldso/ldso/syscall.h +++ b/ldso/ldso/syscall.h @@ -17,6 +17,12 @@ static inline _syscall1(void, _dl_exit, int, status); static inline _syscall1(int, _dl_close, int, fd); +#ifdef __powerpc__ +/* PowerPC has a different calling convention for mmap(). */ +#define __NR__dl_mmap __NR_mmap +static inline _syscall6(void *, _dl_mmap, void *, start, size_t, length, + int, prot, int, flags, int, fd, off_t, offset); +#else #define __NR__dl_mmap_real __NR_mmap static inline _syscall1(void *, _dl_mmap_real, unsigned long *, buffer); @@ -33,6 +39,8 @@ static inline void * _dl_mmap(void * addr, unsigned long size, int prot, buffer[5] = (unsigned long) offset; return (void *) _dl_mmap_real(buffer); } +#endif + #ifndef _dl_MAX_ERRNO #define _dl_MAX_ERRNO 4096 #endif diff --git a/ldso/ldso/vsprintf.c b/ldso/ldso/vsprintf.c index 4ca1acffc..959c24080 100644 --- a/ldso/ldso/vsprintf.c +++ b/ldso/ldso/vsprintf.c @@ -271,11 +271,13 @@ int _dl_fdprintf(int fd, const char *fmt, ...) } if (qualifier == 'l') num = va_arg(args, unsigned long); +#ifndef __powerpc__ else if (qualifier == 'h') if (flags & SIGN) num = va_arg(args, short); else num = va_arg(args, unsigned short); +#endif else if (flags & SIGN) num = va_arg(args, int); else |