about summary refs log tree commit diff
path: root/elf
diff options
context:
space:
mode:
Diffstat (limited to 'elf')
-rw-r--r--elf/Makefile2
-rw-r--r--elf/dl-lookup.c7
-rw-r--r--elf/dlfcn.h2
-rw-r--r--elf/elf.h43
-rw-r--r--elf/eval.c4
-rw-r--r--elf/link.h5
6 files changed, 35 insertions, 28 deletions
diff --git a/elf/Makefile b/elf/Makefile
index 489a565945..ef9207c07b 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -20,7 +20,7 @@
 
 subdir		:= elf
 
-headers		= elf.h elfclass.h link.h dlfcn.h
+headers		= elf.h bits/elfclass.h link.h dlfcn.h
 routines	= $(dl-routines) dl-open dl-close dl-symbol dl-support \
 		  dl-version enbl-secure
 
diff --git a/elf/dl-lookup.c b/elf/dl-lookup.c
index f2ce4c9c3c..15da23d95c 100644
--- a/elf/dl-lookup.c
+++ b/elf/dl-lookup.c
@@ -83,6 +83,11 @@ do_lookup (const char *undef_name, unsigned long int hash,
       if (skip != NULL && map == skip)
 	continue;
 
+      /* Skip objects that could not be opened, which can occur in trace
+	 mode.  */
+      if (map->l_opencount == 0)
+	continue;
+
       /* Don't search the executable when resolving a copy reloc.  */
       if (elf_machine_lookup_noexec_p (reloc_type) &&
 	  map->l_type == lt_executable)
@@ -285,7 +290,7 @@ _dl_lookup_versioned_symbol (const char *undef_name, const ElfW(Sym) **ref,
       if (res < 0)
 	/* Oh, oh.  The file named in the relocation entry does not
 	   contain the needed symbol.  */
-	_dl_signal_error (0, *reference_name ? reference_name : NULL,
+	_dl_signal_error (0, reference_name,
 			  make_string ("symbol ", undef_name, ", version ",
 				       version->name,
 				       " not defined in file ",
diff --git a/elf/dlfcn.h b/elf/dlfcn.h
index 94e1fae8a4..9b06988e96 100644
--- a/elf/dlfcn.h
+++ b/elf/dlfcn.h
@@ -18,8 +18,8 @@
    Boston, MA 02111-1307, USA.  */
 
 #ifndef	_DLFCN_H
-
 #define	_DLFCN_H 1
+
 #include <features.h>
 
 /* The MODE argument to `dlopen' contains one of the following: */
diff --git a/elf/elf.h b/elf/elf.h
index 76f6c6865d..63d36b141c 100644
--- a/elf/elf.h
+++ b/elf/elf.h
@@ -19,46 +19,47 @@
    Boston, MA 02111-1307, USA.  */
 
 #ifndef _ELF_H
-
 #define	_ELF_H 1
+
 #include <sys/cdefs.h>
 
 __BEGIN_DECLS
 
-/* Standard ELF types.  Using __attribute__ mode ensures that GCC
-   will choose the right number of bits for these types.  */
+/* Standard ELF types.  */
+
+#include <inttypes.h>
 
 /* Type for a 16-bit quantity.  */
-typedef unsigned int Elf32_Half    __attribute__ ((mode (HI)));
-typedef unsigned int Elf64_Half    __attribute__ ((mode (HI)));
+typedef uint16_t Elf32_Half;
+typedef uint16_t Elf64_Half;
 
 /* Types for signed and unsigned 32-bit quantities.  */
-typedef unsigned int Elf32_Word    __attribute__ ((mode (SI)));
-typedef		 int Elf32_Sword   __attribute__ ((mode (SI)));
-typedef unsigned int Elf64_Word    __attribute__ ((mode (SI)));
-typedef		 int Elf64_Sword   __attribute__ ((mode (SI)));
+typedef uint32_t Elf32_Word;
+typedef	int32_t  Elf32_Sword;
+typedef uint32_t Elf64_Word;
+typedef	int32_t  Elf64_Sword;
 
 /* Types for signed and unsigned 64-bit quantities.  */
-typedef unsigned int Elf32_Xword   __attribute__ ((mode (DI)));
-typedef		 int Elf32_Sxword  __attribute__ ((mode (DI)));
-typedef unsigned int Elf64_Xword   __attribute__ ((mode (DI)));
-typedef		 int Elf64_Sxword  __attribute__ ((mode (DI)));
+typedef uint64_t Elf32_Xword;
+typedef	int64_t  Elf32_Sxword;
+typedef uint64_t Elf64_Xword;
+typedef	int64_t  Elf64_Sxword;
 
 /* Type of addresses.  */
-typedef unsigned int Elf32_Addr    __attribute__ ((mode (SI)));
-typedef unsigned int Elf64_Addr    __attribute__ ((mode (DI)));
+typedef uint32_t Elf32_Addr;
+typedef uint64_t Elf64_Addr;
 
 /* Type of file offsets.  */
-typedef unsigned int Elf32_Off     __attribute__ ((mode (SI)));
-typedef unsigned int Elf64_Off     __attribute__ ((mode (DI)));
+typedef uint32_t Elf32_Off;
+typedef uint64_t Elf64_Off;
 
 /* Type for section indices, which are 16-bit quantities.  */
-typedef unsigned int Elf32_Section __attribute__ ((mode (HI)));
-typedef unsigned int Elf64_Section __attribute__ ((mode (HI)));
+typedef uint16_t Elf32_Section;
+typedef uint16_t Elf64_Section;
 
 /* Type of symbol indices.  */
-typedef unsigned int Elf32_Symndx  __attribute__ ((mode (SI)));
-typedef unsigned int Elf64_Symndx  __attribute__ ((mode (DI)));
+typedef uint32_t Elf32_Symndx;
+typedef uint64_t Elf64_Symndx;
 
 
 /* The ELF file header.  This appears at the start of every ELF file.  */
diff --git a/elf/eval.c b/elf/eval.c
index 7d53671f6c..ce452b722c 100644
--- a/elf/eval.c
+++ b/elf/eval.c
@@ -1,5 +1,5 @@
 /* You don't really want to know what this hack is for.
-   Copyright (C) 1996 Free Software Foundation, Inc.
+   Copyright (C) 1996, 1997 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
@@ -128,7 +128,7 @@ _start (void)
   char *buf = NULL;
   size_t bufsz = 0;
 
-  while (__getline (&buf, &bufsz, stdin) > 0)
+  while (__getdelim (&buf, &bufsz, '\n', stdin) > 0)
     {
       char *p = buf;
       eval (&p);
diff --git a/elf/link.h b/elf/link.h
index c894540e5e..6c272fe054 100644
--- a/elf/link.h
+++ b/elf/link.h
@@ -18,8 +18,8 @@
    Boston, MA 02111-1307, USA.  */
 
 #ifndef	_LINK_H
-
 #define	_LINK_H	1
+
 #include <features.h>
 
 #define __need_size_t
@@ -36,7 +36,8 @@ __BEGIN_DECLS
 #define ELFW(type)	_ElfW (ELF, __ELF_NATIVE_CLASS, type)
 #define _ElfW(e,w,t)	_ElfW_1 (e, w, _##t)
 #define _ElfW_1(e,w,t)	e##w##t
-#include <elfclass.h>		/* Defines __ELF_NATIVE_CLASS.  */
+
+#include <bits/elfclass.h>		/* Defines __ELF_NATIVE_CLASS.  */
 
 /* Rendezvous structure used by the run-time dynamic linker to communicate
    details of shared object loading to the debugger.  If the executable's