summaryrefslogtreecommitdiff
path: root/libc/debian/patches/libsocket-binutils-2.23-weak.patch
blob: 0ca39c775ed313696a92df390a2d16d0cf586465 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
Description: redefine_extname sets socket to __xnet_socket,
 and "#pragma weak socket _socket" becomes "#pragma __xnet_socket _socket",
 and thus __xnet_socket is multiple defined in assembler code. Similar for
 other weaks, but "bind" for example is not defined at all.
 Put all weak pragmas before headers so redefine_extname is not in action.
Index: libc/usr/src/lib/libsocket/socket/socket.c
===================================================================
--- libc.orig/usr/src/lib/libsocket/socket/socket.c	2012-10-08 04:25:42.000000000 +0400
+++ libc/usr/src/lib/libsocket/socket/socket.c	2013-08-29 10:44:24.704027938 +0400
@@ -35,6 +35,8 @@
  * contributors.
  */
 
+#pragma weak socket = _socket
+
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <sys/stropts.h>
@@ -50,8 +52,6 @@
 
 int _socket_create(int, int, int, int);
 
-#pragma weak socket = _socket
-
 int
 _socket(int family, int type, int protocol)
 {
Index: libc/usr/src/lib/libsocket/socket/socketpair.c
===================================================================
--- libc.orig/usr/src/lib/libsocket/socket/socketpair.c	2012-10-08 04:25:42.000000000 +0400
+++ libc/usr/src/lib/libsocket/socket/socketpair.c	2013-08-29 10:44:39.553764223 +0400
@@ -39,6 +39,8 @@
 
 #pragma ident	"%Z%%M%	%I%	%E% SMI"
 
+#pragma weak socketpair = _socketpair
+
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <sys/stropts.h>
@@ -53,8 +55,6 @@
 
 int _socketpair_create(int, int, int, int*, int);
 
-#pragma weak socketpair = _socketpair
-
 int
 _socketpair(int family, int type, int protocol, int sv[2])
 {
Index: libc/usr/src/lib/libsocket/socket/weaks.c
===================================================================
--- libc.orig/usr/src/lib/libsocket/socket/weaks.c	2012-10-08 04:25:42.000000000 +0400
+++ libc/usr/src/lib/libsocket/socket/weaks.c	2013-08-29 10:44:09.838229775 +0400
@@ -26,21 +26,6 @@
 
 #pragma ident	"%Z%%M%	%I%	%E% SMI"
 
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/stropts.h>
-#include <sys/stream.h>
-#include <sys/socketvar.h>
-#include <sys/sockio.h>
-
-#include <errno.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <stropts.h>
-#include <stdio.h>
-#include <strings.h>
-#include <netinet/sctp.h>
-
 #pragma weak bind = _bind
 #pragma weak listen = _listen
 #pragma weak accept = _accept
@@ -57,6 +42,21 @@
 #pragma weak getsockopt = _getsockopt
 #pragma weak setsockopt = _setsockopt
 
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/stropts.h>
+#include <sys/stream.h>
+#include <sys/socketvar.h>
+#include <sys/sockio.h>
+
+#include <errno.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <stropts.h>
+#include <stdio.h>
+#include <strings.h>
+#include <netinet/sctp.h>
+
 extern int _so_bind();
 extern int _so_listen();
 extern int _so_accept();