]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Suppress incorrect link warnings for NSS symbols
authorChris Metcalf <cmetcalf@tilera.com>
Tue, 30 Oct 2012 18:14:33 +0000 (14:14 -0400)
committerChris Metcalf <cmetcalf@tilera.com>
Tue, 30 Oct 2012 18:14:33 +0000 (14:14 -0400)
When glibc is built with --enable-static-nss, the warning that
using NSS symbols requires the nss shared objects to be present
is no longer true, as those symbols are built into libc.  Suppress
the warning for those symbols by providing a new macro
(nss_interface_function) for the NSS functions that is defined as
static_link_warning in the normal case, and empty for static NSS.

ChangeLog
grp/initgroups.c
nss/getXXbyYY.c
nss/getXXbyYY_r.c
nss/getXXent.c
nss/getXXent_r.c
nss/nsswitch.h
sysdeps/posix/getaddrinfo.c

index 021b0cd005efc2d5b0b4790cbdecfdb0072e9b5e..e65ea2354e2caf3a1ab53486cc7559c154fbd137 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2012-10-30  Chris Metcalf  <cmetcalf@tilera.com>
+
+       * nss/nsswitch.h (nss_interface_function): Provide new
+       macro for use with NSS functions.
+       * grp/initgroups.c: Use new macro.
+       * nss/getXXbyYY.c: Likewise.
+       * nss/getXXbyYY_r.c: Likewise.
+       * nss/getXXent.c: Likewise.
+       * nss/getXXent_r.c: Likewise.
+       * sysdeps/posix/getaddrinfo.c: Likewise.
+
 2012-10-30  Andreas Jaeger  <aj@suse.de>
 
        * po/ru.po: Update Russion translation from translation project.
index 62fd1fc6de5f9ea08f31134c5ab9a36ae2d5af9e..fad30a75f0161269a8a2f389cd842fdba2fc8318 100644 (file)
@@ -180,7 +180,7 @@ getgrouplist (const char *user, gid_t group, gid_t *groups, int *ngroups)
   return retval;
 }
 
-static_link_warning (getgrouplist)
+nss_interface_function (getgrouplist)
 
 /* Initialize the group set for the current user
    by reading the group database and using all groups
@@ -230,4 +230,4 @@ initgroups (const char *user, gid_t group)
 #endif
 }
 
-static_link_warning (initgroups)
+nss_interface_function (initgroups)
index 336676ad555a0e7905318a11bbd0f9fc57fe8793..c308a70b93ba8a7759931f1b6c526fd1fc3bfe4e 100644 (file)
@@ -151,4 +151,4 @@ done:
   return result;
 }
 
-static_link_warning (FUNCTION_NAME)
+nss_interface_function (FUNCTION_NAME)
index f296ed1f42e5b4d3e0c1f08e7c80b3590aa3bb22..8b3b61b663e446b1159ad5d19328352b5e6f2381 100644 (file)
@@ -349,4 +349,4 @@ do_default_symbol_version (NEW (REENTRANT_NAME),
                           REENTRANT_NAME, GLIBC_2_1_2);
 #endif
 
-static_link_warning (REENTRANT_NAME)
+nss_interface_function (REENTRANT_NAME)
index 008851e5976c3153cb5d01c01e4996a5f5f769d9..152798f0c27a025150da7d0916cd02501c3ef913 100644 (file)
@@ -91,4 +91,4 @@ GETFUNC_NAME (void)
   return result;
 }
 
-static_link_warning (GETFUNC_NAME)
+nss_interface_function (GETFUNC_NAME)
index f1036058ff68d313f209547ebc1431529424642f..6c52d27cb2a79677488c4150c2dc1a0658de0474 100644 (file)
@@ -207,6 +207,6 @@ do_default_symbol_version (NEW (REENTRANT_GETNAME),
                           REENTRANT_GETNAME, GLIBC_2_1_2);
 #endif
 
-static_link_warning (SETFUNC_NAME)
-static_link_warning (ENDFUNC_NAME)
-static_link_warning (REENTRANT_GETNAME)
+nss_interface_function (SETFUNC_NAME)
+nss_interface_function (ENDFUNC_NAME)
+nss_interface_function (REENTRANT_GETNAME)
index 047a9e5858f1b3de256e1a1443aff21f9d16e41d..0cf67ff0258a11bca501a7a6c1e503eae30b7749 100644 (file)
@@ -107,6 +107,14 @@ enum
 /* Flags whether custom rules for database is set.  */
 extern bool __nss_database_custom[NSS_DBSIDX_max];
 
+/* Warning for NSS functions, which don't require dlopen if glibc
+   was built with --enable-static-nss.  */
+#ifdef DO_STATIC_NSS
+# define nss_interface_function(name)
+#else
+# define nss_interface_function(name) static_link_warning (name)
+#endif
+
 
 /* Interface functions for NSS.  */
 
index 672571ef2396f120aa1b5bb9df3bb887884204d8..3cc244b7fd19381a89d99f8026bae4db42336497 100644 (file)
@@ -2672,7 +2672,7 @@ getaddrinfo (const char *name, const char *service,
 }
 libc_hidden_def (getaddrinfo)
 
-static_link_warning (getaddrinfo)
+nss_interface_function (getaddrinfo)
 
 void
 freeaddrinfo (struct addrinfo *ai)