aboutsummaryrefslogtreecommitdiff
path: root/libexec
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2020-05-22 17:23:09 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2020-05-22 17:23:09 +0000
commit24ea64ded2383aca2da797d75ab765b36cd13e65 (patch)
tree00e9cc3ba96d246c23e638f4575c3be5cb535b0d /libexec
parentd65771e472d887602174f4a586b8c32e28f3f4fe (diff)
Notes
Diffstat (limited to 'libexec')
-rw-r--r--libexec/rtld-elf/rtld.c65
1 files changed, 33 insertions, 32 deletions
diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c
index 1799d1893d28..225d1c19350b 100644
--- a/libexec/rtld-elf/rtld.c
+++ b/libexec/rtld-elf/rtld.c
@@ -4028,49 +4028,50 @@ rtld_dirname_abs(const char *path, char *base)
static void
linkmap_add(Obj_Entry *obj)
{
- struct link_map *l = &obj->linkmap;
- struct link_map *prev;
+ struct link_map *l, *prev;
- obj->linkmap.l_name = obj->path;
- obj->linkmap.l_base = obj->mapbase;
- obj->linkmap.l_ld = obj->dynamic;
- obj->linkmap.l_addr = obj->relocbase;
+ l = &obj->linkmap;
+ l->l_name = obj->path;
+ l->l_base = obj->mapbase;
+ l->l_ld = obj->dynamic;
+ l->l_addr = obj->relocbase;
- if (r_debug.r_map == NULL) {
- r_debug.r_map = l;
- return;
- }
+ if (r_debug.r_map == NULL) {
+ r_debug.r_map = l;
+ return;
+ }
- /*
- * Scan to the end of the list, but not past the entry for the
- * dynamic linker, which we want to keep at the very end.
- */
- for (prev = r_debug.r_map;
- prev->l_next != NULL && prev->l_next != &obj_rtld.linkmap;
- prev = prev->l_next)
- ;
+ /*
+ * Scan to the end of the list, but not past the entry for the
+ * dynamic linker, which we want to keep at the very end.
+ */
+ for (prev = r_debug.r_map;
+ prev->l_next != NULL && prev->l_next != &obj_rtld.linkmap;
+ prev = prev->l_next)
+ ;
- /* Link in the new entry. */
- l->l_prev = prev;
- l->l_next = prev->l_next;
- if (l->l_next != NULL)
- l->l_next->l_prev = l;
- prev->l_next = l;
+ /* Link in the new entry. */
+ l->l_prev = prev;
+ l->l_next = prev->l_next;
+ if (l->l_next != NULL)
+ l->l_next->l_prev = l;
+ prev->l_next = l;
}
static void
linkmap_delete(Obj_Entry *obj)
{
- struct link_map *l = &obj->linkmap;
+ struct link_map *l;
- if (l->l_prev == NULL) {
- if ((r_debug.r_map = l->l_next) != NULL)
- l->l_next->l_prev = NULL;
- return;
- }
+ l = &obj->linkmap;
+ if (l->l_prev == NULL) {
+ if ((r_debug.r_map = l->l_next) != NULL)
+ l->l_next->l_prev = NULL;
+ return;
+ }
- if ((l->l_prev->l_next = l->l_next) != NULL)
- l->l_next->l_prev = l->l_prev;
+ if ((l->l_prev->l_next = l->l_next) != NULL)
+ l->l_next->l_prev = l->l_prev;
}
/*