From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk1-x729.google.com (mail-qk1-x729.google.com [IPv6:2607:f8b0:4864:20::729]) by sourceware.org (Postfix) with ESMTPS id 89C38398B166 for ; Fri, 28 May 2021 14:53:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 89C38398B166 Received: by mail-qk1-x729.google.com with SMTP id j189so4336143qkf.2 for ; Fri, 28 May 2021 07:53:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=teJkv8waMRuYj8sMZLy7NsjJg75SaSx7LFcWEtsyEZ0=; b=pMC3TwaQ+kCXHwX719cBioblk1AYTKoCJ46rDPvY5/eveI1R+1FGnFUHq1ufjlROjQ 8ht4Fo9RPLlGhurYBYEpdUa3qxJ5pjNohVAq9vHiKTbeuq97IaOTy2+SXYCYHawP47cg G0NuY/1rkUY11m52fKchSM8cF3BdMxIrTYz2rnw/GnUpeC0g+EQE1CzoYhnKCFjQgHlr qseFZQ36+g3M02YIFTH7UPgqxi+QXC2MQy7IhuN8RDIN4wzQIeJeDvKYRmFEzxAoisnj juAI/OKDlGXElMgHMXO7Y2vJ1P25v6+5KEO3vCPW2CtyPDmBI8HcxBHKHqmipBTeL65l FMnA== X-Gm-Message-State: AOAM533b/6C+e8GoT3KlbaY6u6vC610V3L7Co9PFiCkxhN3vJWBQfFMG 6R/7AhmfrIgWSIC4i7bQl/i7ERPKMoDA2g== X-Google-Smtp-Source: ABdhPJxVpaS4HoVPT0a9z9Ll6Zh3lm1UBGo+L8EccT7ry0pUyVv75exvg1O9+W/OCz5TXtE5iLczwQ== X-Received: by 2002:a05:620a:24d3:: with SMTP id m19mr4369765qkn.230.1622213590002; Fri, 28 May 2021 07:53:10 -0700 (PDT) Received: from [192.168.1.4] ([177.194.59.218]) by smtp.gmail.com with ESMTPSA id 196sm3582160qkk.130.2021.05.28.07.53.08 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 28 May 2021 07:53:09 -0700 (PDT) Subject: Re: [RFC][PATCH v10 3/7] Use the new DSO finder helper function To: Vivek Das Mohapatra , libc-alpha@sourceware.org References: <20210322154111.24798-1-vivek@collabora.com> <20210322154111.24798-4-vivek@collabora.com> From: Adhemerval Zanella Message-ID: <3c981673-416b-2d09-4eb7-61a5b18306fe@linaro.org> Date: Fri, 28 May 2021 11:53:07 -0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <20210322154111.24798-4-vivek@collabora.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-13.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 May 2021 14:53:12 -0000 LGTM, thanks. Reviewed-by: Adhemerval Zanella On 22/03/2021 12:41, Vivek Das Mohapatra via Libc-alpha wrote: > --- > elf/dl-load.c | 28 +++------------------------- > 1 file changed, 3 insertions(+), 25 deletions(-) > > diff --git a/elf/dl-load.c b/elf/dl-load.c > index 3ffb83cb6a..f2dbe45703 100644 > --- a/elf/dl-load.c > +++ b/elf/dl-load.c > @@ -2062,32 +2062,10 @@ _dl_map_object (struct link_map *loader, const char *name, > assert (nsid < GL(dl_nns)); > > /* Look for this name among those already loaded. */ > - for (l = GL(dl_ns)[nsid]._ns_loaded; l; l = l->l_next) > + l = _dl_find_dso (name, nsid); > + > + if (l != NULL) > { > - /* If the requested name matches the soname of a loaded object, > - use that object. Elide this check for names that have not > - yet been opened. */ > - if (__glibc_unlikely ((l->l_faked | l->l_removed) != 0)) > - continue; > - if (!_dl_name_match_p (name, l)) > - { > - const char *soname; > - > - if (__glibc_likely (l->l_soname_added) > - || l->l_info[DT_SONAME] == NULL) > - continue; > - > - soname = ((const char *) D_PTR (l, l_info[DT_STRTAB]) > - + l->l_info[DT_SONAME]->d_un.d_val); > - if (strcmp (name, soname) != 0) > - continue; > - > - /* We have a match on a new name -- cache it. */ > - add_name_to_object (l, soname); > - l->l_soname_added = 1; > - } > - > - /* We have a match. */ > return l; > } > >