diff options
author | Ulrich Drepper <drepper@redhat.com> | 1998-02-18 11:00:24 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 1998-02-18 11:00:24 +0000 |
commit | da8324650d7e867028d1d5e9bcaed962bc6b2322 (patch) | |
tree | cc31a3e0c6b34a8ee51b238c1599ca39784e3693 /elf/dl-minimal.c | |
parent | 1b5fd8308347c4ac7f6a42aaf49ddb32ce2e09ec (diff) | |
download | glibc-da8324650d7e867028d1d5e9bcaed962bc6b2322.tar.gz glibc-da8324650d7e867028d1d5e9bcaed962bc6b2322.tar.xz glibc-da8324650d7e867028d1d5e9bcaed962bc6b2322.zip |
Update. cvs/libc-980218
1998-02-17 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * elf/dl-load.c (add_name_to_object): Don't translate strings. * elf/dl-minimal.c (_strerror_internal): Define it here to avoid pulling in the whole error list. (__dcgettext, dcgettext): Removed. * libc.map: Export _strerror_internal. 1998-02-18 10:50 Ulrich Drepper <drepper@cygnus.com> * sysdeps/i386/fpu/t_exp.c: New file. 1998-02-18 Andreas Jaeger <aj@arthur.rhein-neckar.de> * nis/libnss_nisplus.map: NIS+ support is new in glibc 2.1, add everything with version GLIBC_2.1. * hesiod/libnss_hesiod.map: Likewise. 1998-02-18 Andreas Jaeger <aj@arthur.rhein-neckar.de> * manual/arith.texi (Old-style number conversion): This node is a section, not a subsection. 1998-02-17 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * elf/dl-lookup.c (make_string): Use __stpcpy instead of stpcpy. 1998-02-17 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * elf/rtld.c (dl_main): Make sure that the library search paths have been initialized before the first call to _dl_map_object. 1998-02-17 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * Makerules (common-generated): Add libc_pic.os. 1998-02-17 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * elf/rtld.c (dl_main): Use PT_PHDR to figure out the load address of the executable. 1998-02-18 10:28 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
Diffstat (limited to 'elf/dl-minimal.c')
-rw-r--r-- | elf/dl-minimal.c | 43 |
1 files changed, 38 insertions, 5 deletions
diff --git a/elf/dl-minimal.c b/elf/dl-minimal.c index 088c2331f6..da9c33f099 100644 --- a/elf/dl-minimal.c +++ b/elf/dl-minimal.c @@ -24,6 +24,7 @@ #include <string.h> #include <link.h> #include <stdio-common/_itoa.h> +#include <errno.h> /* Minimal `malloc' allocator for use while loading shared libraries. Only small blocks are allocated, and none are ever freed. */ @@ -123,15 +124,47 @@ longjmp (jmp_buf env, int val) __longjmp (env[0].__jmpbuf, val); } -/* Define our own stub for the localization function used by strerror. - English-only in the dynamic linker keeps it smaller. */ +/* Define our own version of the internal function used by strerror. We + only provide the messages for some common errors. This avoids pulling + in the whole error list. */ char * weak_function -__dcgettext (const char *domainname, const char *msgid, int category) +_strerror_internal (int errnum, char *buf, size_t buflen) { - return (char *) msgid; + char *msg; + + switch (errnum) + { + case ENOMEM: + msg = (char *) "Cannot allocate memory"; + break; + case EINVAL: + msg = (char *) "Invalid argument"; + break; + case ENOENT: + msg = (char *) "No such file or directory"; + break; + case EPERM: + msg = (char *) "Operation not permitted"; + break; + case EIO: + msg = (char *) "Input/output error"; + break; + case EACCES: + msg = (char *) "Permission denied"; + break; + default: + /* No need to check buffer size, all calls in the dynamic linker + provide enough space. */ + buf[buflen - 1] = '\0'; + msg = _itoa_word (errnum, buf + buflen - 1, 10, 0); + msg = memcpy (msg - (sizeof ("Error ") - 1), "Error ", + sizeof ("Error ") - 1); + break; + } + + return msg; } -weak_alias (__dcgettext, dcgettext) #ifndef NDEBUG |