Skip to content

Commit

Permalink
Minor optimization of unloading prevention patch.
Browse files Browse the repository at this point in the history
References to unique symbols from copy relocations can only come
from executables which cannot be unloaded anyway.  Optimize the
code to set the unload flag a bit.
  • Loading branch information
Ulrich Drepper committed Jul 23, 2009
1 parent fe4d293 commit c15b1d2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions elf/dl-lookup.c
Original file line number Diff line number Diff line change
Expand Up @@ -331,12 +331,12 @@ do_lookup_x (const char *undef_name, uint_fast32_t new_hash,
{
table[idx].sym = sym;
table[idx].map = map;
}

if (table[idx].map->l_type == lt_loaded)
/* Make sure we don't unload this object by
setting the appropriate flag. */
table[idx].map->l_flags_1 |= DF_1_NODELETE;
if (map->l_type == lt_loaded)
/* Make sure we don't unload this object by
setting the appropriate flag. */
map->l_flags_1 |= DF_1_NODELETE;
}

return;
}
Expand Down

0 comments on commit c15b1d2

Please sign in to comment.