Date: Wed, 1 Apr 2015 16:55:31 +0000 (UTC) From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280959 - in head/lib/libc: include sys Message-ID: <201504011655.t31GtVZq080773@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kib Date: Wed Apr 1 16:55:30 2015 New Revision: 280959 URL: https://svnweb.freebsd.org/changeset/base/280959 Log: Correctly handle __fcntl_compat symbol for the !SYSCALL_COMPAT case. Both .weak and .alias assembler directives only work when assembling the file which defines the symbol. Reported and tested by: andrew Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/lib/libc/include/compat.h head/lib/libc/sys/fcntl.c Modified: head/lib/libc/include/compat.h ============================================================================== --- head/lib/libc/include/compat.h Wed Apr 1 16:17:58 2015 (r280958) +++ head/lib/libc/include/compat.h Wed Apr 1 16:55:30 2015 (r280959) @@ -44,5 +44,14 @@ __sym_compat(shmctl, freebsd7_shmctl, FB #undef __sym_compat +#define __weak_reference(sym,alias) \ + .weak alias;.equ alias,sym + +#ifndef SYSCALL_COMPAT +__weak_reference(__sys_fcntl,__fcntl_compat) +#endif + +#undef __weak_reference + #endif /* __LIBC_COMPAT_H__ */ Modified: head/lib/libc/sys/fcntl.c ============================================================================== --- head/lib/libc/sys/fcntl.c Wed Apr 1 16:17:58 2015 (r280958) +++ head/lib/libc/sys/fcntl.c Wed Apr 1 16:55:30 2015 (r280959) @@ -103,7 +103,4 @@ __fcntl_compat(int fd, int cmd, ...) return (__sys_fcntl(fd, cmd, arg)); } } -#else -__weak_reference(__sys_fcntl, __fcntl_compat); -__weak_reference(__sys_fcntl, __fcntl); #endif
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201504011655.t31GtVZq080773>