Update.
authorAndreas Jaeger <aj@suse.de>
Thu, 7 Sep 2000 14:54:03 +0000 (14:54 +0000)
committerAndreas Jaeger <aj@suse.de>
Thu, 7 Sep 2000 14:54:03 +0000 (14:54 +0000)
* sysdeps/unix/sysv/linux/mips/syscalls.list: Add __syscall_fcntl.

* sysdeps/mips/dl-machine.h (RESOLVE_GOTSYM): Fix calls to
dl_lookup.
(ELF_MACHINE_RUNTIME_TRAMPOLINE): Likewise.

* sysdeps/unix/sysv/linux/mips/fcntl.c: New file.

* stdlib/tst-bsearch.c (main): Add more test cases.

ChangeLog
stdlib/tst-bsearch.c
sysdeps/mips/dl-machine.h
sysdeps/unix/sysv/linux/mips/fcntl.c [new file with mode: 0644]
sysdeps/unix/sysv/linux/mips/syscalls.list

index e4274177e95bdff16011911f6596da7d5a74e037..1a073c47e396e2f2ef346f583905859197a92656 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
 2000-09-07  Andreas Jaeger  <aj@suse.de>
 
+       * sysdeps/unix/sysv/linux/mips/syscalls.list: Add __syscall_fcntl.
+
+       * sysdeps/mips/dl-machine.h (RESOLVE_GOTSYM): Fix calls to
+       dl_lookup.
+       (ELF_MACHINE_RUNTIME_TRAMPOLINE): Likewise.
+
+       * sysdeps/unix/sysv/linux/mips/fcntl.c: New file.
+
+       * stdlib/tst-bsearch.c (main): Add more test cases.
+
        * locale/programs/ld-collate.c (handle_ellipsis): Fix typo.
        * elf/dl-load.c (_dl_map_object_from_fd): Likewise.
        Reported by GOTO Masanori <gotom@debian.or.jp>.
index 2d067c3acc66f018b5f3a2a916973d4ce1f27d6a..0f3db24fd5f6de478f9f7c6247f2cca96420fefb 100644 (file)
@@ -56,11 +56,11 @@ main (void)
 {
   int cnt;
   int result = 0;
+  struct entry key;
+  struct entry *res;
 
   for (cnt = 0; cnt < narr; ++cnt)
     {
-      struct entry key;
-      struct entry *res;
 
       key.val = arr[cnt].val;
 
@@ -77,6 +77,57 @@ main (void)
        }
     }
 
+  /* And some special tests that shouldn't find any entry.  */
+  key.val = -1;
+  res = (struct entry *) bsearch (&key, arr, narr, sizeof (arr[0]), comp);
+  if (res != NULL)
+    {
+      puts ("found an entry that's not there");
+      result = 1;
+    }
+
+  key.val = 11;
+  res = (struct entry *) bsearch (&key, arr, narr, sizeof (arr[0]), comp);
+  if (res != NULL)
+    {
+      puts ("found an entry that's not there");
+      result = 1;
+    }
+
+  key.val = 11;
+  res = (struct entry *) bsearch (&key, arr, 0, sizeof (arr[0]), comp);
+  if (res != NULL)
+    {
+      puts ("found an entry that's not there");
+      result = 1;
+    }
+  
+  /* Now the array contains only one element - no entry should be found.  */
+  for (cnt = 0; cnt < narr; ++cnt)
+    {
+      key.val = arr[cnt].val;
+
+      res = (struct entry *) bsearch (&key, &arr[5], 1, sizeof (arr[0]), comp);
+      if (cnt == 5)
+       {
+         if (res == NULL)
+           {
+             printf ("entry %d not found\n", cnt);
+             result = 1;
+           }
+         else if (res != &arr[cnt])
+           {
+             puts ("wrong entry returned");
+             result = 1;
+           }
+       }
+      else if (res != NULL)
+       {
+         puts ("found an entry that's not there");
+         result = 1;
+       }
+    }
+
   if (result == 0)
     puts ("all OK");
 
index d1ac5ccfb76e045a399adfc2e277ad69a65719f3..0d2bf9d6b611dc12325b5192c82274e96ccc2375 100644 (file)
@@ -262,14 +262,14 @@ __dl_runtime_resolve (ElfW(Word) sym_index,                                     \
              {                                                               \
                value = _dl_lookup_versioned_symbol(strtab + sym->st_name, l, \
                                                    &sym, l->l_scope, version,\
-                                                   R_MIPS_REL32);            \
+                                                   R_MIPS_REL32, 0);         \
                break;                                                        \
              }                                                               \
            /* Fall through.  */                                              \
          }                                                                   \
        case 0:                                                               \
          value = _dl_lookup_symbol (strtab + sym->st_name, l, &sym,          \
-                                    l->l_scope, R_MIPS_REL32);               \
+                                    l->l_scope, R_MIPS_REL32, 0);            \
        }                                                                     \
                                                                              \
       /* Currently value contains the base load address of the object        \
@@ -495,14 +495,14 @@ elf_machine_got_rel (struct link_map *map, int lazy)
                value = _dl_lookup_versioned_symbol(strtab + sym->st_name,\
                                                    map,                  \
                                                    &ref, scope, version, \
-                                                   R_MIPS_REL32);        \
+                                                   R_MIPS_REL32, 0);     \
                break;                                                    \
              }                                                           \
            /* Fall through.  */                                          \
          }                                                               \
        case 0:                                                           \
          value = _dl_lookup_symbol (strtab + sym->st_name, map, &ref,    \
-                                    scope, R_MIPS_REL32);                \
+                                    scope, R_MIPS_REL32, 0);             \
        }                                                                 \
                                                                          \
       (ref)? value + ref->st_value: 0;                                   \
diff --git a/sysdeps/unix/sysv/linux/mips/fcntl.c b/sysdeps/unix/sysv/linux/mips/fcntl.c
new file mode 100644 (file)
index 0000000..ea951bc
--- /dev/null
@@ -0,0 +1 @@
+#include <sysdeps/unix/sysv/linux/i386/fcntl.c>
index 1dfd983da4610f20e4da10ad28622a813f16e681..c182f6c4eb366894dbf15ba737de2ec35abd0722 100644 (file)
@@ -50,6 +50,7 @@ rt_sigqueueinfo       -       rt_sigqueueinfo i:iip   __syscall_rt_sigqueueinfo
 rt_sigsuspend  -       rt_sigsuspend   i:pi    __syscall_rt_sigsuspend
 rt_sigtimedwait        -       rt_sigtimedwait i:pppi  __syscall_rt_sigtimedwait
 s_execve       execve  execve          i:spp   __syscall_execve
+s_fcntl                -       fcntl           i:iiF   __syscall_fcntl
 s_fstat64      fxstat64 fstat64        i:ip    __syscall_fstat64
 s_ftruncate64  ftruncate64 ftruncate64 i:iiii  __syscall_ftruncate64
 s_getcwd       getcwd  getcwd          i:pi    __syscall_getcwd