about summary refs log tree commit diff
path: root/elf/dl-runtime.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1996-07-14 11:39:25 +0000
committerRoland McGrath <roland@gnu.org>1996-07-14 11:39:25 +0000
commitf51d1dfd35f793488ee32c8226cb8955ed75acbe (patch)
tree0a157b3355be9569bd6217a20218e2fedd6f42d7 /elf/dl-runtime.c
parentc928de790200bc7a81224377d35a91a6103387de (diff)
downloadglibc-f51d1dfd35f793488ee32c8226cb8955ed75acbe.tar.gz
glibc-f51d1dfd35f793488ee32c8226cb8955ed75acbe.tar.xz
glibc-f51d1dfd35f793488ee32c8226cb8955ed75acbe.zip
* elf/dl-reloc.c: Include "dynamic-link.h" at file scope.
	* elf/rtld.c: Include <string.h>.

	* elf/dynamic-link.h (ELF_DYNAMIC_DO_REL, ELF_DYNAMIC_DO_RELA,
	ELF_DYNAMIC_RELOCATE): No longer take RESOLVE argument.
	Conditionalize defns on [RESOLVE].
	* elf/do-rel.h (elf_dynamic_do_rel): Likewise.
	* sysdeps/i386/dl-machine.h (elf_machine_rel): Likewise.
	Instead use RESOLVE macro with same args.
	(elf_machine_rel): Conditionalize defn on [RESOLVE].
	* elf/dl-reloc.c (RESOLVE): New macro, define before including
	"dynamic-link.h".  It replaces `resolve' local function.
	* elf/dl-runtime.c: Likewise.
	* elf/rtld.c: Likewise.
Diffstat (limited to 'elf/dl-runtime.c')
-rw-r--r--elf/dl-runtime.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/elf/dl-runtime.c b/elf/dl-runtime.c
index cdacd756ef..2785592c44 100644
--- a/elf/dl-runtime.c
+++ b/elf/dl-runtime.c
@@ -18,7 +18,6 @@ not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
 #include <link.h>
-#include "dynamic-link.h"
 
 
 /* The global scope we will use for symbol lookups.
@@ -68,6 +67,8 @@ _dl_object_relocation_scope (struct link_map *l)
     }
 }
 
+#include "dynamic-link.h"
+
 /* Figure out the right type, Rel or Rela.  */
 #define elf_machine_rel 1
 #define elf_machine_rela 2
@@ -118,14 +119,16 @@ fixup (
   /* Set up the scope to find symbols referenced by this object.  */
   struct link_map **scope = _dl_object_relocation_scope (l);
 
-  /* Perform the specified relocation.  */
-  ElfW(Addr) resolve (const ElfW(Sym) **ref,
-		      ElfW(Addr) reloc_addr, int noplt)
-    {
-      return _dl_lookup_symbol (strtab + (*ref)->st_name, ref,
-				scope, l->l_name, reloc_addr, noplt);
-    }
-  elf_machine_relplt (l, reloc, &symtab[ELFW(R_SYM) (reloc->r_info)], resolve);
+  {
+    /* This macro is used as a callback from the elf_machine_relplt code.  */
+#define RESOLVE(ref, reloc_addr, noplt) \
+  (_dl_lookup_symbol (strtab + (*ref)->st_name, ref, scope, \
+		      l->l_name, reloc_addr, noplt))
+#include "dynamic-link.h"
+
+    /* Perform the specified relocation.  */
+    elf_machine_relplt (l, reloc, &symtab[ELFW(R_SYM) (reloc->r_info)]);
+  }
 
   *_dl_global_scope_end = NULL;