From owner-svn-src-all@FreeBSD.ORG Thu Nov 21 22:31:21 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0629DA0E; Thu, 21 Nov 2013 22:31:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DA58E2C23; Thu, 21 Nov 2013 22:31:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rALMVKuK088939; Thu, 21 Nov 2013 22:31:20 GMT (envelope-from andreast@svn.freebsd.org) Received: (from andreast@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rALMVIJs088924; Thu, 21 Nov 2013 22:31:18 GMT (envelope-from andreast@svn.freebsd.org) Message-Id: <201311212231.rALMVIJs088924@svn.freebsd.org> From: Andreas Tobler Date: Thu, 21 Nov 2013 22:31:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258451 - in head: lib/libc/i386 lib/libc/i386/gen lib/libc/i386/string lib/libc/i386/sys lib/libkse/arch/i386/i386 sys/i386/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Nov 2013 22:31:21 -0000 Author: andreast Date: Thu Nov 21 22:31:18 2013 New Revision: 258451 URL: http://svnweb.freebsd.org/changeset/base/258451 Log: Replace the WEAK_ALIAS() alias with the WEAK_REFERENCE() alias. Use it and get rid of the __CONCAT and CNAME macros. Reviewed by: bde, kib Modified: head/lib/libc/i386/SYS.h head/lib/libc/i386/gen/_setjmp.S head/lib/libc/i386/gen/setjmp.S head/lib/libc/i386/gen/sigsetjmp.S head/lib/libc/i386/string/strchr.S head/lib/libc/i386/string/strrchr.S head/lib/libc/i386/sys/Ovfork.S head/lib/libc/i386/sys/getcontext.S head/lib/libkse/arch/i386/i386/thr_getcontext.S head/sys/i386/include/asm.h Modified: head/lib/libc/i386/SYS.h ============================================================================== --- head/lib/libc/i386/SYS.h Thu Nov 21 22:17:55 2013 (r258450) +++ head/lib/libc/i386/SYS.h Thu Nov 21 22:31:18 2013 (r258451) @@ -36,22 +36,19 @@ #include #include -#define SYSCALL(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; \ - jb HIDENAME(cerror) +#define SYSCALL(name) ENTRY(__sys_##name); \ + WEAK_REFERENCE(__sys_##name, name); \ + WEAK_REFERENCE(__sys_##name, _##name); \ + mov $SYS_##name,%eax; KERNCALL; \ + jb HIDENAME(cerror) -#define RSYSCALL(x) SYSCALL(x); ret; END(__CONCAT(__sys_,x)) +#define RSYSCALL(name) SYSCALL(name); ret; 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; \ - jb HIDENAME(cerror); ret; \ - END(__CONCAT(__sys_,x)) +#define PSEUDO(name) ENTRY(__sys_##name); \ + WEAK_REFERENCE(__sys_##name, _##name); \ + mov $SYS_##name,%eax; KERNCALL; \ + jb HIDENAME(cerror); ret; \ + END(__sys_##name) /* gas messes up offset -- although we don't currently need it, do for BCS */ #define LCALL(x,y) .byte 0x9a ; .long y; .word x Modified: head/lib/libc/i386/gen/_setjmp.S ============================================================================== --- head/lib/libc/i386/gen/_setjmp.S Thu Nov 21 22:17:55 2013 (r258450) +++ head/lib/libc/i386/gen/_setjmp.S Thu Nov 21 22:31:18 2013 (r258451) @@ -60,8 +60,7 @@ ENTRY(_setjmp) ret END(_setjmp) - .weak CNAME(_longjmp) - .set CNAME(_longjmp),CNAME(___longjmp) + WEAK_REFERENCE(___longjmp, _longjmp) ENTRY(___longjmp) movl 4(%esp),%edx movl 8(%esp),%eax Modified: head/lib/libc/i386/gen/setjmp.S ============================================================================== --- head/lib/libc/i386/gen/setjmp.S Thu Nov 21 22:17:55 2013 (r258450) +++ head/lib/libc/i386/gen/setjmp.S Thu Nov 21 22:31:18 2013 (r258451) @@ -78,8 +78,7 @@ ENTRY(setjmp) ret END(setjmp) - .weak CNAME(longjmp) - .set CNAME(longjmp),CNAME(__longjmp) + WEAK_REFERENCE(__longjmp, longjmp) ENTRY(__longjmp) movl 4(%esp),%edx PIC_PROLOGUE Modified: head/lib/libc/i386/gen/sigsetjmp.S ============================================================================== --- head/lib/libc/i386/gen/sigsetjmp.S Thu Nov 21 22:17:55 2013 (r258450) +++ head/lib/libc/i386/gen/sigsetjmp.S Thu Nov 21 22:31:18 2013 (r258451) @@ -87,8 +87,7 @@ ENTRY(sigsetjmp) ret END(sigsetjmp) - .weak CNAME(siglongjmp); - .set CNAME(siglongjmp),CNAME(__siglongjmp) + WEAK_REFERENCE(__siglongjmp, siglongjmp) ENTRY(__siglongjmp) movl 4(%esp),%edx cmpl $0,44(%edx) Modified: head/lib/libc/i386/string/strchr.S ============================================================================== --- head/lib/libc/i386/string/strchr.S Thu Nov 21 22:17:55 2013 (r258450) +++ head/lib/libc/i386/string/strchr.S Thu Nov 21 22:31:18 2013 (r258451) @@ -63,6 +63,6 @@ L2: ret END(strchr) -WEAK_ALIAS(index, strchr) +WEAK_REFERENCE(strchr, index) .section .note.GNU-stack,"",%progbits Modified: head/lib/libc/i386/string/strrchr.S ============================================================================== --- head/lib/libc/i386/string/strrchr.S Thu Nov 21 22:17:55 2013 (r258450) +++ head/lib/libc/i386/string/strrchr.S Thu Nov 21 22:31:18 2013 (r258451) @@ -64,6 +64,6 @@ L2: ret END(strrchr) -WEAK_ALIAS(rindex, strrchr) +WEAK_REFERENCE(strrchr, rindex) .section .note.GNU-stack,"",%progbits Modified: head/lib/libc/i386/sys/Ovfork.S ============================================================================== --- head/lib/libc/i386/sys/Ovfork.S Thu Nov 21 22:17:55 2013 (r258450) +++ head/lib/libc/i386/sys/Ovfork.S Thu Nov 21 22:31:18 2013 (r258451) @@ -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) popl %ecx /* my rta into ecx */ mov $SYS_vfork,%eax Modified: head/lib/libc/i386/sys/getcontext.S ============================================================================== --- head/lib/libc/i386/sys/getcontext.S Thu Nov 21 22:17:55 2013 (r258450) +++ head/lib/libc/i386/sys/getcontext.S Thu Nov 21 22:31:18 2013 (r258451) @@ -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) movl (%esp),%ecx /* save getcontext return address */ mov $SYS_getcontext,%eax Modified: head/lib/libkse/arch/i386/i386/thr_getcontext.S ============================================================================== --- head/lib/libkse/arch/i386/i386/thr_getcontext.S Thu Nov 21 22:17:55 2013 (r258450) +++ head/lib/libkse/arch/i386/i386/thr_getcontext.S Thu Nov 21 22:31:18 2013 (r258451) @@ -50,8 +50,7 @@ __FBSDID("$FreeBSD$"); * * Returns 0 if there are no errors; -1 otherwise */ - .weak CNAME(_thr_setcontext) - .set CNAME(_thr_setcontext),CNAME(__thr_setcontext) + WEAK_REFERENCE(__thr_setcontext, _thr_setcontext) ENTRY(__thr_setcontext) movl 4(%esp), %edx /* get address of mcontext */ cmpl $0, %edx /* check for null pointer */ @@ -116,8 +115,7 @@ ENTRY(__thr_setcontext) * Returns -1 if there is an error, 0 no errors; 1 upon return * from a setcontext(). */ - .weak CNAME(_thr_getcontext) - .set CNAME(_thr_getcontext),CNAME(__thr_getcontext) + WEAK_REFERENCE(__thr_getcontext, _thr_getcontext) ENTRY(__thr_getcontext) pushl %edx /* save edx */ movl 8(%esp), %edx /* get address of mcontext */ Modified: head/sys/i386/include/asm.h ============================================================================== --- head/sys/i386/include/asm.h Thu Nov 21 22:17:55 2013 (r258450) +++ head/sys/i386/include/asm.h Thu Nov 21 22:31:18 2013 (r258451) @@ -91,11 +91,15 @@ #endif /* - * WEAK_ALIAS: create a weak alias. + * WEAK_REFERENCE(): create a weak reference alias from sym. + * The macro is not a general asm macro that takes arbitrary names, + * but one that takes only C names. It does the non-null name + * translation inside the macro. */ -#define WEAK_ALIAS(alias,sym) \ - .weak alias; \ - alias = sym + +#define WEAK_REFERENCE(sym, alias) \ + .weak CNAME(alias); \ + .equ CNAME(alias),CNAME(sym) /* * STRONG_ALIAS: create a strong alias.