From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS3215 2.6.0.0/16 X-Spam-Status: No, score=-4.2 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI,NICE_REPLY_A, RCVD_IN_DNSWL_HI,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (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) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id D05BE1F8C6 for ; Mon, 9 Aug 2021 12:59:50 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C69AB3893C79 for ; Mon, 9 Aug 2021 12:59:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C69AB3893C79 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1628513989; bh=gwv+z5ufEBhi7Pzeg3xzGoXKGe3MTPCEA1Ue/czdHQ8=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=ASQZSBt6Xkf4uIJnAJATe5ECU4wnsQdFNNArwjUWNoTKFC0722UPbvYNJMumS3C1d AW9VKeY7kjNUtVb04PschYM2oYcFtZD7WUUTq05yazV94TpGh6PttkPU2FH1yOi/9s Ri+VoR+4qk0pbO8mPpT0uBf0beK9DZYqsbG8g+9A= Received: from mail-qt1-x836.google.com (mail-qt1-x836.google.com [IPv6:2607:f8b0:4864:20::836]) by sourceware.org (Postfix) with ESMTPS id 43D76385482F for ; Mon, 9 Aug 2021 12:59:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 43D76385482F Received: by mail-qt1-x836.google.com with SMTP id l3so3926388qtk.10 for ; Mon, 09 Aug 2021 05:59:29 -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=gwv+z5ufEBhi7Pzeg3xzGoXKGe3MTPCEA1Ue/czdHQ8=; b=s19ZifH4q/GKQ0W6d036OhQHZCg63kfslT9BUJ/gjTaLPQEijOp3jPIwJoov81t8zS 13joMAqsYctOAOrUstPEhw6EA262kduc/hOAEGur2QPL6J5cTZPukbSbi9WUcVTY5b+7 lWMHNC3wTsEp2vaq88yHWqS7bNkPR2XgZIsHZAROlbbqLjUNSOp/lwa84efm/2Kbimqu SEyrNZydrsry/crr0h5LfPrCRFd3qrniUP8Jrmjp9KNzRMy24cJZnGhW7g/zCri7zklD R/7U8Sfip88oj3pICL5cBV5WWmNUctPAUfCrJliqg6+GhKV+sLoJYUzL7ojntbqo0tbU uxbg== X-Gm-Message-State: AOAM532SCFOIqYUjBiiTGDenWTkEM24rOcMf3D5LMGu74b4WWYwsDQyR U1XkCUfp6wr5qCwGUEB625sJc/KcEB3JLQ== X-Google-Smtp-Source: ABdhPJxpEfd+Jo3VQE4Ar933PBXZ8mZocV9cqa6uYF/7rzpMPiOjiZAMPmGHscZ8Mzvsby28zPoeLw== X-Received: by 2002:a05:622a:1828:: with SMTP id t40mr19913843qtc.276.1628513968579; Mon, 09 Aug 2021 05:59:28 -0700 (PDT) Received: from ?IPv6:2804:431:c7cb:9dce:a96c:8a7f:2ffc:f373? ([2804:431:c7cb:9dce:a96c:8a7f:2ffc:f373]) by smtp.gmail.com with ESMTPSA id 77sm8932072qkd.32.2021.08.09.05.59.27 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 09 Aug 2021 05:59:28 -0700 (PDT) Subject: Re: [RFC][PATCH v12 3/8] Use the new DSO finder helper function To: libc-alpha@sourceware.org References: <20210708163255.812-1-vivek@collabora.com> <20210708163255.812-4-vivek@collabora.com> Message-ID: <0bbefa18-319f-a860-5611-15654a09e5cc@linaro.org> Date: Mon, 9 Aug 2021 09:59:26 -0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210708163255.812-4-vivek@collabora.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit 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: , From: Adhemerval Zanella via Libc-alpha Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces+e=80x24.org@sourceware.org Sender: "Libc-alpha" I think it would be better to merge it with the previous patch. Reviewed-by: Adhemerval Zanella On 08/07/2021 13:32, 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 26680b7f68..050c64135a 100644 > --- a/elf/dl-load.c > +++ b/elf/dl-load.c > @@ -2082,32 +2082,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; > } > >