aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1996-05-29 04:48:04 +0000
committerRoland McGrath <roland@gnu.org>1996-05-29 04:48:04 +0000
commit0200214b288810fc261b0b65c32f7068fcfa9b40 (patch)
treea488a0a435ccf62b0870121b839b08de0d37a9b5
parent215dbbb1508bd6b86211112dd5ddaf9bd2290690 (diff)
downloadglibc-0200214b288810fc261b0b65c32f7068fcfa9b40.tar.xz
glibc-0200214b288810fc261b0b65c32f7068fcfa9b40.zip
Tue May 28 04:38:10 1996 Ulrich Drepper <drepper@cygnus.com>
* limits.h: Change MB_LEN_MAX to 6. A 31-bit ISO 10646 character in UTF-8 encoding has that many bytes. * locale/langinfo.h: New element _NL_CTYPE_MB_CUR_MAX. * locale/categories.def: Add description of field _NL_CTYPE_MB_CUR_MAX. * locale/Makefile (routines): Add mb_cur_max. * locale/mb_cur_max.c: New file. This function gets called when the macro MB_CUR_MAX is used. * locale/C-ctype.c: Initialize new mb_cur_max field. * locale/localeinfo.h: Change magic value because of incompatible change. * locale/programs/ld-ctype.c: Determine value of mb_cur_max according to current character set and write it out with the rest. * stdlib/stdlib.h (MB_CUR_MAX): Not constant anymore. Get value according to currently used locale for catefory LC_CTYPE by calling the function __ctype_get_mb_cur_max. Tue May 28 03:27:46 1996 Ulrich Drepper <drepper@cygnus.com> * FAQ: Fix some typos. Tell that for Linux the kernel header files are necessary. * PROJECTS: New file. List of open jobs for glibc. * Makefile (distribute): Add PROJECTS. * crypt/GNUmakefile (headers): New variable. Mention crypt.h. * crypt/crypt.h: Header for crypt functions. * elf/elf.h: Add some new constants from recent Cygnus ELF header files. * login/getutid_r.c: Test for correct type. Don't depend on ut_type and ut_id unless _HAVE_UT_TYPE and _HAVE_UT_ID resp. are defined. Make really compliant with specification. * login/getutline_r.c, login/pututline_r.c: Don't depend on ut_type and ut_id unless _HAVE_UT_TYPE and _HAVE_UT_ID resp. are defined. Make really compliant with specification. * login/setutent_r.c: Don't depend on ut_type and ut_id unless _HAVE_UT_TYPE and _HAVE_UT_ID resp. are defined. * login/login.c, login/logout.c, login/logwtmp.c: Complete rewrite. Now based on getut*/setut* functions. * stdlib/strtol.c: Undo changes of Wed May 22 01:48:54 1996. This prevented using this file in other GNU packages. * sysdeps/gnu/utmpbits.h: Define _HAVE_UT_TYPE, _HAVE_UT_ID, and _HAVE_UT_TV because struct utmp has these members. * sysdeps/libm-i387/e_exp.S: Correct exp(+-Inf) case. * utmp.h: New file. Wrapper around login/utmp.h. * elf/dl-error.c (struct catch): New type. (catch): New static variable, struct catch *. (catch_env, signalled_errstring, signalled_objname): Variables removed. (_dl_signal_error): If CATCH is non-null, set its errstring and objname members and jump to CATCH->env. If it is null, call _dl_sysdep_fatal with a standard message. * elf/rtld.c (dl_main): Explode `doit' function into dl_main's body. No longer use _dl_catch_error.
-rw-r--r--ChangeLog68
-rw-r--r--FAQ36
-rw-r--r--Makefile4
-rw-r--r--PROJECTS98
-rw-r--r--elf/dl-error.c51
-rw-r--r--elf/elf.h54
-rw-r--r--elf/rtld.c468
-rw-r--r--limits.h7
-rw-r--r--locale/C-ctype.c5
-rw-r--r--locale/Makefile3
-rw-r--r--locale/categories.def1
-rw-r--r--locale/langinfo.h1
-rw-r--r--locale/localeinfo.h2
-rw-r--r--locale/mb_cur_max.c32
-rw-r--r--locale/programs/ld-ctype.c10
-rw-r--r--login/getutid_r.c34
-rw-r--r--login/getutline_r.c23
-rw-r--r--login/login.c148
-rw-r--r--login/logout.c121
-rw-r--r--login/logwtmp.c111
-rw-r--r--login/pututline_r.c56
-rw-r--r--login/setutent_r.c4
-rw-r--r--stdlib/stdlib.h6
-rw-r--r--stdlib/strtol.c24
-rw-r--r--string/strtok.c73
-rw-r--r--sysdeps/gnu/utmpbits.h7
-rw-r--r--sysdeps/libm-i387/e_exp.S14
-rw-r--r--utmp.h1
28 files changed, 900 insertions, 562 deletions
diff --git a/ChangeLog b/ChangeLog
index 8e52bf5d13..23c069582a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,73 @@
+Tue May 28 04:38:10 1996 Ulrich Drepper <drepper@cygnus.com>
+
+ * limits.h: Change MB_LEN_MAX to 6. A 31-bit ISO 10646
+ character in UTF-8 encoding has that many bytes.
+
+ * locale/langinfo.h: New element _NL_CTYPE_MB_CUR_MAX.
+ * locale/categories.def: Add description of field _NL_CTYPE_MB_CUR_MAX.
+ * locale/Makefile (routines): Add mb_cur_max.
+ * locale/mb_cur_max.c: New file. This function gets called
+ when the macro MB_CUR_MAX is used.
+ * locale/C-ctype.c: Initialize new mb_cur_max field.
+ * locale/localeinfo.h: Change magic value because of incompatible
+ change.
+ * locale/programs/ld-ctype.c: Determine value of mb_cur_max
+ according to current character set and write it out with the rest.
+ * stdlib/stdlib.h (MB_CUR_MAX): Not constant anymore. Get value
+ according to currently used locale for catefory LC_CTYPE by
+ calling the function __ctype_get_mb_cur_max.
+
+Tue May 28 03:27:46 1996 Ulrich Drepper <drepper@cygnus.com>
+
+ * FAQ: Fix some typos.
+ Tell that for Linux the kernel header files are necessary.
+
+ * PROJECTS: New file. List of open jobs for glibc.
+ * Makefile (distribute): Add PROJECTS.
+
+ * crypt/GNUmakefile (headers): New variable. Mention crypt.h.
+ * crypt/crypt.h: Header for crypt functions.
+
+ * elf/elf.h: Add some new constants from recent Cygnus ELF
+ header files.
+
+ * login/getutid_r.c: Test for correct type.
+ Don't depend on ut_type and ut_id unless _HAVE_UT_TYPE and
+ _HAVE_UT_ID resp. are defined.
+ Make really compliant with specification.
+
+ * login/getutline_r.c, login/pututline_r.c: Don't depend on
+ ut_type and ut_id unless _HAVE_UT_TYPE and _HAVE_UT_ID resp. are
+ defined.
+ Make really compliant with specification.
+
+ * login/setutent_r.c: Don't depend on ut_type and ut_id unless
+ _HAVE_UT_TYPE and _HAVE_UT_ID resp. are defined.
+
+ * login/login.c, login/logout.c, login/logwtmp.c: Complete
+ rewrite. Now based on getut*/setut* functions.
+
+ * stdlib/strtol.c: Undo changes of Wed May 22 01:48:54 1996.
+ This prevented using this file in other GNU packages.
+
+ * sysdeps/gnu/utmpbits.h: Define _HAVE_UT_TYPE, _HAVE_UT_ID,
+ and _HAVE_UT_TV because struct utmp has these members.
+
+ * sysdeps/libm-i387/e_exp.S: Correct exp(+-Inf) case.
+
+ * utmp.h: New file. Wrapper around login/utmp.h.
+
Tue May 28 13:11:19 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
+ * elf/dl-error.c (struct catch): New type.
+ (catch): New static variable, struct catch *.
+ (catch_env, signalled_errstring, signalled_objname): Variables removed.
+ (_dl_signal_error): If CATCH is non-null, set its errstring and
+ objname members and jump to CATCH->env. If it is null, call
+ _dl_sysdep_fatal with a standard message.
+ * elf/rtld.c (dl_main): Explode `doit' function into dl_main's body.
+ No longer use _dl_catch_error.
+
* Makerules (sed-remove-objpfx): Avoid extra space in regexp due to
continuation line.
diff --git a/FAQ b/FAQ
index 9ebd95d7a5..f85b255bbc 100644
--- a/FAQ
+++ b/FAQ
@@ -102,8 +102,8 @@ from your favourite mirror of prep.ai.mit.edu.
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
[Q5] ``Do I need a special linker or archiver?''
-[A5] {UD} If your native versions are not too buggy you can work with
-them. But GNU libc works best with GNU binutils.
+[A5] {UD} If your native versions are not too buggy you can probably
+work with them. But GNU libc works best with GNU binutils.
On systems where the native linker does not support weak symbols you
will not get a really ISO C compliant C library. Generally speaking
@@ -119,7 +119,7 @@ Older releases are known to have bugs that affect building the GNU C library.
[A6] {UD} Yes, there are some more :-).
-* lots of diskspace (for i386-linux this means, e.g., ~70MB)
+* lots of diskspace (for i386-linux this means, e.g., ~70MB).
You should avoid compiling on a NFS mounted device. This is very
slow.
@@ -130,6 +130,12 @@ Older releases are known to have bugs that affect building the GNU C library.
If you are interested in some more measurements let me know.
+* When compiling for Linux:
+
+ + the header files of the Linux kernel must be available in the
+ search path of the CPP as <linux/*.h> and <asm/*.h>.
+
+
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
[Q7] ``When I run `nm libc.so|grep " U "' on the produced library
I still find unresolved symbols? Can this be ok?''
@@ -138,7 +144,7 @@ Older releases are known to have bugs that affect building the GNU C library.
symbols:
* magic symbols automatically generated by the linker. Names are
- often like __start_* and __stop_*-
+ often like __start_* and __stop_*
* symbols resolved by using libgcc.a
(__udivdi3, __umoddi3, or similar)
@@ -161,14 +167,18 @@ and with cleanliness. With the introduction of a new version number these
errors now can be corrected. Here is a list of the known source code
incompatibilities:
-* _GNU_SOURCE: glibc does not automatically define _GNU_SOURCE. Thus, if a
- program depends on GNU extensions, it is necessary to compile it with C
- compiler option -D_GNU_SOURCE, or better, to put `#define _GNU_SOURCE' at
- the beginning of your source files, before any C library header files are
- included. This difference normally mainfests itself in the form of
- missing prototypes and/or data type definitions. Thus, if you get such
- errors, the first thing you should do is try defining _GNU_SOURCE and see
- if that makes the problem go away.
+* _GNU_SOURCE: glibc does not automatically define _GNU_SOURCE. Thus,
+ if a program depends on GNU extensions or some other non-standard
+ functionality, it is necessary to compile it with C compiler option
+ -D_GNU_SOURCE, or better, to put `#define _GNU_SOURCE' at the beginning
+ of your source files, before any C library header files are included.
+ This difference normally manifests itself in the form of missing
+ prototypes and/or data type definitions. Thus, if you get such errors,
+ the first thing you should do is try defining _GNU_SOURCE and see if
+ that makes the problem go away.
+
+ For more information consult the file `NOTES' part of the GNU C
+ library sources.
* reboot(): GNU libc sanitizes the interface of reboot() to be more
compatible with the interface used on other OSes. In particular,
@@ -209,7 +219,7 @@ Answers were given by:
{DMT} David Mosberger-Tang, <davidm@AZStarNet.com>
Amended by:
-{RM} Roland McGrath <roland@gnu.ai.mit.edu>
+{RM} Roland McGrath, <roland@gnu.ai.mit.edu>
Local Variables:
mode:text
diff --git a/Makefile b/Makefile
index 8ff7284d73..c33e40f6b2 100644
--- a/Makefile
+++ b/Makefile
@@ -222,8 +222,8 @@ parent_echo-distinfo:
# Make the distribution tarfile.
-distribute := README INSTALL FAQ NOTES COPYING.LIB COPYING NEWS \
- ChangeLog ChangeLog.[0-9] \
+distribute := README INSTALL FAQ NOTES NEWS PROJECTS \
+ COPYING.LIB COPYING ChangeLog ChangeLog.[0-9] \
Makefile Makeconfig Makerules Rules Make-dist MakeTAGS \
extra-lib.mk o-iterator.mk \
ansidecl.h mkinstalldirs move-if-change install-sh \
diff --git a/PROJECTS b/PROJECTS
new file mode 100644
index 0000000000..3150ce11cf
--- /dev/null
+++ b/PROJECTS
@@ -0,0 +1,98 @@
+Open jobs for finishing GNU libc:
+---------------------------------
+Status: May 1996
+
+If you have time and talent to take over any of the jobs below please
+contact <bug-glibc@prep.ai.mit.edu>
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+[ 1] Port to new platforms or test current version on formerly supported
+ platforms.
+
+
+[ 2] Test compliance with standards. If you have access to recent
+ standards (IEEE, ISO, ANSI, X/Open, ...) and/or test suites you
+ could do some checks as the goal is to be compliant with all
+ standards if they do not contradict each other.
+
+
+[ 3] Write translations for the GNU libc message for the so far
+ unsupported languages. GNU libc is fully internationalized and
+ users can immediately benefit from this.
+
+ Take a look at the matrix in
+ ftp://prep.ai.mit.edu/pub/gnu/ABOUT-NLS
+ for the current status (of course better use a mirror of prep).
+
+
+[ 4] Write wordexp() function; this is described in POSIX.2, The
+ header <wordexp.h> already exists.
+
+ Implementation idea: use some functions from bash.
+
+
+[ 5] Write reentrent versions of crypt() et.al.
+
+ Implementation idea: Define in <crypt.h>
+
+ struct crypt_data
+ {
+ <... all the needed data ...>
+ };
+
+ and define additional functions
+
+ char *crypt_r (__const char *__key, __const char *__salt,
+ struct crypt_data *__data);
+
+ void setkey_r (__const char *__key, struct crypt_data *__data);
+
+ void encrypt_r (char *__block, int __edflag,
+ struct crypt_data *__data);
+
+ If possible the non-reentrent functions should use the reentrent
+ ones.
+
+ Because of the US export restrictions it might be a good idea if
+ some non-american person does this job.
+
+
+[ 6] Write `long double' versions of the math functions. This should be
+ done in collaboration with the NetBSD and FreeBSD people.
+
+ The libm is in fact fdlibm (not the same as in Linux libc).
+
+
+[ 7] If you enjoy assembler programming (as I do --drepper :-) you might
+ be interested in writing optimized versions for some functions.
+ Especially the string handling functions can be optimized a lot.
+
+ Take a look at
+
+ Faster String Functions
+ Henry Spencer, University of Toronto
+ Usenix Winter '92, pp. 419--428
+
+ or just ask. Currently mostly i?86 optimized versions exist.
+
+
+[ 8] Write nftw() function. Perhaps it might be good to reimplement the
+ ftw() function as well to share most of the code.
+
+
+[ 9] Write AVL-tree based tsearch() et.al. functions. Currently only
+ a very simple algorithm is used.
+
+
+[10] Extend regex and/or rx to work with wide characters.
+
+
+[11] Add mmap() support to malloc().
+ Doug Lea's malloc implementation might give some ideas. Perhaps
+ switching completly to his implementation is an option if it
+ a) can work without mmap() support (not all system GNU libc
+ is running on have mmap)
+ b) is without mmap support at least as fast as the current
+ implementation
+ c) will be extended with the current hooks and additional functions
diff --git a/elf/dl-error.c b/elf/dl-error.c
index a5c861190f..737bba7421 100644
--- a/elf/dl-error.c
+++ b/elf/dl-error.c
@@ -1,5 +1,5 @@
/* Error handling for runtime dynamic linker.
-Copyright (C) 1995 Free Software Foundation, Inc.
+Copyright (C) 1995, 1996 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
@@ -20,18 +20,47 @@ Cambridge, MA 02139, USA. */
#include <stddef.h>
#include <link.h>
#include <setjmp.h>
+#include <string.h>
+
+/* This structure communicates state between _dl_catch_error and
+ _dl_signal_error. */
+struct catch
+ {
+ const char *errstring, *objname; /* Error detail filled in here. */
+ jmp_buf env; /* longjmp here on error. */
+ };
+
+/* This points to such a structure during a call to _dl_catch_error.
+ During implicit startup and run-time work for needed shared libraries,
+ this is null. */
+static struct catch *catch;
-static jmp_buf catch_env;
-static const char *signalled_errstring, *signalled_objname;
void
_dl_signal_error (int errcode,
const char *objname,
const char *errstring)
{
- signalled_errstring = errstring ?: "DYNAMIC LINKER BUG!!!";
- signalled_objname = objname;
- longjmp (catch_env, errcode ?: -1);
+ if (! errstring)
+ errstring = "DYNAMIC LINKER BUG!!!";
+
+ if (catch)
+ {
+ /* We are inside _dl_catch_error. Return to it. */
+ catch->errstring = errstring;
+ catch->objname = objname;
+ longjmp (catch->env, errcode ?: -1);
+ }
+ else
+ {
+ /* Lossage while resolving the program's own symbols is always fatal. */
+ extern char **_dl_argv; /* Set in rtld.c at startup. */
+ _dl_sysdep_fatal (_dl_argv[0] ?: "<program name unknown>",
+ ": error in loading shared libraries\n",
+ objname ?: "", objname ? ": " : "",
+ errstring, errcode ? ": " : "",
+ errcode ? strerror (errcode) : "", "\n", NULL);
+ }
}
int
@@ -40,18 +69,20 @@ _dl_catch_error (const char **errstring,
void (*operate) (void))
{
int errcode;
+ struct catch c = { errstring: NULL, objname: NULL };
- signalled_errstring = signalled_objname = NULL;
- errcode = setjmp (catch_env);
+ errcode = setjmp (c.env);
if (errcode == 0)
{
+ catch = &c;
(*operate) ();
+ catch = NULL;
*errstring = *objname = NULL;
return 0;
}
/* We get here only if we longjmp'd out of OPERATE. */
- *errstring = signalled_errstring;
- *objname = signalled_objname;
+ *errstring = c.errstring;
+ *objname = c.objname;
return errcode == -1 ? 0 : errcode;
}
diff --git a/elf/elf.h b/elf/elf.h
index a78432039f..2b41ff0cbc 100644
--- a/elf/elf.h
+++ b/elf/elf.h
@@ -119,6 +119,7 @@ typedef struct
#define EM_SPARC64 11 /* SPARC v9 (not official) 64-bit */
#define EM_PARISC 15 /* HPPA */
+#define EM_PPC 20 /* PowerPC */
/* If it is necessary to assign new unofficial EM_* values, please
pick large random numbers (0x8523, 0xa7f2, etc.) to minimize the
@@ -255,6 +256,10 @@ typedef struct
#define ELF32_R_TYPE(val) ((val) & 0xff)
#define ELF32_R_INFO(sym, type) (((sym) << 8) + ((type) & 0xff))
+#define ELF64_R_SYM(i) ((i) >> 32)
+#define ELF64_R_TYPE(i) ((i) & 0xffffffff)
+#define ELF64_R_INFO(sym,type) (((sym) << 32) + (type))
+
/* Program segment header. */
typedef struct {
@@ -288,6 +293,17 @@ typedef struct {
#define PF_R (1 << 2) /* Segment is readable */
#define PF_MASKPROC 0xf0000000 /* Processor-specific */
+/* Legal values for note segment descriptor types for core files. */
+
+#define NT_PRSTATUS 1 /* Contains copy of prstatus struct */
+#define NT_FPREGSET 2 /* Contains copy of fpregset struct */
+#define NT_PRPSINFO 3 /* Contains copy of prpsinfo struct */
+
+/* Legal values for the note segment descriptor types for object files. */
+
+#define NT_VERSION 1 /* Contains a version string. */
+
+
/* Dynamic section entry. */
typedef struct
@@ -521,9 +537,17 @@ typedef struct
#define EF_MIPS_CPIC 4 /* Uses PIC calling sequence */
#define EF_MIPS_ARCH 0xf0000000 /* MIPS architecture level */
+/* Legal values for MIPS architecture level. */
+
+#define E_MIPS_ARCH_1 0x00000000 /* -mips1 code. */
+#define E_MIPS_ARCH_2 0x10000000 /* -mips2 code. */
+#define E_MIPS_ARCH_3 0x20000000 /* -mips3 code. */
+
/* Special section indices. */
#define SHN_MIPS_ACOMMON 0xff00 /* Allocated common symbols */
+#define SHN_MIPS_TEXT 0xff01 /* Allocated test symbol. */
+#define SHN_MIPS_DATA 0xff02 /* Allocated data symbol. */
#define SHN_MIPS_SCOMMON 0xff03 /* Small common symbols */
#define SHN_MIPS_SUNDEFINED 0xff04 /* Small undefined symbols */
@@ -535,6 +559,9 @@ typedef struct
#define SHT_MIPS_UCODE 0x70000004 /* Reserved for SGI/MIPS compilers */
#define SHT_MIPS_DEBUG 0x70000005 /* MIPS ECOFF debugging information */
#define SHT_MIPS_REGINFO 0x70000006 /* Register usage information */
+#define SHT_MIPS_OPTIONS 0x7000000d /* Miscellaneous options. */
+#define SHT_MIPS_DWARF 0x7000001e /* DWARF debugging information. */
+#define SHT_MIPS_EVENTS 0x70000021 /* Event section. */
/* Legal values for sh_flags field of Elf32_Shdr. */
@@ -602,7 +629,8 @@ typedef struct
#define DT