about summary refs log tree commit diff
path: root/elf
diff options
context:
space:
mode:
authorAndreas Jaeger <aj@suse.de>2003-07-22 20:00:48 +0000
committerAndreas Jaeger <aj@suse.de>2003-07-22 20:00:48 +0000
commit7220da7c365f30c9e545809b472909cd17e633a1 (patch)
tree753b16dc6935f3afa248a80d59b515b4beb31cbd /elf
parent8c1bfa30e0c844f32f7576cff92d832bbc530197 (diff)
downloadglibc-7220da7c365f30c9e545809b472909cd17e633a1.tar.gz
glibc-7220da7c365f30c9e545809b472909cd17e633a1.tar.xz
glibc-7220da7c365f30c9e545809b472909cd17e633a1.zip
(process_file): Check that file is a shared object.
Diffstat (limited to 'elf')
-rw-r--r--elf/readlib.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/elf/readlib.c b/elf/readlib.c
index efc2e10053..da0f08cc0b 100644
--- a/elf/readlib.c
+++ b/elf/readlib.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Andreas Jaeger <aj@suse.de>, 1999 and
 		  Jakub Jelinek <jakub@redhat.com>, 1999.
@@ -158,11 +158,12 @@ process_file (const char *real_file_name, const char *file_name,
 	error (0, 0, _("%s is not an ELF file - it has the wrong magic bytes at the start.\n"),
 	       file_name);
       ret = 1;
-      goto done;
     }
-
-  if (process_elf_file (file_name, lib, flag, osversion, soname,
-			file_contents, statbuf.st_size))
+  /* Libraries have to be shared object files.  */
+  else if (elf_header->e_type != ET_DYN)
+    ret = 1;
+  else if (process_elf_file (file_name, lib, flag, osversion, soname,
+			     file_contents, statbuf.st_size))
     ret = 1;
 
  done: