1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-12-24 17:51:17 +03:00

Fix copy relocations handling of unique objects.

This commit is contained in:
Ulrich Drepper
2011-03-10 12:51:33 -05:00
parent 908ea63341
commit 028478fa40
9 changed files with 85 additions and 9 deletions

View File

@@ -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;
}