From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oa1-x2c.google.com (mail-oa1-x2c.google.com [IPv6:2001:4860:4864:20::2c]) by sourceware.org (Postfix) with ESMTPS id 5E1453858D1E for ; Wed, 29 Mar 2023 17:10:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5E1453858D1E 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-oa1-x2c.google.com with SMTP id 586e51a60fabf-17aceccdcf6so16889423fac.9 for ; Wed, 29 Mar 2023 10:10:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1680109819; h=content-transfer-encoding:in-reply-to:organization:from:references :to:content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=ZKahy7d14DklLggYjbw63Ss5HAVvaWo4gjAqKwyl0Wg=; b=bbhEqH0nNT9lVBFpmpKT7E1hyG0h9ZqY7Iz3ozXwIAebAGnzZ5n2yeulDMHGh4FQPv Pbf4QT4LxwgcSG35MRaplHOPl3BOcA2jR4029ayOJ5JJG7zEX3arSAfB3yHFBtL9/rwa KMEJYlEsERVPYrtiHn41ZZC3TRd/3L3p9Zxj1wVpzc89wNmrRtWSOQXWvDs7FBWKt6bi nHjDGZdeZYeTzgjOZwveBxIIXGKPFjykNDgOwQOkH1BD77h3OQnoFe6jIgy5ya81Rrob b2dqwtYwAyDaS70HfVpte6THenlmZcaGytikbnSRu2kiUba/G/dyAKGnpClDJZ2HC9ll sMAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680109819; h=content-transfer-encoding:in-reply-to:organization:from:references :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=ZKahy7d14DklLggYjbw63Ss5HAVvaWo4gjAqKwyl0Wg=; b=MT3Tf5xAQUSEZXU96MhGkGV17/HMbjlU4uBB0qRY45ssBH+XeT3YkuNhGsj3SeaT0k iHkZ5DEdtiWmdgvGU/TBy1x2jTV0sRmUOw8PSrTukRXjNo42OoKokx5sTHfR4K1k69Rc avHBZNn34v4N/seFAM3dIedShsMfu0DBrkcJrydwN3FWbQBx6BRC9bj5TgF+P9KeP+0l INt0eLv8zA5oVt7pBT4iphhbiDDT0r7YRFbsL4tgxUQ9fsPTZ8IAwvUMWGFKNJxZqZp6 DPETF2dM1osksqNxAz379cdUVijc9gllu9TZvh+iMjuamtESb7QQHq7mto68Y186MiD+ QIMA== X-Gm-Message-State: AAQBX9dTiDxwIX+SDfIuHrEQnBmESqns2KLCnSeT/pix4emL02yA4HRr 2xfUKczN52UddTO6XdqZdUEkVPBrcqCpnQVl2bBkhg== X-Google-Smtp-Source: AKy350bCXkxy4c9urlpnCveycdWQHgWsqiQuqdDP/ujPrV7/rgNQAbAo2TFTGQP5fx17HC0/PWCWuw== X-Received: by 2002:a05:6870:4306:b0:17e:2f36:3895 with SMTP id w6-20020a056870430600b0017e2f363895mr12479170oah.44.1680109819602; Wed, 29 Mar 2023 10:10:19 -0700 (PDT) Received: from ?IPV6:2804:1b3:a7c1:60f9:1426:1d2d:d6b:1761? ([2804:1b3:a7c1:60f9:1426:1d2d:d6b:1761]) by smtp.gmail.com with ESMTPSA id yo7-20020a05687c018700b001777244e3f9sm12044918oab.8.2023.03.29.10.10.17 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 29 Mar 2023 10:10:18 -0700 (PDT) Message-ID: <77329e53-bb96-dc39-1f3d-6a5dfa0e7263@linaro.org> Date: Wed, 29 Mar 2023 14:10:16 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [PATCH 03/13] elf: dont pass fd to _dl_process_pt_xx Content-Language: en-US To: Stas Sergeev , libc-alpha@sourceware.org References: <20230318165110.3672749-1-stsp2@yandex.ru> <20230318165110.3672749-4-stsp2@yandex.ru> From: Adhemerval Zanella Netto Organization: Linaro In-Reply-To: <20230318165110.3672749-4-stsp2@yandex.ru> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-12.1 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.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 18/03/23 13:51, Stas Sergeev via Libc-alpha wrote: > It is not used in these functions. > rtld.c:rtld_setup_main_map() does the same. > > The test-suite was run on x86_64/64 and showed no regressions. > > Signed-off-by: Stas Sergeev > --- > elf/dl-load.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/elf/dl-load.c b/elf/dl-load.c > index fcb39a78d4..ab8b648687 100644 > --- a/elf/dl-load.c > +++ b/elf/dl-load.c > @@ -1379,10 +1379,10 @@ cannot enable executable stack as shared object requires"); > switch (ph[-1].p_type) > { > case PT_NOTE: > - _dl_process_pt_note (l, fd, &ph[-1]); > + _dl_process_pt_note (l, -1, &ph[-1]); > break; > case PT_GNU_PROPERTY: > - _dl_process_pt_gnu_property (l, fd, &ph[-1]); > + _dl_process_pt_gnu_property (l, -1, &ph[-1]); > break; > } > It allows both _dl_process_pt_note and _dl_process_pt_gnu_property to know if the called where rtld code during statup code or dlopen. But you are right that it is not used. However this does not accomplish anything, a better refactor would to just remove the argument altogether. It at least would simplify the interface and allow slight better code generation.