Skip to content

Commit

Permalink
Update.
Browse files Browse the repository at this point in the history
2004-10-17  Ulrich Drepper  <drepper@redhat.com>

	* include/libc-symbols.h: Define libresolv_hidden_proto and friends.
	* include/resolv.h: Add libresolv_hidden_proto for symbols defined,
	used, and exported in libresolv.
	* resolv/base64.c: Add libresolv_hidden_def.
	* resolv/gethnamaddr.c: Likewise.
	* resolv/ns_name.c: Likewise.
	* resolv/ns_netint.c: Likewise.
	* resolv/res_comp.c: Likewise.
	* resolv/res_data.c: Likewise.
	* resolv/res_debug.c: Likewise.
	* resolv/res_mkquery.c: Likewise.
	* resolv/res_query.c: Likewise.
	* resolv/res_send.c: Likewise.
  • Loading branch information
Ulrich Drepper committed Oct 18, 2004
1 parent b11816b commit 6f9d8e6
Show file tree
Hide file tree
Showing 13 changed files with 136 additions and 21 deletions.
16 changes: 16 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
2004-10-17 Ulrich Drepper <drepper@redhat.com>

* include/libc-symbols.h: Define libresolv_hidden_proto and friends.
* include/resolv.h: Add libresolv_hidden_proto for symbols defined,
used, and exported in libresolv.
* resolv/base64.c: Add libresolv_hidden_def.
* resolv/gethnamaddr.c: Likewise.
* resolv/ns_name.c: Likewise.
* resolv/ns_netint.c: Likewise.
* resolv/res_comp.c: Likewise.
* resolv/res_data.c: Likewise.
* resolv/res_debug.c: Likewise.
* resolv/res_mkquery.c: Likewise.
* resolv/res_query.c: Likewise.
* resolv/res_send.c: Likewise.

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

* elf/dl-minimal.c (__chk_fail): New. Add rtld_hidden_def.
Expand Down
18 changes: 18 additions & 0 deletions include/libc-symbols.h
Original file line number Diff line number Diff line change
Expand Up @@ -744,6 +744,24 @@ for linking")
# define libm_hidden_data_ver(local, name)
#endif

#if defined NOT_IN_libc && defined IS_IN_libresolv
# define libresolv_hidden_proto(name, attrs...) hidden_proto (name, ##attrs)
# define libresolv_hidden_def(name) hidden_def (name)
# define libresolv_hidden_weak(name) hidden_weak (name)
# define libresolv_hidden_ver(local, name) hidden_ver (local, name)
# define libresolv_hidden_data_def(name) hidden_data_def (name)
# define libresolv_hidden_data_weak(name) hidden_data_weak (name)
# define libresolv_hidden_data_ver(local, name) hidden_data_ver (local, name)
#else
# define libresolv_hidden_proto(name, attrs...)
# define libresolv_hidden_def(name)
# define libresolv_hidden_weak(name)
# define libresolv_hidden_ver(local, name)
# define libresolv_hidden_data_def(name)
# define libresolv_hidden_data_weak(name)
# define libresolv_hidden_data_ver(local, name)
#endif

#ifdef HAVE_BUILTIN_REDIRECTION
# define libc_hidden_builtin_proto(name, attrs...) libc_hidden_proto (name, ##attrs)
# define libc_hidden_builtin_def(name) libc_hidden_def (name)
Expand Down
38 changes: 38 additions & 0 deletions include/resolv.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,44 @@ int __libc_res_nsend (res_state, const u_char *, int, u_char *, int,
u_char **)
attribute_hidden;

libresolv_hidden_proto (_sethtent)
libresolv_hidden_proto (_gethtent)
libresolv_hidden_proto (_gethtbyaddr)
libresolv_hidden_proto (_gethtbyname2)
libresolv_hidden_proto (__dn_expand)
libresolv_hidden_proto (__dn_comp)
libresolv_hidden_proto (__dn_skipname)
libresolv_hidden_proto (__res_hnok)
libresolv_hidden_proto (__res_dnok)
libresolv_hidden_proto (__putlong)
libresolv_hidden_proto (__putshort)
libresolv_hidden_proto (__p_cdnname)
libresolv_hidden_proto (__p_fqnname)
libresolv_hidden_proto (__p_option)
libresolv_hidden_proto (__sym_ntos)
libresolv_hidden_proto (__p_rcode)
libresolv_hidden_proto (__p_class)
libresolv_hidden_proto (__p_type)
libresolv_hidden_proto (__loc_ntoa)
libresolv_hidden_proto (__fp_nquery)
libresolv_hidden_proto (__fp_query)
libresolv_hidden_proto (__hostalias)
libresolv_hidden_proto (__res_nmkquery)
libresolv_hidden_proto (__libc_res_nquery)
libresolv_hidden_proto (__res_nquery)
libresolv_hidden_proto (__res_nquerydomain)
libresolv_hidden_proto (__res_hostalias)
libresolv_hidden_proto (__libc_res_nsearch)
libresolv_hidden_proto (__res_nsearch)
libresolv_hidden_proto (__res_nameinquery)
libresolv_hidden_proto (__res_queriesmatch)
libresolv_hidden_proto (__res_nsend)
libresolv_hidden_proto (__b64_ntop)
libresolv_hidden_proto (__ns_name_ntop)
libresolv_hidden_proto (__ns_name_unpack)
libresolv_hidden_proto (__ns_get16)
libresolv_hidden_proto (__ns_get32)

#endif

#endif
9 changes: 5 additions & 4 deletions resolv/base64.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,9 @@ static const char Pad64 = '=';
end of the data is performed using the '=' character.
Since all base64 input is an integral number of octets, only the
-------------------------------------------------
-------------------------------------------------
following cases can arise:
(1) the final quantum of encoding input is an integral
multiple of 24 bits; here, the final unit of encoded
output will be an integral multiple of 4 characters
Expand Down Expand Up @@ -156,14 +156,14 @@ b64_ntop(u_char const *src, size_t srclength, char *target, size_t targsize) {
target[datalength++] = Base64[output[2]];
target[datalength++] = Base64[output[3]];
}

/* Now we worry about padding. */
if (0 != srclength) {
/* Get what's left. */
input[0] = input[1] = input[2] = '\0';
for (i = 0; i < srclength; i++)
input[i] = *src++;

output[0] = input[0] >> 2;
output[1] = ((input[0] & 0x03) << 4) + (input[1] >> 4);
output[2] = ((input[1] & 0x0f) << 2) + (input[2] >> 6);
Expand All @@ -186,6 +186,7 @@ b64_ntop(u_char const *src, size_t srclength, char *target, size_t targsize) {
target[datalength] = '\0'; /* Returned value doesn't count \0. */
return (datalength);
}
libresolv_hidden_def (b64_ntop)

/* skips all whitespace anywhere.
converts characters, four at a time, starting at (or after)
Expand Down
8 changes: 8 additions & 0 deletions resolv/gethnamaddr.c
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,9 @@ getanswer(answer, anslen, qname, qtype)
return (NULL);
}

extern struct hostent *gethostbyname2(const char *name, int af);
libresolv_hidden_proto (gethostbyname2)

struct hostent *
gethostbyname(name)
const char *name;
Expand Down Expand Up @@ -637,6 +640,7 @@ gethostbyname2(name, af)
free (buf.buf);
return ret;
}
libresolv_hidden_def (gethostbyname2)

struct hostent *
gethostbyaddr(addr, len, af)
Expand Down Expand Up @@ -795,6 +799,7 @@ _sethtent(f)
rewind(hostf);
stayopen = f;
}
libresolv_hidden_def (_sethtent)

void
_endhtent()
Expand Down Expand Up @@ -869,6 +874,7 @@ _gethtent()
__set_h_errno (NETDB_SUCCESS);
return (&host);
}
libresolv_hidden_def (_gethtent)

struct hostent *
_gethtbyname(name)
Expand Down Expand Up @@ -907,6 +913,7 @@ _gethtbyname2(name, af)
_endhtent();
return (p);
}
libresolv_hidden_def (_gethtbyname2)

struct hostent *
_gethtbyaddr(addr, len, af)
Expand All @@ -923,6 +930,7 @@ _gethtbyaddr(addr, len, af)
_endhtent();
return (p);
}
libresolv_hidden_def (_gethtbyaddr)

static void
map_v4v6_address(src, dst)
Expand Down
2 changes: 2 additions & 0 deletions resolv/ns_name.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ ns_name_ntop(const u_char *src, char *dst, size_t dstsiz) {
*dn++ = '\0';
return (dn - dst);
}
libresolv_hidden_def (ns_name_ntop)

/*
* ns_name_pton(src, dst, dstsiz)
Expand Down Expand Up @@ -421,6 +422,7 @@ ns_name_unpack(const u_char *msg, const u_char *eom, const u_char *src,
len = srcp - src;
return (len);
}
libresolv_hidden_def (ns_name_unpack)

/*
* ns_name_pack(src, dst, dstsiz, dnptrs, lastdnptr)
Expand Down
3 changes: 3 additions & 0 deletions resolv/ns_netint.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ static const char rcsid[] = "$BINDId: ns_netint.c,v 8.4 1999/10/13 16:39:35 vixi
/* Import. */

#include <arpa/nameser.h>
#include <resolv.h>

/* Public. */

Expand All @@ -32,6 +33,7 @@ ns_get16(const u_char *src) {
NS_GET16(dst, src);
return (dst);
}
libresolv_hidden_def (ns_get16)

u_long
ns_get32(const u_char *src) {
Expand All @@ -40,6 +42,7 @@ ns_get32(const u_char *src) {
NS_GET32(dst, src);
return (dst);
}
libresolv_hidden_def (ns_get32)

void
ns_put16(u_int src, u_char *dst) {
Expand Down
15 changes: 11 additions & 4 deletions resolv/res_comp.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Copyright (c) 1985, 1993
* The Regents of the University of California. All rights reserved.
*
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
Expand All @@ -13,7 +13,7 @@
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
Expand All @@ -29,14 +29,14 @@

/*
* Portions Copyright (c) 1993 by Digital Equipment Corporation.
*
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies, and that
* the name of Digital Equipment Corporation not be used in advertising or
* publicity pertaining to distribution of the document or software without
* specific, written prior permission.
*
*
* THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
* WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
Expand Down Expand Up @@ -96,6 +96,7 @@ dn_expand(const u_char *msg, const u_char *eom, const u_char *src,
dst[0] = '\0';
return (n);
}
libresolv_hidden_def (dn_expand)

/*
* Pack domain name 'exp_dn' in presentation form into 'comp_dn'.
Expand All @@ -110,6 +111,7 @@ dn_comp(const char *src, u_char *dst, int dstsiz,
(const u_char **)dnptrs,
(const u_char **)lastdnptr));
}
libresolv_hidden_def (dn_comp)

/*
* Skip over a compressed domain name. Return the size or -1.
Expand All @@ -122,6 +124,7 @@ dn_skipname(const u_char *ptr, const u_char *eom) {
return (-1);
return (ptr - saveptr);
}
libresolv_hidden_def (dn_skipname)

/*
* Verify that a domain name uses an acceptable character set.
Expand Down Expand Up @@ -170,6 +173,7 @@ res_hnok(const char *dn) {
}
return (1);
}
libresolv_hidden_def (res_hnok)

/*
* hostname-like (A, MX, WKS) owners can have "*" as their first label
Expand Down Expand Up @@ -227,6 +231,7 @@ res_dnok(const char *dn) {
return (0);
return (1);
}
libresolv_hidden_def (res_dnok)

#ifdef BIND_4_COMPAT
/*
Expand All @@ -238,7 +243,9 @@ res_dnok(const char *dn) {
* Note that one _ comes from C and the others come from us.
*/
void __putlong(u_int32_t src, u_char *dst) { ns_put32(src, dst); }
libresolv_hidden_def (__putlong)
void __putshort(u_int16_t src, u_char *dst) { ns_put16(src, dst); }
libresolv_hidden_def (__putshort)
#ifndef __ultrix__
u_int32_t _getlong(const u_char *src) { return (ns_get32(src)); }
u_int16_t _getshort(const u_char *src) { return (ns_get16(src)); }
Expand Down
7 changes: 5 additions & 2 deletions resolv/res_data.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ static const char rcsid[] = "$BINDId: res_data.c,v 8.17 1999/10/13 17:11:31 vixi
#include <string.h>
#include <unistd.h>

const char *_res_opcodes[] = {
const char *_res_opcodes[] attribute_hidden = {
"QUERY",
"IQUERY",
"CQUERYM",
Expand All @@ -59,7 +59,7 @@ const char *_res_opcodes[] = {
};

#ifdef BIND_UPDATE
const char *_res_sectioncodes[] = {
const char *_res_sectioncodes[] attribute_hidden = {
"ZONE",
"PREREQUISITES",
"UPDATE",
Expand Down Expand Up @@ -138,6 +138,7 @@ void
fp_query(const u_char *msg, FILE *file) {
fp_nquery(msg, PACKETSZ, file);
}
libresolv_hidden_def (fp_query)

void
fp_nquery(const u_char *msg, int len, FILE *file) {
Expand All @@ -146,6 +147,7 @@ fp_nquery(const u_char *msg, int len, FILE *file) {

res_pquery(&_res, msg, len, file);
}
libresolv_hidden_def (fp_nquery)

int
res_mkquery(int op, /* opcode of query */
Expand Down Expand Up @@ -295,6 +297,7 @@ hostalias(const char *name) {

return (res_hostalias(&_res, name, abuf, sizeof abuf));
}
libresolv_hidden_def (hostalias)

#ifdef ultrix
int
Expand Down
Loading

0 comments on commit 6f9d8e6

Please sign in to comment.