git: b0bc8cc70518 - main - rtld: use style(9) for trace_loaded_objects()
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 01 Apr 2022 00:51:29 UTC
The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=b0bc8cc70518e1c02c5f68ccf7ab1760fd442310 commit b0bc8cc70518e1c02c5f68ccf7ab1760fd442310 Author: Konstantin Belousov <kib@FreeBSD.org> AuthorDate: 2022-03-30 20:48:43 +0000 Commit: Konstantin Belousov <kib@FreeBSD.org> CommitDate: 2022-04-01 00:51:22 +0000 rtld: use style(9) for trace_loaded_objects() Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D34716 --- libexec/rtld-elf/rtld.c | 43 ++++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 8260897eb3b3..becfe49e4531 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -4994,32 +4994,33 @@ trace_print_obj(Obj_Entry *obj, const char *name, const char *path, static void trace_loaded_objects(Obj_Entry *obj) { - const char *fmt1, *fmt2, *main_local, *list_containers; + const char *fmt1, *fmt2, *main_local, *list_containers; - trace_calc_fmts(&main_local, &fmt1, &fmt2); - list_containers = ld_get_env_var(LD_TRACE_LOADED_OBJECTS_ALL); + trace_calc_fmts(&main_local, &fmt1, &fmt2); + list_containers = ld_get_env_var(LD_TRACE_LOADED_OBJECTS_ALL); - for (; obj != NULL; obj = TAILQ_NEXT(obj, next)) { - Needed_Entry *needed; - const char *name, *path; + for (; obj != NULL; obj = TAILQ_NEXT(obj, next)) { + Needed_Entry *needed; + const char *name, *path; - if (obj->marker) - continue; - if (list_containers && obj->needed != NULL) - rtld_printf("%s:\n", obj->path); - for (needed = obj->needed; needed; needed = needed->next) { - if (needed->obj != NULL) { - if (needed->obj->traced && !list_containers) - continue; - needed->obj->traced = true; - path = needed->obj->path; - } else - path = "not found"; + if (obj->marker) + continue; + if (list_containers && obj->needed != NULL) + rtld_printf("%s:\n", obj->path); + for (needed = obj->needed; needed; needed = needed->next) { + if (needed->obj != NULL) { + if (needed->obj->traced && !list_containers) + continue; + needed->obj->traced = true; + path = needed->obj->path; + } else + path = "not found"; - name = obj->strtab + needed->name; - trace_print_obj(obj, name, path, main_local, fmt1, fmt2); + name = obj->strtab + needed->name; + trace_print_obj(obj, name, path, main_local, + fmt1, fmt2); + } } - } } /*