[PATCH v2] librt: fix mq_timed{send,receive} return instructions

Baruch Siach baruch at tkos.co.il
Thu Nov 7 07:03:30 UTC 2013


Not all architectures use 'ret' as function return instruction. For example,
xtensa usually uses 'retw'. Use the ret_ERRVAL arch dependant macro instead.

Signed-off-by: Baruch Siach <baruch at tkos.co.il>
---
v2: Add ret_ERRVAL to architectures missing it as noted by Bernhard
	Reutner-Fischer.
---
 libc/sysdeps/linux/bfin/sysdep.h  | 2 ++
 libc/sysdeps/linux/cris/sysdep.h  | 2 ++
 libc/sysdeps/linux/metag/sysdep.h | 2 ++
 libc/sysdeps/linux/sparc/sysdep.h | 2 ++
 librt/mq_timedreceive.S           | 2 +-
 librt/mq_timedsend.S              | 2 +-
 6 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/libc/sysdeps/linux/bfin/sysdep.h b/libc/sysdeps/linux/bfin/sysdep.h
index 352fbf4..0de2eba 100644
--- a/libc/sysdeps/linux/bfin/sysdep.h
+++ b/libc/sysdeps/linux/bfin/sysdep.h
@@ -16,6 +16,8 @@
 #define ENTRY(sym) .global sym; .type sym, STT_FUNC; sym:
 #define ENDPROC(sym) .size sym, . - sym
 
+#define ret_ERRVAL ret
+
 #endif
 
 #endif
diff --git a/libc/sysdeps/linux/cris/sysdep.h b/libc/sysdeps/linux/cris/sysdep.h
index a034650..94b0fe8 100644
--- a/libc/sysdeps/linux/cris/sysdep.h
+++ b/libc/sysdeps/linux/cris/sysdep.h
@@ -49,6 +49,8 @@
 #undef SYS_ify
 #define SYS_ify(syscall_name)   __NR_##syscall_name
 
+#define ret_ERRVAL ret
+
 /* Syntactic details of assembly-code.  */
 
 /* It is *not* generally true that "ELF uses byte-counts for .align, most
diff --git a/libc/sysdeps/linux/metag/sysdep.h b/libc/sysdeps/linux/metag/sysdep.h
index a12f393..274d79c 100644
--- a/libc/sysdeps/linux/metag/sysdep.h
+++ b/libc/sysdeps/linux/metag/sysdep.h
@@ -22,6 +22,8 @@
   SYSCALL_ERROR_HANDLER							\
   END (name)
 
+#define ret_ERRVAL ret
+
 #if defined NOT_IN_libc
 # define SYSCALL_ERROR __local_syscall_error
 # ifdef RTLD_PRIVATE_ERRNO
diff --git a/libc/sysdeps/linux/sparc/sysdep.h b/libc/sysdeps/linux/sparc/sysdep.h
index cf3e3af..7a6aa85 100644
--- a/libc/sysdeps/linux/sparc/sysdep.h
+++ b/libc/sysdeps/linux/sparc/sysdep.h
@@ -10,6 +10,8 @@
 
 #define LOADSYSCALL(x) mov __NR_##x, %g1
 
+#define ret_ERRVAL ret
+
 #define ENTRY(name)                 \
     .align 4;                       \
     .global C_SYMBOL_NAME(name);    \
diff --git a/librt/mq_timedreceive.S b/librt/mq_timedreceive.S
index 43a5fda..00fecac 100644
--- a/librt/mq_timedreceive.S
+++ b/librt/mq_timedreceive.S
@@ -3,6 +3,6 @@
 #error Missing definition of NR_timedreceive needed for cancellation.
 #endif
 PSEUDO(mq_timedreceive, mq_timedreceive, 5)
-ret
+ret_ERRVAL
 PSEUDO_END(mq_timedreceive)
 librt_hidden_def(mq_timedreceive)
diff --git a/librt/mq_timedsend.S b/librt/mq_timedsend.S
index 13d91da..ee8d483 100644
--- a/librt/mq_timedsend.S
+++ b/librt/mq_timedsend.S
@@ -3,6 +3,6 @@
 #error Missing definition of NR_timedsend needed for cancellation.
 #endif
 PSEUDO(mq_timedsend, mq_timedsend, 5)
-ret
+ret_ERRVAL
 PSEUDO_END(mq_timedsend)
 librt_hidden_def(mq_timedsend)
-- 
1.8.4.rc3



More information about the uClibc mailing list