1998-07-06 14:36  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* posix/Makefile (generated): Remove $(objpfx) from the names.

1998-07-05  Andreas Jaeger  <aj@arthur.rhein-neckar.de>

	* stdio-common/test_rdwr.c: Use %Zu for size_t in printf
	format string.

	* libio/iofread_u.c: Include <stdio.h> for prototype.
	* libio/iofwrite_u.c: Likewise.

1998-07-06  Andreas Jaeger  <aj@arthur.rhein-neckar.de>

	* db2/Versions: New file.

1998-07-04  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* Makefile (lib-noranlib): Don't depend on sysd-versions.
	($(common-objpfx)sysd-versions): Remove rule.
	* Makerules ($(common-objpfx)sysd-versions): Define here instead.
	Pass name of Versions.def file to script and redirect output to
	target.  Include it and make all generated version maps depend on
	it.
	* versions.awk: Print out variable definition containing all
	generated version maps.  Print error messages to stderr.  Remove
	temp file.

1998-07-04  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* posix/annexc.c (check_header): Terminate macro name before
	comparing.
	(get_null_defines): Allow builtin macros with parameters.
	(fmt, testfmt): Add -D_LIBC.
	* posix/Makefile: Remove bogus duplicate include directories from
	annexc test command.

1998-07-06 12:04  Ulrich Drepper  <drepper@cygnus.com>

	* nis/nss_nis/nis-pwd.c (internal_nis_getpwent_r): Handle adjunct
	password scheme.
	(_nss_nis_getpwnam_r): Likewise.
	(_nss_nis_getpwuid_r): Likewise.

1998-07-05  Mark Kettenis  <kettenis@phys.uva.nl>

	* libio/Versions: Move symbols whose source lives in
	stdio-common to ...
	* stdio-common/Versions: ... here.
	* stdio/Versions: Add missing symbols.
This commit is contained in:
Ulrich Drepper 1998-07-06 17:09:00 +00:00
parent dd3c89f99c
commit 8eaaffdeed
14 changed files with 392 additions and 106 deletions

View File

@ -1,3 +1,54 @@
1998-07-06 14:36 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* posix/Makefile (generated): Remove $(objpfx) from the names.
1998-07-05 Andreas Jaeger <aj@arthur.rhein-neckar.de>
* stdio-common/test_rdwr.c: Use %Zu for size_t in printf
format string.
* libio/iofread_u.c: Include <stdio.h> for prototype.
* libio/iofwrite_u.c: Likewise.
1998-07-06 Andreas Jaeger <aj@arthur.rhein-neckar.de>
* db2/Versions: New file.
1998-07-04 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* Makefile (lib-noranlib): Don't depend on sysd-versions.
($(common-objpfx)sysd-versions): Remove rule.
* Makerules ($(common-objpfx)sysd-versions): Define here instead.
Pass name of Versions.def file to script and redirect output to
target. Include it and make all generated version maps depend on
it.
* versions.awk: Print out variable definition containing all
generated version maps. Print error messages to stderr. Remove
temp file.
1998-07-04 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* posix/annexc.c (check_header): Terminate macro name before
comparing.
(get_null_defines): Allow builtin macros with parameters.
(fmt, testfmt): Add -D_LIBC.
* posix/Makefile: Remove bogus duplicate include directories from
annexc test command.
1998-07-06 12:04 Ulrich Drepper <drepper@cygnus.com>
* nis/nss_nis/nis-pwd.c (internal_nis_getpwent_r): Handle adjunct
password scheme.
(_nss_nis_getpwnam_r): Likewise.
(_nss_nis_getpwuid_r): Likewise.
1998-07-05 Mark Kettenis <kettenis@phys.uva.nl>
* libio/Versions: Move symbols whose source lives in
stdio-common to ...
* stdio-common/Versions: ... here.
* stdio/Versions: Add missing symbols.
1998-07-05 Ulrich Drepper <drepper@cygnus.com> 1998-07-05 Ulrich Drepper <drepper@cygnus.com>
* sysdeps/unix/sysv/linux/__sendmsg.S: Define function as * sysdeps/unix/sysv/linux/__sendmsg.S: Define function as

View File

@ -77,10 +77,6 @@ ifeq (yes,$(build-shared))
install-others += $(inst_includedir)/gnu/lib-names.h install-others += $(inst_includedir)/gnu/lib-names.h
endif endif
ifeq ($(versioning),yes)
lib-noranlib: lib-mapfiles
endif
include Makerules include Makerules
ifeq ($(build-programs),yes) ifeq ($(build-programs),yes)
@ -315,25 +311,3 @@ headers2_0 := __math.h bytesex.h confname.h direntry.h elfclass.h \
.PHONY: remove-old-headers .PHONY: remove-old-headers
remove-old-headers: remove-old-headers:
rm -f $(addprefix $(inst_includedir)/, $(headers2_0)) rm -f $(addprefix $(inst_includedir)/, $(headers2_0))
# Generate version maps.
ifeq ($(versioning),yes)
ifndef avoid-generated
$(common-objpfx)sysd-versions: Versions.def
(echo define vers-libs; \
sed -n 's/\(lib[a-zA-Z0-9_][a-zA-Z0-9_]*\) {/$$(common-objpfx)\1%map/p' $<; \
echo endef) > $@T
mv -f $@T $@
-include $(common-objpfx)sysd-versions
vers-libs := $(subst $(\n), ,$(vers-libs))
$(vers-libs): versions.awk \
$(wildcard $(subdirs:%=%/Versions)) \
$(wildcard $(+sysdep_dirs:%=%/Versions))
$(AWK) -v 'buildroot=$(common-objpfx)' -f $^
lib-mapfiles: $(common-objpfx)sysd-versions $(subst %,.,$(vers-libs))
else
lib-mapfiles:
endif
endif

View File

@ -276,6 +276,17 @@ ifndef sysd-rules-done
no_deps=t no_deps=t
endif endif
# Generate version maps.
ifeq ($(versioning),yes)
-include $(common-objpfx)sysd-versions
$(common-objpfx)sysd-versions: $(..)Versions.def $(..)versions.awk \
$(wildcard $(all-subdirs:%=$(..)%/Versions)) \
$(wildcard $(+sysdep_dirs:%=%/Versions))
$(AWK) -v buildroot=$(common-objpfx) -v defsfile=$< \
-f $(filter-out $<,$^) > $@T
mv -f $@T $@
$(all-version-maps): $(common-objpfx)sysd-versions
endif
ifndef compile-command.S ifndef compile-command.S
compile-command.S = $(compile.S) $(OUTPUT_OPTION) compile-command.S = $(compile.S) $(OUTPUT_OPTION)

51
db2/Versions Normal file
View File

@ -0,0 +1,51 @@
libdb {
GLIBC_2.0 {
# db 1.85 interface
dbopen; __dbopen;
# The compatibility functions.
dbm_clearerr; dbm_close; dbm_delete; dbm_dirfno; dbm_error;
dbm_fetch; dbm_firstkey; dbminit; dbm_nextkey; dbm_open;
dbm_pagfno; dbm_store;
}
GLIBC_2.1 {
# db.2.x interface
# Internal functions used by db maintenance programs
__bam_init_print; __bam_pgin; __bam_pgout;
__db_dispatch;__db_dump; __db_err; __db_init_print;__db_jump;
__db_omode;__db_prdbt;
__ham_init_print; __ham_pgin; __ham_pgout;
__lock_dump_region;
__log_init_print;
__memp_dump_region;
__txn_init_print;
# Constants
db_rw_conflicts; db_riw_conflicts;
# Functions
db_appexit; db_appinit; db_jump_set; db_open; db_value_set;
db_version;
lock_close; lock_detect; lock_get; lock_id; lock_open; lock_put;
lock_stat; lock_unlink; lock_vec; log_archive; log_close;
log_compare; log_file; log_flush; log_get; log_open; log_put;
log_register; log_stat; log_unlink; log_unregister;
memp_close; memp_fclose; memp_fget; memp_fopen; memp_fput;
memp_fset; memp_fsync; memp_open; memp_register; memp_stat;
memp_sync; memp_trickle; memp_unlink;
txn_abort; txn_begin; txn_checkpoint; txn_close; txn_commit;
txn_id; txn_open; txn_prepare; txn_stat; txn_unlink;
# compatibility interface for ndbm
__db_ndbm_clearerr; __db_ndbm_close; __db_ndbm_delete;
__db_ndbm_dirfno; __db_ndbm_error; __db_ndbm_fetch;
__db_ndbm_firstkey; __db_ndbm_nextkey; __db_ndbm_open;
__db_ndbm_pagfno; __db_ndbm_rdonly; __db_ndbm_store;
# compatibility interface for dbm
__db_dbm_delete; __db_dbm_fetch; __db_dbm_firstkey; __db_dbm_init;
__db_dbm_nextkey; __db_dbm_store;
}
}

View File

@ -43,48 +43,39 @@ libc {
# variables in normal name space # variables in normal name space
stderr; stdin; stdout; stderr; stdin; stdout;
# a*
asprintf;
# c* # c*
clearerr; clearerr_unlocked; clearerr; clearerr_unlocked;
# d*
dprintf;
# f* # f*
fclose; fcloseall; fdopen; feof; feof_locked; feof_unlocked; ferror; fclose; fcloseall; fdopen; feof; feof_locked; feof_unlocked; ferror;
ferror_locked; ferror_unlocked; fflush; fflush_locked; fflush_unlocked; ferror_locked; ferror_unlocked; fflush; fflush_locked; fflush_unlocked;
fgetc; fgetpos; fgets; fileno; fileno_locked; fileno_unlocked; flockfile; fgetc; fgetpos; fgets; fileno; fileno_locked; fileno_unlocked; flockfile;
fopen; fopencookie; fprintf; fputc; fputc_locked; fputc_unlocked; fputs; fopen; fopencookie; fputc; fputc_locked; fputc_unlocked; fputs;
fread; freopen; fscanf; fseek; fsetpos; ftell; ftrylockfile; funlockfile; fread; freopen; fseek; fsetpos; ftell; ftrylockfile; funlockfile;
fwrite; fwrite;
# g* # g*
getc; getc_locked; getc_unlocked; getchar; getchar_unlocked; getdelim; getc; getc_locked; getc_unlocked; getchar; getchar_unlocked; getdelim;
getline; gets; getw; gets;
# o* # o*
obstack_printf; obstack_vprintf; open_memstream; open_memstream; open_obstack_stream; obstack_printf; obstack_vprintf;
# p* # p*
pclose; popen; printf; putc; putc_locked; putc_unlocked; putchar; pclose; popen; putc; putc_locked; putc_unlocked; putchar;
putchar_unlocked; puts; putchar_unlocked; puts;
# p* # r*
putw; rewind; rewind;
# s* # s*
scanf; setbuf; setbuffer; setlinebuf; setbuf; setbuffer; setlinebuf; setvbuf;
# s*
setvbuf; snprintf; sprintf; sscanf;
# u* # u*
ungetc; ungetc;
# v* # v*
vasprintf; vdprintf; vprintf; vscanf; vsnprintf; vsprintf; vsscanf; vasprintf; vdprintf; vscanf; vsnprintf; vsprintf; vsscanf;
} }
GLIBC_2.1 { GLIBC_2.1 {
# global variables # global variables

View File

@ -24,6 +24,7 @@
General Public License. */ General Public License. */
#include "libioP.h" #include "libioP.h"
#include <stdio.h>
_IO_size_t _IO_size_t
fread_unlocked (buf, size, count, fp) fread_unlocked (buf, size, count, fp)

View File

@ -24,6 +24,7 @@
General Public License. */ General Public License. */
#include "libioP.h" #include "libioP.h"
#include <stdio.h>
_IO_size_t _IO_size_t
fwrite_unlocked (buf, size, count, fp) fwrite_unlocked (buf, size, count, fp)

View File

@ -1,4 +1,4 @@
/* Copyright (C) 1996, 1997 Free Software Foundation, Inc. /* Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
This file is part of the GNU C Library. This file is part of the GNU C Library.
Contributed by Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1996. Contributed by Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1996.
@ -82,8 +82,8 @@ internal_nis_getpwent_r (struct passwd *pwd, char *buffer, size_t buflen,
int *errnop) int *errnop)
{ {
struct parser_data *data = (void *) buffer; struct parser_data *data = (void *) buffer;
char *domain, *result, *outkey; char *domain;
int len, keylen, parse_res; int parse_res;
if (yp_get_default_domain (&domain)) if (yp_get_default_domain (&domain))
return NSS_STATUS_UNAVAIL; return NSS_STATUS_UNAVAIL;
@ -92,7 +92,9 @@ internal_nis_getpwent_r (struct passwd *pwd, char *buffer, size_t buflen,
do do
{ {
enum nss_status retval; enum nss_status retval;
char *p; char *result, *outkey, *result2, *p;
int len, keylen, len2;
size_t namelen;
if (new_start) if (new_start)
retval = yperr2nss (yp_first (domain, "passwd.byname", retval = yperr2nss (yp_first (domain, "passwd.byname",
@ -109,15 +111,63 @@ internal_nis_getpwent_r (struct passwd *pwd, char *buffer, size_t buflen,
return retval; return retval;
} }
if ((size_t) (len + 1) > buflen) /* Check for adjunct style secret passwords. They can be
{ recognized by a password starting with "##". */
free (result); p = strchr (result, ':');
*errnop = ERANGE; if (p != NULL /* This better should be true in all cases. */
return NSS_STATUS_TRYAGAIN; && p[1] == '#' && p[2] == '#'
} && (namelen = p - result,
yp_match (domain, "passwd.adjunct.byname", result, namelen,
&result2, &len2)) == YPERR_SUCCESS)
{
/* We found a passwd.adjunct entry. Merge encrypted
password therein into original result. */
char *encrypted = strchr (result2, ':');
char *endp;
size_t restlen;
if (encrypted != NULL
|| (endp = strchr (++encrypted, ':')) == NULL
|| (p = strchr (p + 1, ':')) == NULL)
{
/* Invalid format of the entry. This never should happen
unless the data from which the NIS table is generated is
wrong. We simply ignore it. */
free (result2);
goto non_adjunct;
}
restlen = len - (p - result);
if ((size_t) (namelen + (endp - encrypted) + restlen + 2) > buflen)
{
free (result2);
free (result);
*errnop = ERANGE;
return NSS_STATUS_TRYAGAIN;
}
__mempcpy (__mempcpy (__mempcpy (__mempcpy (buffer, result, namelen),
":", 1),
encrypted, endp - encrypted),
p, restlen + 1);
p = buffer;
free (result2);
}
else
{
non_adjunct:
if ((size_t) (len + 1) > buflen)
{
free (result);
*errnop = ERANGE;
return NSS_STATUS_TRYAGAIN;
}
p = strncpy (buffer, result, len);
buffer[len] = '\0';
}
p = strncpy (buffer, result, len);
buffer[len] = '\0';
while (isspace (*p)) while (isspace (*p))
++p; ++p;
free (result); free (result);
@ -161,8 +211,9 @@ _nss_nis_getpwnam_r (const char *name, struct passwd *pwd,
{ {
struct parser_data *data = (void *) buffer; struct parser_data *data = (void *) buffer;
enum nss_status retval; enum nss_status retval;
char *domain, *result, *p; char *domain, *result, *result2, *p;
int len, parse_res; int len, len2, parse_res;
size_t namelen;
if (name == NULL) if (name == NULL)
{ {
@ -173,8 +224,10 @@ _nss_nis_getpwnam_r (const char *name, struct passwd *pwd,
if (yp_get_default_domain (&domain)) if (yp_get_default_domain (&domain))
return NSS_STATUS_UNAVAIL; return NSS_STATUS_UNAVAIL;
namelen = strlen (name);
retval = yperr2nss (yp_match (domain, "passwd.byname", name, retval = yperr2nss (yp_match (domain, "passwd.byname", name,
strlen (name), &result, &len)); namelen, &result, &len));
if (retval != NSS_STATUS_SUCCESS) if (retval != NSS_STATUS_SUCCESS)
{ {
@ -183,15 +236,62 @@ _nss_nis_getpwnam_r (const char *name, struct passwd *pwd,
return retval; return retval;
} }
if ((size_t) (len + 1) > buflen) /* Check for adjunct style secret passwords. They can be recognized
by a password starting with "##". */
p = strchr (result, ':');
if (p != NULL /* This better should be true in all cases. */
&& p[1] == '#' && p[2] == '#'
&& yp_match (domain, "passwd.adjunct.byname", name, namelen,
&result2, &len2) == YPERR_SUCCESS)
{ {
free (result); /* We found a passwd.adjunct entry. Merge encrypted password
*errnop = ERANGE; therein into original result. */
return NSS_STATUS_TRYAGAIN; char *encrypted = strchr (result2, ':');
char *endp;
size_t restlen;
if (encrypted != NULL
|| (endp = strchr (++encrypted, ':')) == NULL
|| (p = strchr (p + 1, ':')) == NULL)
{
/* Invalid format of the entry. This never should happen
unless the data from which the NIS table is generated is
wrong. We simply ignore it. */
free (result2);
goto non_adjunct;
}
restlen = len - (p - result);
if ((size_t) (namelen + (endp - encrypted) + restlen + 2) > buflen)
{
free (result2);
free (result);
*errnop = ERANGE;
return NSS_STATUS_TRYAGAIN;
}
__mempcpy (__mempcpy (__mempcpy (__mempcpy (buffer, name, namelen),
":", 1),
encrypted, endp - encrypted),
p, restlen + 1);
p = buffer;
free (result2);
}
else
{
non_adjunct:
if ((size_t) (len + 1) > buflen)
{
free (result);
*errnop = ERANGE;
return NSS_STATUS_TRYAGAIN;
}
p = strncpy (buffer, result, len);
buffer[len] = '\0';
} }
p = strncpy (buffer, result, len);
buffer[len] = '\0';
while (isspace (*p)) while (isspace (*p))
++p; ++p;
free (result); free (result);
@ -214,9 +314,10 @@ _nss_nis_getpwuid_r (uid_t uid, struct passwd *pwd,
{ {
struct parser_data *data = (void *) buffer; struct parser_data *data = (void *) buffer;
enum nss_status retval; enum nss_status retval;
char *domain, *result, *p; char *domain, *result, *p, *result2;
int len, nlen, parse_res; int len, nlen, parse_res, len2;
char buf[32]; char buf[32];
size_t namelen;
if (yp_get_default_domain (&domain)) if (yp_get_default_domain (&domain))
return NSS_STATUS_UNAVAIL; return NSS_STATUS_UNAVAIL;
@ -233,15 +334,63 @@ _nss_nis_getpwuid_r (uid_t uid, struct passwd *pwd,
return retval; return retval;
} }
if ((size_t) (len + 1) > buflen) /* Check for adjunct style secret passwords. They can be recognized
by a password starting with "##". */
p = strchr (result, ':');
if (p != NULL /* This better should be true in all cases. */
&& p[1] == '#' && p[2] == '#'
&& (namelen = p - result,
yp_match (domain, "passwd.adjunct.byname", result, namelen,
&result2, &len2)) == YPERR_SUCCESS)
{ {
free (result); /* We found a passwd.adjunct entry. Merge encrypted password
*errnop = ERANGE; therein into original result. */
return NSS_STATUS_TRYAGAIN; char *encrypted = strchr (result2, ':');
char *endp;
size_t restlen;
if (encrypted != NULL
|| (endp = strchr (++encrypted, ':')) == NULL
|| (p = strchr (p + 1, ':')) == NULL)
{
/* Invalid format of the entry. This never should happen
unless the data from which the NIS table is generated is
wrong. We simply ignore it. */
free (result2);
goto non_adjunct;
}
restlen = len - (p - result);
if ((size_t) (namelen + (endp - encrypted) + restlen + 2) > buflen)
{
free (result2);
free (result);
*errnop = ERANGE;
return NSS_STATUS_TRYAGAIN;
}
__mempcpy (__mempcpy (__mempcpy (__mempcpy (buffer, result, namelen),
":", 1),
encrypted, endp - encrypted),
p, restlen + 1);
p = buffer;
free (result2);
}
else
{
non_adjunct:
if ((size_t) (len + 1) > buflen)
{
free (result);
*errnop = ERANGE;
return NSS_STATUS_TRYAGAIN;
}
p = strncpy (buffer, result, len);
buffer[len] = '\0';
} }
p = strncpy (buffer, result, len);
buffer[len] = '\0';
while (isspace (*p)) while (isspace (*p))
++p; ++p;
free (result); free (result);

View File

@ -64,7 +64,7 @@ before-compile := testcases.h ptestcases.h
# So they get cleaned up. # So they get cleaned up.
generated := $(addprefix wordexp-test-result, 1 2 3 4 5 6 7 8 9 10) \ generated := $(addprefix wordexp-test-result, 1 2 3 4 5 6 7 8 9 10) \
$(objpfx)annexc $(objpfx)annexc.out annexc annexc.out
include ../Rules include ../Rules
@ -137,7 +137,8 @@ endif
# Run a test on the header files we use. # Run a test on the header files we use.
# XXX Please note that for now we ignore the result of this test. # XXX Please note that for now we ignore the result of this test.
tests: $(objpfx)annexc tests: $(objpfx)annexc
-$(dir $<)$(notdir $<) '$(CC)' '-I../include -I../include -I.. $(+sysdep-includes) -I../include -I../include -I..' > $<.out -$(dir $<)$(notdir $<) '$(CC)' \
'-I../include -I.. $(+sysdep-includes)' > $<.out
$(objpfx)annexc: annexc.c $(objpfx)annexc: annexc.c
$(native-compile) $(native-compile)

View File

@ -609,12 +609,12 @@ static struct header
/* Format string to build command to invoke compiler. */ /* Format string to build command to invoke compiler. */
static const char fmt[] = "\ static const char fmt[] = "\
echo \"#include <%s>\" |\ echo \"#include <%s>\" |\
%s -E -dM -D_POSIX_SOURCE %s \ %s -E -dM -D_POSIX_SOURCE -D_LIBC %s \
-isystem `%s --print-prog-name=include` - > %s"; -isystem `%s --print-prog-name=include` - > %s";
static const char testfmt[] = "\ static const char testfmt[] = "\
echo \"#include <unistd.h>\n#ifndef %s\n#error not defined\n#endif\n\" |\ echo \"#include <unistd.h>\n#ifndef %s\n#error not defined\n#endif\n\" |\
%s -E -dM -D_POSIX_SOURCE %s \ %s -E -dM -D_POSIX_SOURCE -D_LIBC %s \
-isystem `%s --print-prog-name=include` - 2> /dev/null > %s"; -isystem `%s --print-prog-name=include` - 2> /dev/null > %s";
@ -709,7 +709,7 @@ get_null_defines (void)
while (fgets (line, sizeof line, input) != NULL) while (fgets (line, sizeof line, input) != NULL)
{ {
char *start, *end; char *start;
if (strlen (line) < 9 || line[7] != ' ') if (strlen (line) < 9 || line[7] != ' ')
{ /* "#define A" */ { /* "#define A" */
printf ("Malformed input, expected '#define MACRO'\ngot '%s'\n", printf ("Malformed input, expected '#define MACRO'\ngot '%s'\n",
@ -730,9 +730,7 @@ get_null_defines (void)
} }
} }
start = &line[8]; start = &line[8];
for (end = start + 1; !isspace (*end) && *end != '\0'; ++end) result[result_len++] = xstrndup (start, strcspn (start, " ("));
;
result[result_len++] = xstrndup (start, end - start);
if (first) if (first)
{ {
@ -809,7 +807,6 @@ check_header (const struct header *header, const char **except)
while (fgets (line, sizeof line, input) != NULL) while (fgets (line, sizeof line, input) != NULL)
{ {
char *endmac;
const char **ignore; const char **ignore;
if (strlen (line) < 9 || line[7] != ' ') if (strlen (line) < 9 || line[7] != ' ')
{ /* "#define A" */ { /* "#define A" */
@ -819,9 +816,13 @@ check_header (const struct header *header, const char **except)
continue; continue;
} }
/* Find next char after the macro identifier; this can be either
a space or an open parenthesis. */
line[8 + strcspn (&line[8], " (")] = '\0';
/* Now check whether it's one of the required macros. */ /* Now check whether it's one of the required macros. */
for (i = 0; i < header->nsyms; ++i) for (i = 0; i < header->nsyms; ++i)
if (!strncmp (&line[8], header->syms[i], strlen (header->syms[i]))) if (!strcmp (&line[8], header->syms[i]))
break; break;
if (i < header->nsyms) if (i < header->nsyms)
{ {
@ -833,12 +834,6 @@ check_header (const struct header *header, const char **except)
if (line[8] == '_') if (line[8] == '_')
continue; continue;
/* Find next char after the macro identifier; this can be either
a space or an open parenthesis. */
endmac = strpbrk (&line[8], " (");
if (endmac != NULL)
*endmac = '\0';
/* Maybe one of the symbols which are always defined. */ /* Maybe one of the symbols which are always defined. */
for (ignore = except; *ignore != NULL; ++ignore) for (ignore = except; *ignore != NULL; ++ignore)
if (! strcmp (&line[8], *ignore)) if (! strcmp (&line[8], *ignore))

View File

@ -10,20 +10,35 @@ libc {
# variables in normal name space # variables in normal name space
sys_errlist; sys_nerr; sys_sigabbrev; sys_siglist; sys_errlist; sys_nerr; sys_sigabbrev; sys_siglist;
# a*
asprintf;
# c* # c*
ctermid; cuserid; ctermid; cuserid;
# d*
dprintf;
# f*
fprintf; fscanf;
# g*
getline; getw;
# p* # p*
parse_printf_format; perror; parse_printf_format; perror; printf; putw;
# r* # r*
register_printf_function; remove; rename; register_printf_function; remove; rename;
# s*
scanf; snprintf; sprintf; sscanf;
# t* # t*
tempnam; tmpfile; tmpnam; tmpnam_r; tempnam; tmpfile; tmpnam; tmpnam_r;
# v* # v*
vfprintf; vfscanf; vfprintf; vfscanf; vprintf;
} }
GLIBC_2.1 { GLIBC_2.1 {
# p* # p*

View File

@ -91,7 +91,7 @@ main (int argc, char **argv)
} }
else if (where == -1L) else if (where == -1L)
{ {
printf ("ftell got %s (should be at %u).\n", printf ("ftell got %s (should be at %Zu).\n",
strerror (errno), replace_from); strerror (errno), replace_from);
lose = 1; lose = 1;
} }

View File

@ -2,5 +2,50 @@ libc {
GLIBC_2.0 { GLIBC_2.0 {
# more or less standard functions # more or less standard functions
__fillbf; __flshfp; __fillbf; __flshfp;
# functions used in inline functions or macros
__getdelim; __line_wrap_output; __line_wrap_update;
__vfscanf; __vsscanf;
# variables in normal name space
stderr; stdin; stdout;
# c*
clearerr;
# f*
fclose; fcloseall; fdopen; feof; ferror; fflush; fgetc; fgetpos; fgets;
fileno; fmemopen; fopen; fopencookie; fputc; fputs; fread; freopen;
fseek; fsetpos; ftell; fwrite;
# g*
getc; getchar; getdelim; gets;
# l*
line_wrap_stream; line_unwrap_stream; line_wrapped; line_wrap_lmargin;
line_wrap_set_lmargin; line_wrap_rmargin; line_wrap_set_rmargin;
line_wrap_wmargin; line_wrap_set_wmargin; line_wrap_point;
# o*
open_memstream; open_obstack_stream; obstack_printf; obstack_vprintf;
# p*
pclose; popen; putc; putchar; puts;
# r*
rewind;
# s*
setbuf; setbuffer; setlinebuf; setvbuf;
# u*
ungetc;
# v*
vasprintf; vdprintf; vscanf; vsnprintf; vsprintf; vsscanf;
}
GLIBC_2.1 {
# functions used in other libraries
__asprintf;
} }
} }

View File

@ -6,26 +6,24 @@
# Read definitions for the versions. # Read definitions for the versions.
BEGIN { BEGIN {
nlibs=0; nlibs=0;
while (getline < "Versions.def") { while (getline < defsfile) {
if (/^[a-zA-Z_]+ {/) { if (/^[a-zA-Z_]+ {/) {
libs[$1] = 1; libs[$1] = 1;
curlib = $1; curlib = $1;
while (getline < "Versions.def" && ! /^}/) { while (getline < defsfile && ! /^}/) {
versions[$1] = 1;
if (NF > 1) { if (NF > 1) {
versions[$1] = 1; derived[curlib, $1] = " " $2;
derived[curlib, $1] = (" " $2);
for (n = 3; n <= NF; ++n) { for (n = 3; n <= NF; ++n) {
derived[curlib, $1] = sprintf("%s, %s", derived[curlib, $1], $n); derived[curlib, $1] = derived[curlib, $1] ", " $n;
} }
} else {
versions[$1] = 1;
} }
} }
} }
} }
close("Versions.def"); close(defsfile);
tmpfile = (buildroot "/Versions.tmp"); tmpfile = (buildroot "Versions.tmp");
sort = ("sort -n >" tmpfile); sort = ("sort -n >" tmpfile);
} }
@ -37,8 +35,8 @@ BEGIN {
# This matches the beginning of the version information for a new library. # This matches the beginning of the version information for a new library.
/^[a-zA-Z_]+/ { /^[a-zA-Z_]+/ {
actlib = $1; actlib = $1;
if (libs[$1] != 1) { if (!libs[$1]) {
printf("no versions defined for %s\n", $1); printf("no versions defined for %s\n", $1) > "/dev/stderr";
exit 1; exit 1;
} }
next; next;
@ -47,8 +45,8 @@ BEGIN {
# This matches the beginning of a new version for the current library. # This matches the beginning of a new version for the current library.
/^ [A-Za-z_]/ { /^ [A-Za-z_]/ {
actver = $1; actver = $1;
if (versions[$1] != 1) { if (!versions[$1]) {
printf("version %s not defined\n", $1); printf("version %s not defined\n", $1) > "/dev/stderr";
exit 1; exit 1;
} }
next; next;
@ -75,6 +73,7 @@ END {
close(sort); close(sort);
oldlib=""; oldlib="";
oldver=""; oldver="";
printf("all-version-maps =");
while(getline < tmpfile) { while(getline < tmpfile) {
if ($1 != oldlib) { if ($1 != oldlib) {
if (oldlib != "") { if (oldlib != "") {
@ -85,6 +84,7 @@ END {
oldlib = $1; oldlib = $1;
outfile = (buildroot oldlib ".map"); outfile = (buildroot oldlib ".map");
firstinfile = 1; firstinfile = 1;
printf(" $(common-objpfx)%s.map", oldlib);
} }
if ($2 != oldver) { if ($2 != oldver) {
if (oldver != "") { if (oldver != "") {
@ -99,7 +99,8 @@ END {
} }
printf("\n") > outfile; printf("\n") > outfile;
} }
printf("\n");
closeversion(oldver); closeversion(oldver);
close(outfile); close(outfile);
rm tmpfile; system("rm " tmpfile);
} }