Author: emaste
Date: Tue Dec  5 20:19:13 2017
New Revision: 326576
URL: https://svnweb.freebsd.org/changeset/base/326576

Log:
  use @@@ instead of @@ in __sym_default
  
  Using
      .symver foo,foo@@VER
  causes foo and foo@@VER to be output to the .o file. This requires foo
  to be weak since the linker handles foo@@VER as foo.
  
  Using
      .symver foo,foo@@@VER
  causes just foo@@ver to be output and avoid the need for making foo
  weak. It also reduces the constraint on how exactly a linker has to
  handle foo and foo@@VER being present.
  
  Submitted by: Rafael EspĂ­ndola
  Reviewed by:  dim, kib
  Differential Revision:        https://reviews.freebsd.org/D11653

Modified:
  head/lib/libc/sys/openat.c
  head/lib/libc/sys/setcontext.c
  head/lib/libc/sys/swapcontext.c
  head/sys/sys/cdefs.h

Modified: head/lib/libc/sys/openat.c
==============================================================================
--- head/lib/libc/sys/openat.c  Tue Dec  5 20:06:53 2017        (r326575)
+++ head/lib/libc/sys/openat.c  Tue Dec  5 20:19:13 2017        (r326576)
@@ -43,7 +43,6 @@ __sym_compat(openat, __impl_openat, FBSD_1.1);
 __weak_reference(openat, __impl_openat);
 __sym_default(openat, openat, FBSD_1.2);
 
-#pragma weak openat
 int
 openat(int fd, const char *path, int flags, ...)
 {

Modified: head/lib/libc/sys/setcontext.c
==============================================================================
--- head/lib/libc/sys/setcontext.c      Tue Dec  5 20:06:53 2017        
(r326575)
+++ head/lib/libc/sys/setcontext.c      Tue Dec  5 20:19:13 2017        
(r326576)
@@ -42,7 +42,6 @@ __sym_compat(setcontext, __impl_setcontext, FBSD_1.0);
 __weak_reference(setcontext, __impl_setcontext);
 __sym_default(setcontext, setcontext, FBSD_1.2);
 
-#pragma weak setcontext
 int
 setcontext(const ucontext_t *uc)
 {

Modified: head/lib/libc/sys/swapcontext.c
==============================================================================
--- head/lib/libc/sys/swapcontext.c     Tue Dec  5 20:06:53 2017        
(r326575)
+++ head/lib/libc/sys/swapcontext.c     Tue Dec  5 20:19:13 2017        
(r326576)
@@ -43,7 +43,6 @@ __sym_compat(swapcontext, __impl_swapcontext, FBSD_1.0
 __weak_reference(swapcontext, __impl_swapcontext);
 __sym_default(swapcontext, swapcontext, FBSD_1.2);
 
-#pragma weak swapcontext
 int
 swapcontext(ucontext_t *oucp, const ucontext_t *ucp)
 {

Modified: head/sys/sys/cdefs.h
==============================================================================
--- head/sys/sys/cdefs.h        Tue Dec  5 20:06:53 2017        (r326575)
+++ head/sys/sys/cdefs.h        Tue Dec  5 20:19:13 2017        (r326576)
@@ -551,7 +551,7 @@
 #define        __sym_compat(sym,impl,verid)    \
        __asm__(".symver " #impl ", " #sym "@" #verid)
 #define        __sym_default(sym,impl,verid)   \
-       __asm__(".symver " #impl ", " #sym "@@" #verid)
+       __asm__(".symver " #impl ", " #sym "@@@" #verid)
 #else
 #define        __weak_reference(sym,alias)     \
        __asm__(".weak alias");         \
@@ -563,7 +563,7 @@
 #define        __sym_compat(sym,impl,verid)    \
        __asm__(".symver impl, sym@verid")
 #define        __sym_default(impl,sym,verid)   \
-       __asm__(".symver impl, sym@@verid")
+       __asm__(".symver impl, sym@@@verid")
 #endif /* __STDC__ */
 #endif /* __GNUC__ || __INTEL_COMPILER */
 
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to