diff options
author | Ulrich Drepper <drepper@gmail.com> | 2011-03-10 12:51:33 -0500 |
---|---|---|
committer | Ulrich Drepper <drepper@gmail.com> | 2011-03-10 12:51:33 -0500 |
commit | 028478fa40d85a73b19638dbe3f83b1acebf370c (patch) | |
tree | 03f5573c44e2cde7b809f44134526d202c8b29e2 /elf/dl-lookup.c | |
parent | 908ea63341bbbca534411a0581cd16ba36e08706 (diff) | |
download | glibc-028478fa40d85a73b19638dbe3f83b1acebf370c.tar glibc-028478fa40d85a73b19638dbe3f83b1acebf370c.tar.gz glibc-028478fa40d85a73b19638dbe3f83b1acebf370c.tar.bz2 glibc-028478fa40d85a73b19638dbe3f83b1acebf370c.zip |
Fix copy relocations handling of unique objects.
Diffstat (limited to 'elf/dl-lookup.c')
-rw-r--r-- | elf/dl-lookup.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/elf/dl-lookup.c b/elf/dl-lookup.c index 78c8669e30..874a4bba4e 100644 --- a/elf/dl-lookup.c +++ b/elf/dl-lookup.c @@ -1,6 +1,5 @@ /* Look up a symbol in the loaded objects. - Copyright (C) 1995-2005, 2006, 2007, 2009, 2010 - Free Software Foundation, Inc. + Copyright (C) 1995-2007, 2009, 2010, 2011 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 @@ -364,8 +363,19 @@ do_lookup_x (const char *undef_name, uint_fast32_t new_hash, if (entries[idx].hashval == new_hash && strcmp (entries[idx].name, undef_name) == 0) { - result->s = entries[idx].sym; - result->m = (struct link_map *) entries[idx].map; + if ((type_class & ELF_RTYPE_CLASS_COPY) != 0) + { + /* We possibly have to initialize the central + copy from the copy addressed through the + relocation. */ + result->s = sym; + result->m = (struct link_map *) map; + } + else + { + result->s = entries[idx].sym; + result->m = (struct link_map *) entries[idx].map; + } __rtld_lock_unlock_recursive (tab->lock); return 1; } |