From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi1-x235.google.com (mail-oi1-x235.google.com [IPv6:2607:f8b0:4864:20::235]) by sourceware.org (Postfix) with ESMTPS id 750EB385842C for ; Wed, 7 Jun 2023 12:40:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 750EB385842C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-oi1-x235.google.com with SMTP id 5614622812f47-39a9b16b37bso3848486b6e.1 for ; Wed, 07 Jun 2023 05:40:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686141605; x=1688733605; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=i2oA5IJEJqu1+AlC3bGhCg7k1UrYg1umFOdI8l0/4f8=; b=gXizXa9Ds9tXum4hqfV/+OSuhlPNrbuHKtmjPzdFIDXR2JO4hw6cbslUbzMaWcKbLe LMaT7Z1Llica/HZI8ExgLuHc8/tjZe8Kjy139mP64ujt1w5AG4xFxUS48/c4WvLV9Zyo GVSyF/vU8vvcG7If5tlj14OfIzC2v0Ssy7Tl3XheEOw3TzKve6Vf7GllVAPqP8lXyAFY Vny2x1+Jn6aOapNDgq/El0QbS0Z3osSEwXEGUEpv/l7zT8jhVsnoVC+TnaHuOOyFoJHi kgMoaYRyYE7L3BdkgzRaByKWb00w54wBPuKzF7B76zWTZ0w62/cBwFWo638wbkIPI9Mw 1sjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686141605; x=1688733605; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=i2oA5IJEJqu1+AlC3bGhCg7k1UrYg1umFOdI8l0/4f8=; b=Qp5nxn5xXQb9qsCTiztRoDCy1UHeESH0KICoA9/2lYuhGRGukuHxexsI3qh0dD/3K+ rWtr8ZmaBIvD4ngH0jVPn8O6VYNoG0aEMG4gxFo9nnHKL+k+9Qksn3WpBf5VUnkTi1LN udAchqR8rSXvE7Y6yn+7mMyWjjltM0o502fbKhrBHfAFfTjULChBJeAihhsLeoyYmJPJ tdlI+XFbbO4xh5s1ebUGfu6El25KbcisUzrTKBiDKJpDMEDGpdaFL2JBoB4cUnCnxdIT VKAAAtpvGDNyPxizSyUb5nweVbGVwHLdIObJAhQyMO6XRwEsHcu5ResmGndGHjP2YIDv Dd7Q== X-Gm-Message-State: AC+VfDxu18+W7McD0OQ5eUd+LNe2EXAlurww24fmHHKjgM9YeMhU1VJn ty4qYHukMKQDUpFq78ROqqJeOw== X-Google-Smtp-Source: ACHHUZ6FtyBJ/Mpa9BnxNfFWWgJvDhUcwiNPGm57FcNmMX/5/AnhQOX6nIzC95jCSIrE6fk0Xk8ZDQ== X-Received: by 2002:aca:2b13:0:b0:398:f740:631e with SMTP id i19-20020aca2b13000000b00398f740631emr5588917oik.16.1686141605443; Wed, 07 Jun 2023 05:40:05 -0700 (PDT) Received: from ?IPV6:2804:1b3:a7c1:fe49:e029:57a8:7e86:fdae? ([2804:1b3:a7c1:fe49:e029:57a8:7e86:fdae]) by smtp.gmail.com with ESMTPSA id cz8-20020a056808404800b0039819ef73e7sm3950067oib.2.2023.06.07.05.40.03 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 07 Jun 2023 05:40:04 -0700 (PDT) Message-ID: Date: Wed, 7 Jun 2023 09:40:02 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.11.2 Subject: Re: _rtld_global, _rtld_global_ro (and local aliases) as an optimization Content-Language: en-US To: Florian Weimer Cc: Andreas Schwab , Florian Weimer via Libc-alpha References: <87bkhs9491.fsf@oldenburg3.str.redhat.com> <69f6c69b-52c2-fe57-ed48-3d80b83576ac@linaro.org> <8735338xb4.fsf@oldenburg3.str.redhat.com> <87cz277gw2.fsf@oldenburg3.str.redhat.com> <36c738dd-46bd-20c5-db4e-a91646b193c5@linaro.org> <87a5xblayy.fsf@oldenburg3.str.redhat.com> From: Adhemerval Zanella Netto Organization: Linaro In-Reply-To: <87a5xblayy.fsf@oldenburg3.str.redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.3 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,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 07/06/23 09:21, Florian Weimer wrote: > * Adhemerval Zanella Netto: > >> On 07/06/23 06:37, Florian Weimer wrote: >>> * Andreas Schwab: >>> >>>> On Jun 07 2023, Florian Weimer via Libc-alpha wrote: >>>> >>>>> As a concrete example, we could turn GLRO(dl_dso_sort_algo) into >>>>> >>>>> static int dso_sort_algo; >>>>> >>>>> in elf/dl-sort-maps.c because it's not used outside the file. >>>> >>>> I think it was just a mistake to put it there initially. None of the >>>> definitions related to the DSO sort algo (except _dl_sort_maps_init) >>>> need to be visible outside that file. >>> >>> We have more cases that are somewhat similar, where we could use an >>> extern attribute_hidden variable instead of a struct member. What about >>> those? >> >> I think it makes sense to cleanup the _rtld_global/_rtld_global_ro variables, >> as Andreas has put there are multiple examples that we shouldn't had to >> update it. > > So the consensus is that we should use this only for cross-DSO > information sharing, and not for optimizing address computation of > global data variables? Which cases are uses solely for optimizing address computation? For, instance the _dl_pagesize along with _dl_auxv. On Linux, we don't really _dl_pagesize, but it is simpler and faster than iterate over _dl_auxv.