The shared code in preloader.c didn't have declarations for wld_exit() or wld_write().
Signed-off-by: Ken Thomases ken@codeweavers.com --- loader/preloader.c | 8 ++------ loader/preloader.h | 2 ++ loader/preloader_mac.c | 2 -- 3 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/loader/preloader.c b/loader/preloader.c index 9f2fbc3..5bfadf2 100644 --- a/loader/preloader.c +++ b/loader/preloader.c @@ -243,7 +243,7 @@ __ASM_GLOBAL_FUNC(_start,
#define SYSCALL_RET(ret) (((ret) < 0 && (ret) > -4096) ? -1 : (ret))
-static inline __attribute__((noreturn)) void wld_exit( int code ) +void wld_exit( int code ) { for (;;) /* avoid warning */ __asm__ __volatile__( "pushl %%ebx; movl %1,%%ebx; int $0x80; popl %%ebx" @@ -276,7 +276,7 @@ static inline ssize_t wld_read( int fd, void *buffer, size_t len ) return SYSCALL_RET(ret); }
-static inline ssize_t wld_write( int fd, const void *buffer, size_t len ) +ssize_t wld_write( int fd, const void *buffer, size_t len ) { int ret; __asm__ __volatile__( "pushl %%ebx; movl %2,%%ebx; int $0x80; popl %%ebx" @@ -392,13 +392,11 @@ __ASM_GLOBAL_FUNC(_start, "syscall\n\t" \ "ret" )
-void wld_exit( int code ) __attribute__((noreturn)); SYSCALL_NOERR( wld_exit, 60 /* SYS_exit */ );
ssize_t wld_read( int fd, void *buffer, size_t len ); SYSCALL_FUNC( wld_read, 0 /* SYS_read */ );
-ssize_t wld_write( int fd, const void *buffer, size_t len ); SYSCALL_FUNC( wld_write, 1 /* SYS_write */ );
int wld_open( const char *name, int flags ); @@ -493,13 +491,11 @@ __ASM_GLOBAL_FUNC(_start, "ldp x8, x9, [SP], #16\n\t" \ "ret" )
-void wld_exit( int code ) __attribute__((noreturn)); SYSCALL_NOERR( wld_exit, 93 /* SYS_exit */ );
ssize_t wld_read( int fd, void *buffer, size_t len ); SYSCALL_FUNC( wld_read, 63 /* SYS_read */ );
-ssize_t wld_write( int fd, const void *buffer, size_t len ); SYSCALL_FUNC( wld_write, 64 /* SYS_write */ );
int wld_openat( int dirfd, const char *name, int flags ); diff --git a/loader/preloader.h b/loader/preloader.h index b944a09..d89c7e4 100644 --- a/loader/preloader.h +++ b/loader/preloader.h @@ -46,6 +46,8 @@ static inline void *wld_memset( void *dest, int val, size_t len ) return dest; }
+extern __attribute__((noreturn)) void wld_exit( int code ); +extern ssize_t wld_write( int fd, const void *buffer, size_t len ); extern int wld_vsprintf(char *buffer, const char *fmt, va_list args ); extern __attribute__((format(printf,1,2))) void wld_printf(const char *fmt, ... ); extern __attribute__((noreturn,format(printf,1,2))) void fatal_error(const char *fmt, ... ); diff --git a/loader/preloader_mac.c b/loader/preloader_mac.c index 294efc9..61a8dbd 100644 --- a/loader/preloader_mac.c +++ b/loader/preloader_mac.c @@ -267,10 +267,8 @@ __ASM_GLOBAL_FUNC( start, #error preloader not implemented for this CPU #endif
-void wld_exit( int code ) __attribute__((noreturn)); SYSCALL_NOERR( wld_exit, 1 /* SYS_exit */ );
-ssize_t wld_write( int fd, const void *buffer, size_t len ); SYSCALL_FUNC( wld_write, 4 /* SYS_write */ );
void *wld_mmap( void *start, size_t len, int prot, int flags, int fd, off_t offset );