]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Update.
authorUlrich Drepper <drepper@redhat.com>
Tue, 10 Aug 1999 05:41:26 +0000 (05:41 +0000)
committerUlrich Drepper <drepper@redhat.com>
Tue, 10 Aug 1999 05:41:26 +0000 (05:41 +0000)
1999-08-09  Scott Bambrough  <scottb@netwinder.org>

* elf/elf.h: Added definition of ELFOSABI_ARM.
* elf/dl-load.c (_dl_map_object_from_fd): Use VALID_ELF_HEADER,
VALID_ELF_OSABI, VALID_ELF_ABIVERSION to decide whether an
object's header and ABI values are acceptable.
(VALID_ELF_HEADER): New macro; provide default definition.
(VALID_ELF_OSABI): New macro; provide default definition.
(VALID_ELF_ABIVERSION): New macro; provide default definition.
* sysdeps/arm/dl-machine.h Define ARM specific versions of
VALID_ELF_HEADER, VALID_ELF_OSABI, VALID_ELF_ABIVERSION.

1999-08-09  Andreas Schwab  <schwab@suse.de>

* inet/tst-ipnode.c (main): Don't compare integer with NULL.

1999-08-09  Thorsten Kukuk  <kukuk@suse.de>

* sunrpc/svc_run.c (svc_run): Free my_pollfd.

1999-08-09  Andreas Schwab  <schwab@suse.de>

* sunrpc/svc.c (svc_getreq_poll): Fix argument of xprt_unregister.

ChangeLog
elf/dl-load.c
elf/elf.h
inet/tst-ipnode.c
sunrpc/svc.c
sunrpc/svc_run.c
sysdeps/arm/dl-machine.h

index 76aa414071ae84b36cbaf843863e2da765af2dc2..7d3e361b4528e9b066402eb3fdde7cfd743c8f70 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,27 @@
+1999-08-09  Scott Bambrough  <scottb@netwinder.org>
+
+       * elf/elf.h: Added definition of ELFOSABI_ARM.
+       * elf/dl-load.c (_dl_map_object_from_fd): Use VALID_ELF_HEADER,
+       VALID_ELF_OSABI, VALID_ELF_ABIVERSION to decide whether an
+       object's header and ABI values are acceptable.
+       (VALID_ELF_HEADER): New macro; provide default definition.
+       (VALID_ELF_OSABI): New macro; provide default definition.
+       (VALID_ELF_ABIVERSION): New macro; provide default definition.
+       * sysdeps/arm/dl-machine.h Define ARM specific versions of
+       VALID_ELF_HEADER, VALID_ELF_OSABI, VALID_ELF_ABIVERSION.
+
+1999-08-09  Andreas Schwab  <schwab@suse.de>
+
+       * inet/tst-ipnode.c (main): Don't compare integer with NULL.
+
+1999-08-09  Thorsten Kukuk  <kukuk@suse.de>
+
+       * sunrpc/svc_run.c (svc_run): Free my_pollfd.
+
+1999-08-09  Andreas Schwab  <schwab@suse.de>
+
+       * sunrpc/svc.c (svc_getreq_poll): Fix argument of xprt_unregister.
+
 1999-08-08  Ulrich Drepper  <drepper@cygnus.com>
 
        * sysdeps/ieee754/ieee754.h: Handle platforms with special
index 7640ec328974ecd9f810ad588db380e7cdea5a8c..2f3e878e7a62d0a7b195b899d9732443e53c029a 100644 (file)
@@ -673,6 +673,11 @@ _dl_map_object_from_fd (const char *name, int fd, char *realname,
   /* This is the expected ELF header.  */
 #define ELF32_CLASS ELFCLASS32
 #define ELF64_CLASS ELFCLASS64
+#ifndef VALID_ELF_HEADER
+# define VALID_ELF_HEADER(hdr,exp,size)        (memcmp (hdr, exp, size) == 0)
+# define VALID_ELF_OSABI(osabi)                (osabi == ELFOSABI_SYSV)
+# define VALID_ELF_ABIVERSION(ver)     (ver == 0)
+#endif
   static const unsigned char expected[EI_PAD] =
   {
     [EI_MAG0] = ELFMAG0,
@@ -739,7 +744,8 @@ _dl_map_object_from_fd (const char *name, int fd, char *realname,
   header = (void *) readbuf;
 
   /* Check the header for basic validity.  */
-  if (__builtin_expect (memcmp (header->e_ident, expected, EI_PAD), 0) != 0)
+  if (__builtin_expect (VALID_ELF_HEADER (header->e_ident, expected, EI_PAD),
+                       0) != 0)
     {
       /* Something is wrong.  */
       if (*(Elf32_Word *) &header->e_ident !=
@@ -764,10 +770,10 @@ _dl_map_object_from_fd (const char *name, int fd, char *realname,
        LOSE (0, "ELF file version ident not " STRING(EV_CURRENT));
       /* XXX We should be able so set system specific versions which are
         allowed here.  */
-      if (header->e_ident[EI_OSABI] != ELFOSABI_SYSV)
-       LOSE (0, "ELF file OS ABI not " STRING(ELFOSABI_SYSV));
-      if (header->e_ident[EI_ABIVERSION] != 0)
-       LOSE (0, "ELF file ABI version not 0");
+      if (!VALID_ELF_OSABI (header->e_ident[EI_OSABI]))
+       LOSE (0, "ELF file OS ABI invalid.");
+      if (!VALID_ELF_ABIVERSION (header->e_ident[EI_ABIVERSION]))
+       LOSE (0, "ELF file ABI version invalid.");
       LOSE (0, "internal error");
     }
 
index e722acbef5ee59558d1756de0a21bd24fac626b9..a3ce2d98fc331d113ce2bf76aac3b91207627bac 100644 (file)
--- a/elf/elf.h
+++ b/elf/elf.h
@@ -135,6 +135,7 @@ typedef struct
 #define EI_OSABI       7               /* OS ABI identification */
 #define ELFOSABI_SYSV          0       /* UNIX System V ABI */
 #define ELFOSABI_HPUX          1       /* HP-UX */
+#define ELFOSABI_ARM           97      /* ARM */
 #define ELFOSABI_STANDALONE    255     /* Standalone (embedded) application */
 
 #define EI_ABIVERSION  8               /* ABI version */
index ad3a7e733bbcdf0ad8ab62b043dc10904098f026..b4b4dfa33de4d9deaece38a29fb4c8aca496ff0d 100644 (file)
@@ -21,5 +21,5 @@ main (void)
       ++errors;
     }
 
-  return errors != NULL;
+  return errors != 0;
 }
index 59b902dd63a4a2eab5cf7f6fcb0c9039b536848d..4446692dc0c252609995b8a6f82a2015eb74c780 100644 (file)
@@ -367,7 +367,7 @@ svc_getreq_poll (struct pollfd *pfdp, int pollretval)
          ++fds_found;
 
          if (p->revents & POLLNVAL)
-           xprt_unregister (p->fd);
+           xprt_unregister (xports[p->fd]);
          else
            svc_getreq_common (p->fd);
        }
index e6ffb0f0270d324f0ccfb3c469e4b112e3e1e60f..72fb939e78e5535da4ece0b05b21bb29c6e098ba 100644 (file)
@@ -70,14 +70,17 @@ svc_run (void)
       switch (i = __poll (my_pollfd, svc_max_pollfd, -1))
        {
        case -1:
+         free (my_pollfd);
          if (errno == EINTR)
            continue;
          perror (_("svc_run: - poll failed"));
          return;
        case 0:
+         free (my_pollfd);
          continue;
        default:
          svc_getreq_poll (my_pollfd, i);
+         free (my_pollfd);
        }
     }
 }
index d112e3fa9fce1c64bc30360346a3dad34720c728..25e2f0632120b25fb91ae03bc17182b5be3da390 100644 (file)
 
 #include <sys/param.h>
 
+#define VALID_ELF_ABIVERSION(ver)      (ver == 0)
+#define VALID_ELF_OSABI(osabi) \
+  (osabi == ELFOSABI_SYSV || osabi == ELFOSABI_ARM)
+#define VALID_ELF_HEADER(hdr,exp,size) \
+  memcmp (hdr,exp,size-2) == 0 \
+  && VALID_ELF_OSABI (hdr[EI_OSABI]) \
+  && VALID_ELF_ABIVERSION (hdr[EI_ABIVERSION])
+
 /* Return nonzero iff E_MACHINE is compatible with the running host.  */
 static inline int __attribute__ ((unused))
 elf_machine_matches_host (Elf32_Half e_machine)