public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Export _res_opcodes, __p_class_syms and __p_type_syms from libresolv.so again
@ 2004-10-27 21:09 Jakub Jelinek
  0 siblings, 0 replies; only message in thread
From: Jakub Jelinek @ 2004-10-27 21:09 UTC (permalink / raw)
  To: Ulrich Drepper; +Cc: Glibc hackers

Hi!

_res_opcodes and __p_{class,type}_syms were until the 2004-10-17
patch exported from libresolv.so.  The following patch restores
the exports, but given that they are const arrays and we really don't
want binaries to change the values in them by declaring the arrays
themselves, it is ok if libresolv.so uses always the arrays within
itself.  If a binary makes a copy relocation for one of these
arrays, there simply will be two different read-only arrays,
which will not cause problems.

2004-10-27  Jakub Jelinek  <jakub@redhat.com>

	* include/resolv.h (_res_opcodes): New extern.
	Add libresolv_hidden_proto.
	* resolv/res_debug.c (_res_opcodes): Remove.
	(__p_class_syms, __p_type_syms): Add libresolv_hidden_proto
	and libresolv_hidden_data_def.  Remove attribute_hidden.
	* resolv/res_mkquery (_res_opcodes): Remove.
	* resolv/res_data.c (_res_opcodes): Remove attribute_hidden.
	Add libresolv_hidden_data_def.

--- libc/include/resolv.h.jj	2004-10-18 10:20:44.000000000 +0200
+++ libc/include/resolv.h	2004-10-27 22:44:16.214535888 +0200
@@ -98,6 +98,9 @@ libresolv_hidden_proto (__ns_name_unpack
 libresolv_hidden_proto (__ns_get16)
 libresolv_hidden_proto (__ns_get32)
 
+extern const char *_res_opcodes[];
+libresolv_hidden_proto (_res_opcodes)
+
 #endif
 
 #endif
--- libc/resolv/res_debug.c.jj	2004-10-18 10:20:56.000000000 +0200
+++ libc/resolv/res_debug.c	2004-10-27 22:56:46.937227601 +0200
@@ -118,7 +118,6 @@ static const char rcsid[] = "$BINDId: re
 # define SPRINTF(x) sprintf x
 #endif
 
-extern const char *_res_opcodes[] attribute_hidden;
 extern const char *_res_sectioncodes[] attribute_hidden;
 
 /*
@@ -349,7 +348,9 @@ p_fqname(const u_char *cp, const u_char 
  * that C_ANY is a qclass but not a class.  (You can ask for records of class
  * C_ANY, but you can't have any records of that class in the database.)
  */
-const struct res_sym __p_class_syms[] attribute_hidden = {
+extern const struct res_sym __p_class_syms[];
+libresolv_hidden_proto (__p_class_syms)
+const struct res_sym __p_class_syms[] = {
 	{C_IN,		"IN"},
 	{C_CHAOS,	"CHAOS"},
 	{C_HS,		"HS"},
@@ -358,6 +359,7 @@ const struct res_sym __p_class_syms[] at
 	{C_NONE,	"NONE"},
 	{C_IN, 		(char *)0}
 };
+libresolv_hidden_data_def (__p_class_syms)
 
 /*
  * Names of message sections.
@@ -401,7 +403,9 @@ const struct res_sym __p_cert_syms[] att
  * that T_ANY is a qtype but not a type.  (You can ask for records of type
  * T_ANY, but you can't have any records of that type in the database.)
  */
-const struct res_sym __p_type_syms[] attribute_hidden = {
+extern const struct res_sym __p_type_syms[];
+libresolv_hidden_proto (__p_type_syms)
+const struct res_sym __p_type_syms[] = {
 	{ns_t_a,	"A",		"address"},
 	{ns_t_ns,	"NS",		"name server"},
 	{ns_t_md,	"MD",		"mail destination (deprecated)"},
@@ -448,6 +452,7 @@ const struct res_sym __p_type_syms[] att
 	{ns_t_any,	"ANY",		"\"any\""},
 	{0, 		NULL,		NULL}
 };
+libresolv_hidden_data_def (__p_type_syms)
 
 /*
  * Names of DNS rcodes.
--- libc/resolv/res_mkquery.c.jj	2004-10-18 10:20:56.000000000 +0200
+++ libc/resolv/res_mkquery.c	2004-10-27 22:44:29.171235124 +0200
@@ -88,8 +88,6 @@ static const char rcsid[] = "$BINDId: re
 # endif
 #endif
 
-extern const char *_res_opcodes[];
-
 /*
  * Form all types of queries.
  * Returns the size of the result or -1.
--- libc/resolv/res_data.c.jj	2004-10-18 10:20:56.000000000 +0200
+++ libc/resolv/res_data.c	2004-10-27 22:45:26.053134419 +0200
@@ -39,7 +39,7 @@ static const char rcsid[] = "$BINDId: re
 #include <string.h>
 #include <unistd.h>
 
-const char *_res_opcodes[] attribute_hidden = {
+const char *_res_opcodes[] = {
 	"QUERY",
 	"IQUERY",
 	"CQUERYM",
@@ -57,6 +57,7 @@ const char *_res_opcodes[] attribute_hid
 	"ZONEINIT",
 	"ZONEREF",
 };
+libresolv_hidden_data_def (_res_opcodes)
 
 #ifdef BIND_UPDATE
 const char *_res_sectioncodes[] attribute_hidden = {

	Jakub

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-10-27 21:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-27 21:09 [PATCH] Export _res_opcodes, __p_class_syms and __p_type_syms from libresolv.so again Jakub Jelinek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).