aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAndreas Tobler <andreast@FreeBSD.org>2013-11-21 21:25:58 +0000
committerAndreas Tobler <andreast@FreeBSD.org>2013-11-21 21:25:58 +0000
commitd2ef321a59c8121f97c30155bd38e06a9eb441e7 (patch)
tree366d8180456720ddc0a9d3562c7413bda57970e1 /lib
parent1e7652cc762c1f195ccb6a362f887c981dafebb0 (diff)
downloadsrc-d2ef321a59c8121f97c30155bd38e06a9eb441e7.tar.gz
src-d2ef321a59c8121f97c30155bd38e06a9eb441e7.zip
Introduce a WEAK_REFERENCE() alias and use it. Get rid of the CNAME and the
CONCAT macros in SYS.h. Reviewed by: bde, kib
Notes
Notes: svn path=/head/; revision=258447
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/amd64/SYS.h23
-rw-r--r--lib/libc/amd64/gen/_setjmp.S3
-rw-r--r--lib/libc/amd64/gen/setjmp.S3
-rw-r--r--lib/libc/amd64/gen/sigsetjmp.S3
-rw-r--r--lib/libc/amd64/sys/getcontext.S6
-rw-r--r--lib/libc/amd64/sys/pipe.S6
-rw-r--r--lib/libc/amd64/sys/reboot.S6
-rw-r--r--lib/libc/amd64/sys/setlogin.S6
-rw-r--r--lib/libc/amd64/sys/vfork.S6
9 files changed, 23 insertions, 39 deletions
diff --git a/lib/libc/amd64/SYS.h b/lib/libc/amd64/SYS.h
index a2323839f460..3d9108e062af 100644
--- a/lib/libc/amd64/SYS.h
+++ b/lib/libc/amd64/SYS.h
@@ -36,20 +36,17 @@
#include <sys/syscall.h>
#include <machine/asm.h>
-#define RSYSCALL(x) ENTRY(__CONCAT(__sys_,x)); \
- .weak CNAME(x); \
- .set CNAME(x),CNAME(__CONCAT(__sys_,x)); \
- .weak CNAME(__CONCAT(_,x)); \
- .set CNAME(__CONCAT(_,x)),CNAME(__CONCAT(__sys_,x)); \
- mov __CONCAT($SYS_,x),%eax; KERNCALL; \
+#define RSYSCALL(name) ENTRY(__sys_##name); \
+ WEAK_REFERENCE(__sys_##name, name); \
+ WEAK_REFERENCE(__sys_##name, _##name); \
+ mov $SYS_##name,%eax; KERNCALL; \
jb HIDENAME(cerror); ret; \
- END(__CONCAT(__sys_,x))
+ END(__sys_##name)
-#define PSEUDO(x) ENTRY(__CONCAT(__sys_,x)); \
- .weak CNAME(__CONCAT(_,x)); \
- .set CNAME(__CONCAT(_,x)),CNAME(__CONCAT(__sys_,x)); \
- mov __CONCAT($SYS_,x),%eax; KERNCALL; \
+#define PSEUDO(name) ENTRY(__sys_##name); \
+ WEAK_REFERENCE(__sys_##name, _##name); \
+ mov $SYS_##name,%eax; KERNCALL; \
jb HIDENAME(cerror); ret; \
- END(__CONCAT(__sys_,x))
+ END(__sys_##name)
-#define KERNCALL movq %rcx, %r10; syscall
+#define KERNCALL movq %rcx, %r10; syscall
diff --git a/lib/libc/amd64/gen/_setjmp.S b/lib/libc/amd64/gen/_setjmp.S
index 9035632b3776..57079a1d4d86 100644
--- a/lib/libc/amd64/gen/_setjmp.S
+++ b/lib/libc/amd64/gen/_setjmp.S
@@ -63,8 +63,7 @@ ENTRY(_setjmp)
ret
END(_setjmp)
- .weak CNAME(_longjmp)
- .set CNAME(_longjmp),CNAME(___longjmp)
+ WEAK_REFERENCE(___longjmp, _longjmp)
ENTRY(___longjmp)
movq %rdi,%rdx
/* Restore the mxcsr, but leave exception flags intact. */
diff --git a/lib/libc/amd64/gen/setjmp.S b/lib/libc/amd64/gen/setjmp.S
index 47772be88b7b..c26f52f5b70b 100644
--- a/lib/libc/amd64/gen/setjmp.S
+++ b/lib/libc/amd64/gen/setjmp.S
@@ -73,8 +73,7 @@ ENTRY(setjmp)
ret
END(setjmp)
- .weak CNAME(longjmp)
- .set CNAME(longjmp),CNAME(__longjmp)
+ WEAK_REFERENCE(__longjmp, longjmp)
ENTRY(__longjmp)
pushq %rdi
pushq %rsi
diff --git a/lib/libc/amd64/gen/sigsetjmp.S b/lib/libc/amd64/gen/sigsetjmp.S
index ef90bc6aa723..02b154ce5fa2 100644
--- a/lib/libc/amd64/gen/sigsetjmp.S
+++ b/lib/libc/amd64/gen/sigsetjmp.S
@@ -80,8 +80,7 @@ ENTRY(sigsetjmp)
ret
END(sigsetjmp)
- .weak CNAME(siglongjmp)
- .set CNAME(siglongjmp),CNAME(__siglongjmp)
+ WEAK_REFERENCE(__siglongjmp, siglongjmp)
ENTRY(__siglongjmp)
cmpl $0,88(%rdi)
jz 2f
diff --git a/lib/libc/amd64/sys/getcontext.S b/lib/libc/amd64/sys/getcontext.S
index 112879687dac..b11e65caf580 100644
--- a/lib/libc/amd64/sys/getcontext.S
+++ b/lib/libc/amd64/sys/getcontext.S
@@ -34,10 +34,8 @@ __FBSDID("$FreeBSD$");
* Otherwise, the setcontext() syscall will return here and we'll
* pop off the return address and go to the *setcontext* call.
*/
- .weak _getcontext
- .set _getcontext,__sys_getcontext
- .weak getcontext
- .set getcontext,__sys_getcontext
+ WEAK_REFERENCE(__sys_getcontext, _getcontext)
+ WEAK_REFERENCE(__sys_getcontext, getcontext)
ENTRY(__sys_getcontext)
movq (%rsp),%rsi /* save getcontext return address */
mov $SYS_getcontext,%rax
diff --git a/lib/libc/amd64/sys/pipe.S b/lib/libc/amd64/sys/pipe.S
index 8d089db26392..806c9ae2d9e5 100644
--- a/lib/libc/amd64/sys/pipe.S
+++ b/lib/libc/amd64/sys/pipe.S
@@ -38,10 +38,8 @@ __FBSDID("$FreeBSD$");
#include "SYS.h"
- .weak _pipe
- .set _pipe,__sys_pipe
- .weak pipe
- .set pipe,__sys_pipe
+ WEAK_REFERENCE(__sys_pipe, _pipe)
+ WEAK_REFERENCE(__sys_pipe, pipe)
ENTRY(__sys_pipe)
mov $SYS_pipe,%rax
KERNCALL
diff --git a/lib/libc/amd64/sys/reboot.S b/lib/libc/amd64/sys/reboot.S
index fd04ef4b5180..b9ad1c644b4e 100644
--- a/lib/libc/amd64/sys/reboot.S
+++ b/lib/libc/amd64/sys/reboot.S
@@ -38,10 +38,8 @@ __FBSDID("$FreeBSD$");
#include "SYS.h"
- .weak _reboot
- .set _reboot,__sys_reboot
- .weak reboot
- .set reboot,__sys_reboot
+ WEAK_REFERENCE(__sys_reboot, _reboot)
+ WEAK_REFERENCE(__sys_reboot, reboot)
ENTRY(__sys_reboot)
mov $SYS_reboot,%rax
KERNCALL
diff --git a/lib/libc/amd64/sys/setlogin.S b/lib/libc/amd64/sys/setlogin.S
index 73b53641ad73..a0d127de85c2 100644
--- a/lib/libc/amd64/sys/setlogin.S
+++ b/lib/libc/amd64/sys/setlogin.S
@@ -40,10 +40,8 @@ __FBSDID("$FreeBSD$");
.globl CNAME(_logname_valid) /* in _getlogin() */
- .weak _setlogin
- .set _setlogin,__sys_setlogin
- .weak setlogin
- .set setlogin,__sys_setlogin
+ WEAK_REFERENCE(__sys_setlogin, _setlogin)
+ WEAK_REFERENCE(__sys_setlogin, setlogin)
ENTRY(__sys_setlogin)
mov $SYS_setlogin,%rax
KERNCALL
diff --git a/lib/libc/amd64/sys/vfork.S b/lib/libc/amd64/sys/vfork.S
index 2afba5830d34..62dc71e83f3e 100644
--- a/lib/libc/amd64/sys/vfork.S
+++ b/lib/libc/amd64/sys/vfork.S
@@ -38,10 +38,8 @@ __FBSDID("$FreeBSD$");
#include "SYS.h"
- .weak _vfork
- .set _vfork,__sys_vfork
- .weak vfork
- .set vfork,__sys_vfork
+ WEAK_REFERENCE(__sys_vfork, _vfork)
+ WEAK_REFERENCE(__sys_vfork, vfork)
ENTRY(__sys_vfork)
popq %rsi /* fetch return address (%rsi preserved) */
mov $SYS_vfork,%rax