Skip to content

Commit

Permalink
Update.
Browse files Browse the repository at this point in the history
1998-07-08 22:18  Ulrich Drepper  <drepper@cygnus.com>

	* elf/Versions: Add _dl_mcount_wrapper_check.
	* elf/dlfcn.h (DL_CALL_FCT): Don't test _dl_profile_map, simply use
	_dl_mcount_wrapper_check.
	* iconv/skeleton.c: Use DL_CALL_FCT, not _CALL_DL_FCT.

	* elf/dl-reloc.c (_dl_relocate_object): Don't declare using
	internal_function.
	* elf/ldsodefs.h: Likewise.

	* io/fcntl.h: Define SEEK_SET, SEEK_CUR, and SEEK_END.

	* libio/stdio.h: Make sure va_list is defined for X/Open.
	Define P_tmpdir for X/Open.

	* posix/regex.h: Fix typo.

	* posix/unistd.h: Define intptr_t if not already happened.
	Add pthread_atfork prototype.
	* sysdeps/generic/bits/types.h: Define __intptr_t.
	* sysdeps/unix/sysv/linux/alpha/bits/types.h: Likewise.
	* sysdeps/unix/sysv/linux/bits/types.h: Likewise.
	* sysdeps/unix/sysv/linux/bits/mips/types.h: Likewise.
	* sysdeps/unix/sysv/linux/bits/sparc/sparc64/types.h: Likewise.
	* sysdeps/unix/sysv/sysv4/solaris2/bits/types.h: Likewise.
	* sysdeps/wordsize-32/stdint.h: Don't define intptr_t if already done.
	* sysdeps/wordsize-64/stdint.h: Likewise.

	* posix/bits/posix1_lim.h: Define _POSIX_CLOCKRES_MIN.

	* signal/Makefile (headers): Add bits/sigthread.h.
	* signal/signal.h: Include bits/sigthread.h.
	* sysdeps/generic/bits/sigthread.h: New file.

	* stdlib/stdlib.h: Declare rand_r use __USE_POSIX.

	* sysdeps/generic/bits/confname.h: Define _PC_FILESIZEBITS.
	* sysdeps/posix/pathconf.c: Handle _PC_FILESIZEBITS.
	* sysdeps/unix/sysv/linux/alpha/fpathconf.c: New file.
	* sysdeps/unix/sysv/linux/alpha/pathconf.c: New file.

	* sysdeps/generic/bits/dlfcn.h: Define RTLD_LOCAL.

	* elf/rtld.c: Remove preloading and loadpath variables in SUID
	programs.
	* sysdeps/generic/dl-sysdep.c: Define unsetenv.
	* sysdeps/unix/sysv/linux/i386/dl-librecon.h: Define other envvar
	names.

	* sysdeps/unix/sysv/linux/bits/errno.h: Define ECANCELED.

	* sysdeps/unix/sysv/linux/bits/fcntl.h: Define O_RSYNC and O_DSYNC.
	Remove O_READ and O_WRITE definition.

	* sysdeps/unix/sysv/linux/bits/resource.h: Define RLIM_SAVED_MAX
	and RLIM_SAVED_CUR.

	* sysdeps/unix/sysv/linux/fstatvfs.h: Handle UFS filesystem.

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

	* Makerules ($(common-objpfx)sysd-versions): Expect awk script in
	scripts directory.  Pass move-if-change to awk.
	(common-generated): Add $(version-maps) and sysd-versions.
	* versions.awk: Moved to...
	* scripts/versions.awk: ... here.  Use move-if-change to void
	touching unchanged files.  Print "version-maps = ..." instead of
	"all-version-maps = ..." and without $(common-objpfx).  Explain
	expected variable names.
	* Makefile (distribute): Updated.

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

	* misc/getttyent.c (getttyent): Don't return with locked stream.
	* misc/mntent_r.c (__getmntent_r): Likewise.

1998-07-07 18:24  Ulrich Drepper  <drepper@cygnus.com>

	* libio/fileops.c (_IO_do_write): Don't shrink wwrite buffer to zero
	if stream is line buffered.
	(_io_file_overflow): Likewise.
	* libio/libio.h (_IO_putc_unlocked): Make sure that for line-buffered
	streams writing '\n' flushes the string.
  • Loading branch information
Ulrich Drepper committed Jul 8, 1998
1 parent a3d6fb9 commit 4bae556
Show file tree
Hide file tree
Showing 51 changed files with 544 additions and 74 deletions.
85 changes: 85 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,88 @@
1998-07-08 22:18 Ulrich Drepper <drepper@cygnus.com>

* elf/Versions: Add _dl_mcount_wrapper_check.
* elf/dlfcn.h (DL_CALL_FCT): Don't test _dl_profile_map, simply use
_dl_mcount_wrapper_check.
* iconv/skeleton.c: Use DL_CALL_FCT, not _CALL_DL_FCT.

* elf/dl-reloc.c (_dl_relocate_object): Don't declare using
internal_function.
* elf/ldsodefs.h: Likewise.

* io/fcntl.h: Define SEEK_SET, SEEK_CUR, and SEEK_END.

* libio/stdio.h: Make sure va_list is defined for X/Open.
Define P_tmpdir for X/Open.

* posix/regex.h: Fix typo.

* posix/unistd.h: Define intptr_t if not already happened.
Add pthread_atfork prototype.
* sysdeps/generic/bits/types.h: Define __intptr_t.
* sysdeps/unix/sysv/linux/alpha/bits/types.h: Likewise.
* sysdeps/unix/sysv/linux/bits/types.h: Likewise.
* sysdeps/unix/sysv/linux/bits/mips/types.h: Likewise.
* sysdeps/unix/sysv/linux/bits/sparc/sparc64/types.h: Likewise.
* sysdeps/unix/sysv/sysv4/solaris2/bits/types.h: Likewise.
* sysdeps/wordsize-32/stdint.h: Don't define intptr_t if already done.
* sysdeps/wordsize-64/stdint.h: Likewise.

* posix/bits/posix1_lim.h: Define _POSIX_CLOCKRES_MIN.

* signal/Makefile (headers): Add bits/sigthread.h.
* signal/signal.h: Include bits/sigthread.h.
* sysdeps/generic/bits/sigthread.h: New file.

* stdlib/stdlib.h: Declare rand_r use __USE_POSIX.

* sysdeps/generic/bits/confname.h: Define _PC_FILESIZEBITS.
* sysdeps/posix/pathconf.c: Handle _PC_FILESIZEBITS.
* sysdeps/unix/sysv/linux/alpha/fpathconf.c: New file.
* sysdeps/unix/sysv/linux/alpha/pathconf.c: New file.

* sysdeps/generic/bits/dlfcn.h: Define RTLD_LOCAL.

* elf/rtld.c: Remove preloading and loadpath variables in SUID
programs.
* sysdeps/generic/dl-sysdep.c: Define unsetenv.
* sysdeps/unix/sysv/linux/i386/dl-librecon.h: Define other envvar
names.

* sysdeps/unix/sysv/linux/bits/errno.h: Define ECANCELED.

* sysdeps/unix/sysv/linux/bits/fcntl.h: Define O_RSYNC and O_DSYNC.
Remove O_READ and O_WRITE definition.

* sysdeps/unix/sysv/linux/bits/resource.h: Define RLIM_SAVED_MAX
and RLIM_SAVED_CUR.

* sysdeps/unix/sysv/linux/fstatvfs.h: Handle UFS filesystem.

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

* Makerules ($(common-objpfx)sysd-versions): Expect awk script in
scripts directory. Pass move-if-change to awk.
(common-generated): Add $(version-maps) and sysd-versions.
* versions.awk: Moved to...
* scripts/versions.awk: ... here. Use move-if-change to void
touching unchanged files. Print "version-maps = ..." instead of
"all-version-maps = ..." and without $(common-objpfx). Explain
expected variable names.
* Makefile (distribute): Updated.

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

* misc/getttyent.c (getttyent): Don't return with locked stream.
* misc/mntent_r.c (__getmntent_r): Likewise.

1998-07-07 18:24 Ulrich Drepper <drepper@cygnus.com>

* libio/fileops.c (_IO_do_write): Don't shrink wwrite buffer to zero
if stream is line buffered.
(_io_file_overflow): Likewise.
* libio/libio.h (_IO_putc_unlocked): Make sure that for line-buffered
streams writing '\n' flushes the string.

1998-07-07 17:28 Ulrich Drepper <drepper@cygnus.com>

* elf/dl-profstub.c (_dl_profile_map): Only declare variable here.
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -246,11 +246,11 @@ distribute := README README.libm INSTALL FAQ FAQ.in NOTES NEWS BUGS \
Makefile.in sysdep.h set-hooks.h libc-symbols.h \
version.h shlib-versions rpm/Makefile rpm/template \
rpm/rpmrc glibcbug.in abi-tags stub-tag.h \
test-skeleton.c include/des.h Versions.def versions.awk \
test-skeleton.c include/des.h Versions.def \
$(addprefix scripts/, \
rellns-sh config.sub config.guess \
mkinstalldirs move-if-change install-sh \
test-installation.pl gen-FAQ.pl)
test-installation.pl gen-FAQ.pl versions.awk)

distribute := $(strip $(distribute))
generated := $(generated) stubs.h
Expand Down
9 changes: 7 additions & 2 deletions Makerules
Original file line number Diff line number Diff line change
Expand Up @@ -279,13 +279,18 @@ endif
# Generate version maps.
ifeq ($(versioning),yes)
-include $(common-objpfx)sysd-versions
$(common-objpfx)sysd-versions: $(..)Versions.def $(..)versions.awk \
$(addprefix $(common-objpfx),$(version-maps)): $(common-objpfx)sysd-versions
generated += $(versin-maps)

ifndef avoid-generated
$(common-objpfx)sysd-versions: $(..)Versions.def $(..)scripts/versions.awk \
$(wildcard $(all-subdirs:%=$(..)%/Versions)) \
$(wildcard $(+sysdep_dirs:%=%/Versions))
$(AWK) -v buildroot=$(common-objpfx) -v defsfile=$< \
-v move_if_change='$(move-if-change)' \
-f $(filter-out $<,$^) > $@T
mv -f $@T $@
$(all-version-maps): $(common-objpfx)sysd-versions
endif
endif

ifndef compile-command.S
Expand Down
6 changes: 4 additions & 2 deletions bits/confname.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* `sysconf', `pathconf', and `confstr' NAME values. Generic version.
Copyright (C) 1993, 1995, 1996, 1997 Free Software Foundation, Inc.
Copyright (C) 1993, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
Expand Down Expand Up @@ -48,8 +48,10 @@ enum
#define _PC_ASYNC_IO _PC_ASYNC_IO
_PC_PRIO_IO,
#define _PC_PRIO_IO _PC_PRIO_IO
_PC_SOCK_MAXBUF
_PC_SOCK_MAXBUF,
#define _PC_SOCK_MAXBUF _PC_SOCK_MAXBUF
_PC_FILESIZEBITS
#define _PC_FILESIZEBITS _PC_FILESIZEBITS
};

/* Values for the argument to `sysconf'. */
Expand Down
7 changes: 6 additions & 1 deletion bits/dlfcn.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* System dependand definitions for run-time dynamic loading.
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.
The GNU C Library is free software; you can redistribute it and/or
Expand Down Expand Up @@ -30,3 +30,8 @@
the symbols of the loaded object and its dependencies are made
visible as if the object were linked directly into the program. */
#define RTLD_GLOBAL 0x100

/* Unix98 demands the following flag which is the inverse to RTLD_GLOBAL.
The implementation does this by default and so we can define the
value to zero. */
#define RTLD_LOCAL 0
24 changes: 24 additions & 0 deletions bits/sigthread.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/* Signal handling function for threaded programs.
Copyright (C) 1998 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */

#ifndef _SIGNAL_H
# error "Never include this file directly. Use <signal.h> instead"
#endif

/* There are none available in this configuration. */
3 changes: 3 additions & 0 deletions bits/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,7 @@ typedef __u_quad_t __fsfilcnt64_t;
typedef int __t_scalar_t;
typedef unsigned int __t_uscalar_t;

/* This definition makes this file kind of architecture dependent. */
typedef long int __intptr_t;

#endif /* bits/types.h */
2 changes: 1 addition & 1 deletion elf/Versions
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ libc {
_dl_profile; _dl_profile_map; _dl_profile_output; _dl_start_profile;

# functions used in other libraries
_dl_mcount; _dl_mcount_wrapper;
_dl_mcount; _dl_mcount_wrapper; _dl_mcount_wrapper_check;
}
}

Expand Down
1 change: 0 additions & 1 deletion elf/dl-reloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@


void
internal_function
_dl_relocate_object (struct link_map *l, struct link_map *scope[], int lazy,
int consider_profiling)
{
Expand Down
8 changes: 2 additions & 6 deletions elf/dlfcn.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,9 @@ extern int dladdr __P ((const void *__address, Dl_info *__info));
foo = DL_CALL_FCT (fctp, (arg1, arg2));
*/
# if __GNUC__ >= 2
/* Do not ever use this variable directly, it is internal! */
extern struct link_map *_dl_profile_map;

# define DL_CALL_FCT(fctp, args) \
(__extension__ ({ if (_dl_profile_map != NULL) \
_dl_mcount_wrapper_check (fctp); \
(*fctp) args; })
(__extension__ ({ _dl_mcount_wrapper_check (fctp); \
(*fctp) args; }))
# else
/* This feature is not available without GCC. */
# define DL_CALL_FCT(fctp, args) (*fctp) args
Expand Down
3 changes: 1 addition & 2 deletions elf/ldsodefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -365,8 +365,7 @@ extern struct link_map *_dl_new_object (char *realname, const char *libname,
If LAZY is nonzero, don't relocate its PLT. */
extern void _dl_relocate_object (struct link_map *map,
struct link_map *scope[],
int lazy, int consider_profiling)
internal_function;
int lazy, int consider_profiling);

/* Check the version dependencies of all objects available through
MAP. If VERBOSE print some more diagnostics. */
Expand Down
23 changes: 23 additions & 0 deletions elf/rtld.c
Original file line number Diff line number Diff line change
Expand Up @@ -1193,6 +1193,29 @@ process_envvars (enum mode *modep, int *lazyp)
}
}

/* Extra security for SUID binaries. Remove all dangerous environment
variables. */
if (__libc_enable_secure)
{
static const char *unsecure_envvars[] =
{
#ifdef EXTRA_UNSECURE_ENVVARS
EXTRA_UNSECURE_ENVVARS
#endif
};
size_t cnt;

if (preloadlist != NULL)
unsetenv ("LD_PRELOAD");
if (library_path != NULL)
unsetenv ("LD_LIBRARY_PATH");

for (cnt = 0;
cnt < sizeof (unsecure_envvars) / sizeof (unsecure_envvars[0]);
++cnt)
unsetenv (unsecure_envvars[cnt]);
}

/* If we have to run the dynamic linker in debugging mode and the
LD_DEBUG_OUTPUT environment variable is given, we write the debug
messages to this file. */
Expand Down
9 changes: 5 additions & 4 deletions iconv/skeleton.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
*/

#include <assert.h>
#include <dlfcn.h>
#include <gconv.h>
#include <string.h>
#define __need_size_t
Expand Down Expand Up @@ -219,8 +220,8 @@ FUNCTION_NAME (struct gconv_step *step, struct gconv_step_data *data,
if (status == GCONV_OK)
#endif
/* Give the modules below the same chance. */
status = _CALL_DL_FCT (fct, (next_step, next_data, NULL, NULL,
written, 1));
status = DL_CALL_FCT (fct, (next_step, next_data, NULL, NULL,
written, 1));
}
}
else
Expand Down Expand Up @@ -286,8 +287,8 @@ FUNCTION_NAME (struct gconv_step *step, struct gconv_step_data *data,
const char *outerr = data->outbuf;
int result;

result = _CALL_DL_FCT (fct, (next_step, next_data, &outerr,
outbuf, written, 0));
result = DL_CALL_FCT (fct, (next_step, next_data, &outerr,
outbuf, written, 0));

if (result != GCONV_EMPTY_INPUT)
{
Expand Down
9 changes: 8 additions & 1 deletion io/fcntl.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (C) 1991, 92, 94, 95, 96, 97 Free Software Foundation, Inc.
/* Copyright (C) 1991, 92, 94, 95, 96, 97, 98 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
Expand Down Expand Up @@ -48,6 +48,13 @@ __BEGIN_DECLS
# endif
#endif /* Use misc. */

/* XPG wants the following symbols. */
#ifdef __USE_XOPEN /* <stdio.h> has the same definitions. */
# define SEEK_SET 0 /* Seek from beginning of file. */
# define SEEK_CUR 1 /* Seek from current position. */
# define SEEK_END 2 /* Seek from end of file. */
#endif /* XPG */

/* Do the file control operation described by CMD on FD.
The remaining arguments are interpreted depending on CMD. */
extern int __fcntl __P ((int __fd, int __cmd, ...));
Expand Down
4 changes: 2 additions & 2 deletions libio/fileops.c
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ _IO_do_write (fp, data, to_do)
fp->_cur_column = _IO_adjust_column (fp->_cur_column - 1, data, to_do) + 1;
_IO_setg (fp, fp->_IO_buf_base, fp->_IO_buf_base, fp->_IO_buf_base);
fp->_IO_write_base = fp->_IO_write_ptr = fp->_IO_buf_base;
fp->_IO_write_end = ((fp->_flags & (_IO_LINE_BUF+_IO_UNBUFFERED))
fp->_IO_write_end = ((fp->_flags & (_IO_UNBUFFERED))
? fp->_IO_buf_base : fp->_IO_buf_end);
return count != to_do ? EOF : 0;
}
Expand Down Expand Up @@ -410,7 +410,7 @@ _IO_file_overflow (f, ch)
f->_IO_write_end = f->_IO_buf_end;
f->_IO_read_base = f->_IO_read_ptr = f->_IO_read_end;

if (f->_flags & (_IO_LINE_BUF+_IO_UNBUFFERED))
if (f->_flags & (_IO_UNBUFFERED))
f->_IO_write_end = f->_IO_write_ptr;
f->_flags |= _IO_CURRENTLY_PUTTING;
}
Expand Down
17 changes: 15 additions & 2 deletions libio/libio.h
Original file line number Diff line number Diff line change
Expand Up @@ -287,10 +287,23 @@ extern int __overflow __P ((_IO_FILE *, int));
&& __underflow (_fp) == EOF ? EOF \
: *(unsigned char *) (_fp)->_IO_read_ptr)

#define _IO_putc_unlocked(_ch, _fp) \
#ifdef __GNUC__
# define _IO_putc_unlocked(_ch, _fp) \
(__extension__ \
({ unsigned char _chl = (_ch); \
(((_fp)->_IO_write_ptr >= (_fp)->_IO_write_end \
|| (_chl == '\n' && ((_fp)->_flags & _IO_LINE_BUF))) \
? __overflow (_fp, (unsigned char) _chl) \
: (unsigned char) (*(_fp)->_IO_write_ptr++ = _chl)); }))
#else
# define _IO_putc_unlocked(_ch, _fp) \
(((_fp)->_IO_write_ptr >= (_fp)->_IO_write_end) \
? __overflow (_fp, (unsigned char) (_ch)) \
: (unsigned char) (*(_fp)->_IO_write_ptr++ = (_ch)))
: ((unsigned char) (*(_fp)->_IO_write_ptr = (_ch)) == '\n' \
&& ((_fp)->_flags & _IO_LINE_BUF) \
? __overflow (_fp, (unsigned char) *(_fp)->_IO_write_ptr) \
: (unsigned char) (*(_fp)->_IO_write_ptr++)))
#endif

#define _IO_feof_unlocked(__fp) (((__fp)->_flags & _IO_EOF_SEEN) != 0)
#define _IO_ferror_unlocked(__fp) (((__fp)->_flags & _IO_ERR_SEEN) != 0)
Expand Down
6 changes: 4 additions & 2 deletions libio/stdio.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ __BEGIN_DECLS
# define __need_NULL
# include <stddef.h>

# define __need___va_list
# ifndef __USE_XOPEN
# define __need___va_list
# endif
# include <stdarg.h>

# include <bits/types.h>
Expand Down Expand Up @@ -111,7 +113,7 @@ extern void __libc_fatal __P ((__const char *__message))
#define SEEK_END 2 /* Seek from end of file. */


#ifdef __USE_SVID
#if defined __USE_SVID || defined __USE_XOPEN
/* Default path prefix for `tempnam' and `tmpnam'. */
# define P_tmpdir "/tmp"
#endif
Expand Down
9 changes: 9 additions & 0 deletions linuxthreads/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
1998-07-08 22:26 Ulrich Drepper <drepper@cygnus.com>

* Versions: Add pthread_mutexattr_gettype, pthread_mutexattr_settype.
* mutex.c: Define weak alias pthread_mutexattr_gettype and
pthread_mutexattr_settype.
* sysdeps/pthread/pthread.h: Declare these functions.
Move pthread_sigmask and pthread_kill declaration in separate header.
* sysdeps/unix/sysv/linux/bits/sigthread.h: New file.

1998-07-07 15:20 Ulrich Drepper <drepper@cygnus.com>

* Makefile: Add rules to compile and run tests.
Expand Down
2 changes: 2 additions & 0 deletions linuxthreads/Versions
Original file line number Diff line number Diff line change
Expand Up @@ -91,5 +91,7 @@ libpthread {
pthread_attr_getstacksize; pthread_attr_setstacksize;

pthread_getconcurrency; pthread_setconcurrency;

pthread_mutexattr_gettype; pthread_mutexattr_settype;
}
}
Loading

0 comments on commit 4bae556

Please sign in to comment.