From owner-svn-src-all@freebsd.org Fri May 22 17:23:09 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B06692CEEDE; Fri, 22 May 2020 17:23:09 +0000 (UTC) (envelope-from kib@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49TCxT4Dbcz4bS1; Fri, 22 May 2020 17:23:09 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 72F1822480; Fri, 22 May 2020 17:23:09 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04MHN953032116; Fri, 22 May 2020 17:23:09 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04MHN9dx032115; Fri, 22 May 2020 17:23:09 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202005221723.04MHN9dx032115@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 22 May 2020 17:23:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361394 - head/libexec/rtld-elf X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/libexec/rtld-elf X-SVN-Commit-Revision: 361394 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 May 2020 17:23:09 -0000 Author: kib Date: Fri May 22 17:23:09 2020 New Revision: 361394 URL: https://svnweb.freebsd.org/changeset/base/361394 Log: Convert linkmap_add() and linkmap_delete() to style(8). Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Fri May 22 17:21:22 2020 (r361393) +++ head/libexec/rtld-elf/rtld.c Fri May 22 17:23:09 2020 (r361394) @@ -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; } /*