m68k: TLS reference to errno in syscall stubs

This commit is contained in:
Andreas Schwab 2010-03-13 01:00:03 +01:00
parent 7d6cb729ed
commit dbd0094b3f
2 changed files with 30 additions and 8 deletions

View File

@ -1,3 +1,8 @@
2010-03-13 Andreas Schwab <schwab@linux-m68k.org>
* sysdeps/unix/sysv/linux/m68k/sysdep.h (SYSCALL_ERROR_HANDLER):
Add variant for USE__THREAD.
2010-03-12 Andreas Schwab <schwab@linux-m68k.org>
* sysdeps/unix/sysv/linux/m68k/nptl/lowlevellock.h: Don't include

View File

@ -111,10 +111,27 @@ SYSCALL_ERROR_LABEL: \
a pointer (e.g., mmap). */ \
move.l %d0, %a0; \
rts;
# else /* !RTLD_PRIVATE_ERRNO */
/* Store (- %d0) into errno through the GOT. */
# if defined _LIBC_REENTRANT
# define SYSCALL_ERROR_HANDLER \
# elif USE___THREAD
# ifndef NOT_IN_libc
# define SYSCALL_ERROR_ERRNO __libc_errno
# else
# define SYSCALL_ERROR_ERRNO errno
# endif
# define SYSCALL_ERROR_HANDLER \
SYSCALL_ERROR_LABEL: \
neg.l %d0; \
move.l %d0, -(%sp); \
jbsr __m68k_read_tp@PLTPC; \
lea (_GLOBAL_OFFSET_TABLE_@GOTPC, %pc), %a1; \
add.l (SYSCALL_ERROR_ERRNO@TLSIE, %a1), %a0; \
move.l (%sp)+, (%a0); \
move.l &-1, %d0; \
/* Copy return value to %a0 for syscalls that are declared to return \
a pointer (e.g., mmap). */ \
move.l %d0, %a0; \
rts;
# elif defined _LIBC_REENTRANT
# define SYSCALL_ERROR_HANDLER \
SYSCALL_ERROR_LABEL: \
neg.l %d0; \
move.l %d0, -(%sp); \
@ -125,8 +142,9 @@ SYSCALL_ERROR_LABEL: \
a pointer (e.g., mmap). */ \
move.l %d0, %a0; \
rts;
# else /* !_LIBC_REENTRANT */
# define SYSCALL_ERROR_HANDLER \
# else /* !_LIBC_REENTRANT */
/* Store (- %d0) into errno through the GOT. */
# define SYSCALL_ERROR_HANDLER \
SYSCALL_ERROR_LABEL: \
move.l (errno@GOTPC, %pc), %a0; \
neg.l %d0; \
@ -136,8 +154,7 @@ SYSCALL_ERROR_LABEL: \
a pointer (e.g., mmap). */ \
move.l %d0, %a0; \
rts;
# endif /* _LIBC_REENTRANT */
# endif /* RTLD_PRIVATE_ERRNO */
# endif /* _LIBC_REENTRANT */
#else
# define SYSCALL_ERROR_HANDLER /* Nothing here; code in sysdep.S is used. */
#endif /* PIC */