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

Preserve link time dependencies over relocation dependencies

This commit is contained in:
Andreas Schwab
2011-10-19 17:13:56 +02:00
parent 855d156018
commit d45c60c2fe
3 changed files with 21 additions and 5 deletions

View File

@@ -100,7 +100,17 @@ _dl_sort_fini (struct link_map **maps, size_t nmaps, char *used, Lmid_t ns)
/* Look through the relocation dependencies of the object. */
while (m-- > 0)
if (__builtin_expect (relmaps[m] == thisp, 0))
goto move;
{
/* If a cycle exists with a link time dependency,
preserve the latter. */
struct link_map **runp = thisp->l_initfini;
if (runp != NULL)
while (*runp != NULL)
if (__builtin_expect (*runp++ == maps[k], 0))
goto ignore;
goto move;
}
ignore:;
}
--k;