From nobody Fri Apr 01 00:51:29 2022 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 9CC1D1A52BE9; Fri, 1 Apr 2022 00:51:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4KV1nt1gSWz3nfy; Fri, 1 Apr 2022 00:51:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1648774290; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ROBawawq8CH09Cx8rcRNqVl2eg+8SWFIEMNcXxHBTDY=; b=o2Vu0jNZ3RCviSYeqEXJc0hVKSUaC8WOViSCuH8wYVfw4IwY9/qATTTGnUWcmMYxA3ot0h z3Gc6k2rGpHzPGxPMLey4xOPzWeAfgyBXeDrEX9lRtDpO4+81AAilBtnyfiTBIQHzJadn2 SXSL4eZjYr8I1rWOd/aYJYOaHfWu6rYN15ShjaPi12aK+72JssWw6dGwPgq7HLEwkOVuyg Agb3A9YZ80w0lgBupVjDrNOd20ALr9W4C74PjJ5x0dlGDsYtgTk9d8f6dgENcBXB9veDCp fYI8MlHZ1/oFPOtJTIeP982XmV9/EpsjZS/azQFt5QTUXy99V8S0KTLtPRoYmw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 098B51E77; Fri, 1 Apr 2022 00:51:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 2310pT6R012619; Fri, 1 Apr 2022 00:51:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2310pTJp012618; Fri, 1 Apr 2022 00:51:29 GMT (envelope-from git) Date: Fri, 1 Apr 2022 00:51:29 GMT Message-Id: <202204010051.2310pTJp012618@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: b0bc8cc70518 - main - rtld: use style(9) for trace_loaded_objects() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b0bc8cc70518e1c02c5f68ccf7ab1760fd442310 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1648774290; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ROBawawq8CH09Cx8rcRNqVl2eg+8SWFIEMNcXxHBTDY=; b=SuF3IsFMUeVq+m4iB1u21xF6+McukM13jC9mRD0NsvCD6W0jiAcLTf9U8IKIn0IVli+5YA BxXHg2wIwN7reQI+Q5zz5BZ6O/f+cEfm7+LtsiYjm99+6uUXNASqlkoqYBZBxuJ9wa9Tgd efR327cgelzIKM/NWKeDGYN3HR4KxjzXvklzRpJPdznkou6/tzsCBTT2/m17S4FIgH1Bcc ZTtekFnSad7hK4GW2HI7IgPI4KTORhNIQlnpCi5OoPd4YVviEDcSgwGvc5tHllzd+55ecp u6h7k9EMVY1pO+sOGYameHvFLCzEMS1uHU8KsIyJNaYw4yRuyBB2jRMYsQCxNA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1648774290; a=rsa-sha256; cv=none; b=NlxI9lgAfNwsN5qJTFKcC+xQclAbR/UE3II1LaQUzvMVatqLBzag6RSZjKL1SLXFaSfwPT 3u/8PiSpRHHkTeaEtG2KZhEEZnAyJzqGyfkh/Erc+G82WQ5zNUGckt0LhSdsxCDvxqnqzi yv82eNP6RWo0yEjRPl/B/Z+tVHwM9F5BrO3b6kkZJLxZSsKWWl1CcZ1kl+JR2tW8pGcX0C BL8UWxLexnxBGk39dP59Dei9gPsPQqDE1owR6r6/zPAx1+iJK0vY7eBcslChIDBSSHA5hM KgFXLcZ0BzGeBe6yYvjpFPwFF9EPQIeOBrhcEdfHcc/ab+MR19DkCEaURif4lQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=b0bc8cc70518e1c02c5f68ccf7ab1760fd442310 commit b0bc8cc70518e1c02c5f68ccf7ab1760fd442310 Author: Konstantin Belousov AuthorDate: 2022-03-30 20:48:43 +0000 Commit: Konstantin Belousov 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); + } } - } } /*