From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ua1-x936.google.com (mail-ua1-x936.google.com [IPv6:2607:f8b0:4864:20::936]) by sourceware.org (Postfix) with ESMTPS id AC7FC3858C60 for ; Mon, 20 Dec 2021 16:55:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org AC7FC3858C60 Received: by mail-ua1-x936.google.com with SMTP id y23so18804123uay.7 for ; Mon, 20 Dec 2021 08:55:11 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=ViYvTvb1XA8hHdGgJPH3pjseHz7kTEUUkNKcVk5kq0o=; b=zfBaa9r9IK1o+eeIE6JAa1ZYBi/ZnAV3pcMqVQLWje+cUFnI7t7u5jhaMWUaztxm2/ LxEiJlEdehqoSU/7sBOEQ1MVM/mVuInWlCLRqI2Uewjwpp7wH8SbmTUz9M760IkknnLO /W9JNroo0MO/4JI+BWrmFpF4itKB6lPz6xqMiSeuBfX6V0NxuRChMVlpWn/Ol+vgtpu4 0FQEuzzS7xR89a3fX1ldwFim9wuvl1z2myIlGugYOcKtpKwPohwgBH2/k8l1PN2KYQu3 NtA0I+zTAL332be6ECTbnSMnYI3vcYXvhwAGDhm8hXNF6L0nZXAqPC5aYCJAw9uOCQxF EDMQ== X-Gm-Message-State: AOAM531a0jwQAqqoNOYsWg1ryhZiyEdUZnpa0MtOyQenVFFa89f80PNX 0+raxTMtqaQvZxJ+2oF1SDwq/w== X-Google-Smtp-Source: ABdhPJyN4yGuykL1NqlmMB/8cZwKAyPgXLSnUny0p/euOncmY3eIocnAT8G/UmfNWmqpdpw2a1CUYw== X-Received: by 2002:ab0:13c5:: with SMTP id n5mr5572641uae.112.1640019311190; Mon, 20 Dec 2021 08:55:11 -0800 (PST) Received: from ?IPV6:2804:431:c7cb:3b1e:762b:24f5:94b:4e15? ([2804:431:c7cb:3b1e:762b:24f5:94b:4e15]) by smtp.gmail.com with ESMTPSA id w22sm3406667vsk.11.2021.12.20.08.55.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 20 Dec 2021 08:55:10 -0800 (PST) Message-ID: Date: Mon, 20 Dec 2021 13:55:08 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.4.0 Subject: Re: [PATCH v6 15/20] elf: Run constructors if executable has a soname of a dependency Content-Language: en-US To: Florian Weimer Cc: libc-alpha@sourceware.org, John Mellor-Crummey , Ben Woodard References: <20211115183734.531155-1-adhemerval.zanella@linaro.org> <20211115183734.531155-16-adhemerval.zanella@linaro.org> <874k75he1l.fsf@oldenburg.str.redhat.com> <87v8zjfcbh.fsf@oldenburg.str.redhat.com> From: Adhemerval Zanella In-Reply-To: <87v8zjfcbh.fsf@oldenburg.str.redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-8.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: Mon, 20 Dec 2021 16:55:12 -0000 On 20/12/2021 13:52, Florian Weimer wrote: > * Adhemerval Zanella: > >>> But if the main program has a soname, wouldn't we stop loading it as a >>> dependency, too? So that the expected ouptut turns into: >>> >>> b>a>{}>> >>> because the separate c is not actually loaded. >> >> Right, so if the idea is indeed to not load an dependency that matches the >> binary SONAME current behavior is indeed what is expected. Not sure if >> this the expected behavior, if so I will drop this patch. > > Is it the current behavior? Yes. > > I can see some value in preserving that, e.g. for scripting language > interpreters which historically avoided DSOs for the core interpreter, > preferring position-dependent code for it (but still offering a DSO for > embedding). They may even set DT_SONAME on the main program; I haven't > checked. Right, this does make sense (although accomplished in a kinda hackish way).