diff options
Diffstat (limited to 'elf/dl-reloc.c')
-rw-r--r-- | elf/dl-reloc.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/elf/dl-reloc.c b/elf/dl-reloc.c index a3590ff749..7cbed389b8 100644 --- a/elf/dl-reloc.c +++ b/elf/dl-reloc.c @@ -69,7 +69,8 @@ _dl_relocate_object (struct link_map *l, int lazy) real_next = l->l_next; if (l->l_info[DT_SYMBOLIC]) { - l->l_prev->l_next = real_next; + if (l->l_prev) + l->l_prev->l_next = real_next; l->l_next = _dl_loaded; scope = l; } @@ -88,7 +89,8 @@ _dl_relocate_object (struct link_map *l, int lazy) /* Restore list frobnication done above for DT_SYMBOLIC. */ l->l_next = real_next; - l->l_prev->l_next = l; + if (l->l_prev) + l->l_prev->l_next = l; } if (l->l_info[DT_JMPREL] && lazy) |