summary refs log tree commit diff
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1996-01-11 18:09:50 +0000
committerRoland McGrath <roland@gnu.org>1996-01-11 18:09:50 +0000
commitd94d8f2a5960683c324e184f1240b0c26fd3bc09 (patch)
treece43d752dea56c235060b4ed73ea191e0ac74183
parent72d8cdf09dead3ee9765f1978a70147ec8545a55 (diff)
downloadglibc-d94d8f2a5960683c324e184f1240b0c26fd3bc09.tar.gz
glibc-d94d8f2a5960683c324e184f1240b0c26fd3bc09.tar.xz
glibc-d94d8f2a5960683c324e184f1240b0c26fd3bc09.zip
Thu Jan 11 13:09:20 1996 Roland McGrath <roland@churchy.gnu.ai.mit.edu> cvs/libc-960112
	* elf/do-rel.h (elf_dynamic_do_rel): Use referring symbol as
	referent for STB_LOCAL.
-rw-r--r--ChangeLog5
-rw-r--r--elf/do-rel.h7
2 files changed, 10 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 30f864e77c..ab1bec38e0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Thu Jan 11 13:09:20 1996  Roland McGrath  <roland@churchy.gnu.ai.mit.edu>
+
+	* elf/do-rel.h (elf_dynamic_do_rel): Use referring symbol as
+	referent for STB_LOCAL.
+
 Wed Jan 10 10:11:39 1996  Roland McGrath  <roland@churchy.gnu.ai.mit.edu>
 
 	* time/africa, time/antarctica, time/asia, time/australasia,
diff --git a/elf/do-rel.h b/elf/do-rel.h
index 9657bc2297..72e7d01cb4 100644
--- a/elf/do-rel.h
+++ b/elf/do-rel.h
@@ -1,5 +1,5 @@
 /* Do relocations for ELF dynamic linking.
-Copyright (C) 1995 Free Software Foundation, Inc.
+Copyright (C) 1995, 1996 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
@@ -36,7 +36,7 @@ Cambridge, MA 02139, USA.  */
 
 static inline void
 elf_dynamic_do_rel (struct link_map *map,
-		    int reltag, int sztag, 
+		    int reltag, int sztag,
 		    Elf32_Addr (*resolve) (const Elf32_Sym **symbol,
 					   Elf32_Addr r_offset),
 		    int lazy)
@@ -59,6 +59,9 @@ elf_dynamic_do_rel (struct link_map *map,
 
 	if (ELF32_R_SYM (r->r_info) == STN_UNDEF)
 	  loadbase = 0;		/* This value will not be consulted.  */
+	else if (ELF32_ST_BIND (definer->st_info) == STB_LOCAL)
+	  /* Local symbols always refer to the containing object.  */
+	  loadbase = map->l_addr;
 	else
 	  {
 	    if (resolve)