summary refs log tree commit diff
path: root/resolv
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2017-06-30 11:31:41 +0200
committerFlorian Weimer <fweimer@redhat.com>2017-06-30 11:31:41 +0200
commit6781d8e693eb9e1251875222db5c9885d7ebb596 (patch)
tree1d1aadb852c3fbaec07e0b22de9f6259f6c7e83f /resolv
parentd85f99679d89fb47426301620b7a980388fddcfd (diff)
downloadglibc-6781d8e693eb9e1251875222db5c9885d7ebb596.tar.gz
glibc-6781d8e693eb9e1251875222db5c9885d7ebb596.tar.xz
glibc-6781d8e693eb9e1251875222db5c9885d7ebb596.zip
resolv: Turn _res_opcodes into a compatibility symbol
Diffstat (limited to 'resolv')
-rw-r--r--resolv/res_debug.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/resolv/res_debug.c b/resolv/res_debug.c
index 182aeefa1f..55d1fe9f89 100644
--- a/resolv/res_debug.c
+++ b/resolv/res_debug.c
@@ -106,6 +106,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <time.h>
+#include <shlib-compat.h>
 
 #ifdef SPRINTF_CHAR
 # define SPRINTF(x) strlen(sprintf/**/x)
@@ -115,7 +116,12 @@
 
 extern const char *_res_sectioncodes[] attribute_hidden;
 
-const char *_res_opcodes[] =
+/* _res_opcodes was exported by accident as a variable.  */
+#if SHLIB_COMPAT (libresolv, GLIBC_2_0, GLIBC_2_26)
+static const char *res_opcodes[] =
+#else
+static const char res_opcodes[][9] =
+#endif
   {
     "QUERY",
     "IQUERY",
@@ -134,7 +140,9 @@ const char *_res_opcodes[] =
     "ZONEINIT",
     "ZONEREF",
   };
-libresolv_hidden_data_def (_res_opcodes)
+#if SHLIB_COMPAT (libresolv, GLIBC_2_0, GLIBC_2_26)
+strong_alias (res_opcodes, _res_opcodes)
+#endif
 
 static const char *p_section(int section, int opcode);
 
@@ -259,7 +267,7 @@ fp_nquery (const unsigned char *msg, int len, FILE *file)
 	if ((!pfcode) || (pfcode & RES_PRF_HEADX) || rcode)
 		fprintf(file,
 			";; ->>HEADER<<- opcode: %s, status: %s, id: %d\n",
-			_res_opcodes[opcode], p_rcode(rcode), id);
+			res_opcodes[opcode], p_rcode(rcode), id);
 	if ((!pfcode) || (pfcode & RES_PRF_HEADX))
 		putc(';', file);
 	if ((!pfcode) || (pfcode & RES_PRF_HEAD2)) {