summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1997-03-20 03:39:46 +0000
committerUlrich Drepper <drepper@redhat.com>1997-03-20 03:39:46 +0000
commit03a5167722c12821e073f9831d2afb84414748cf (patch)
tree58144282361659b8eb066856604602077dbda57a
parent(tests): Add $(test-srcs). (diff)
downloadglibc-03a5167722c12821e073f9831d2afb84414748cf.tar.gz
glibc-03a5167722c12821e073f9831d2afb84414748cf.tar.bz2
glibc-03a5167722c12821e073f9831d2afb84414748cf.zip
(RESOLVE): Don't try to resolve local symbols.
-rw-r--r--elf/dl-reloc.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/elf/dl-reloc.c b/elf/dl-reloc.c
index e299e523ee..51afaee011 100644
--- a/elf/dl-reloc.c
+++ b/elf/dl-reloc.c
@@ -1,5 +1,5 @@
/* Relocate a shared object and resolve its references to other loaded objects.
- Copyright (C) 1995, 1996 Free Software Foundation, Inc.
+ Copyright (C) 1995, 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
@@ -58,8 +58,11 @@ _dl_relocate_object (struct link_map *l, struct link_map *scope[], int lazy)
/* This macro is used as a callback from the ELF_DYNAMIC_RELOCATE code. */
#define RESOLVE(ref, flags) \
- (_dl_lookup_symbol (strtab + (*ref)->st_name, ref, scope, \
- l->l_name, flags))
+ (((*ref)->st_shndx != SHN_UNDEF && \
+ ELFW(ST_BIND) ((*ref)->st_info) == STB_LOCAL) \
+ ? l->l_addr \
+ : _dl_lookup_symbol (strtab + (*ref)->st_name, ref, scope, \
+ l->l_name, flags))
#include "dynamic-link.h"
ELF_DYNAMIC_RELOCATE (l, lazy);