From 6e0b24b426c91b93f863a5187ce9e0577f00c4dd Mon Sep 17 00:00:00 2001 From: David Schleef Date: Thu, 12 Jul 2001 10:11:33 +0000 Subject: Small fixups for powerpc --- ldso/ldso/boot1.c | 2 ++ ldso/ldso/hash.h | 4 ++-- ldso/ldso/ld-uClibc.c | 2 ++ ldso/ldso/ld_hash.h | 4 ++-- ldso/ldso/ld_syscall.h | 8 ++++++++ ldso/ldso/ldso.c | 2 ++ ldso/ldso/syscall.h | 8 ++++++++ ldso/ldso/vsprintf.c | 2 ++ 8 files changed, 28 insertions(+), 4 deletions(-) (limited to 'ldso/ldso') 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 -- cgit v1.2.3