This is the mail archive of the libc-hacker@sources.redhat.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Export _res_opcodes, __p_class_syms and __p_type_syms from libresolv.so again


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]