From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-vs1-xe2d.google.com (mail-vs1-xe2d.google.com [IPv6:2607:f8b0:4864:20::e2d]) by sourceware.org (Postfix) with ESMTPS id 0F0E2385737C for ; Mon, 8 Aug 2022 17:31:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0F0E2385737C Received: by mail-vs1-xe2d.google.com with SMTP id q15so9594436vsr.0 for ; Mon, 08 Aug 2022 10:31:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:organization:subject:from:to :content-language:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc; bh=lZSUeHM6Ncb9cZyVLa0qKhVeeZQrNnmLb2tApwymwsQ=; b=TmgdxXLonyGE4K7pI5WJd7y8+XAELAUBDjQSplLNoT5ie8erOYvOO2zF5IRbPROwKs DpxfU3BXghkivoNJr1/qKzilqDquaPbiqbNkLyBmACbLXKeEzsfDYPoRuQNlNIqcypPO cfbfFs96p2nDbaiAHyExOYOv6sB2TyqcSDY0TLRHTr5blyvNvEP1NhqZ1qaHG7DsFUvn PMlMRKZI0C+6mFNiDmvyaf0gJ6F1TUHrkAWfsIBMzFuRvCIpRe+yJnJHqmQIlQj+78D3 cQ7wG5D1IuAp6oyOUgb55ZjSh1e4LCEsX1BFw4qJFNaNyO787ZlXi/qJwT5RLYj1n0Mv KYog== X-Gm-Message-State: ACgBeo3WKUHv8uTqNDBEjTXIYbouiWai7QRXuqW9OEKfQ6woRvN6AKAK vEQpIEdQdEou5bbWbKLlOSjwFYp4FhCCnQ== X-Google-Smtp-Source: AA6agR66BtItVTnkePaApF6+/RYnDgm+MKBWUF4Ec3wXv7EX4Or8LYrGeh11Y8gSB0DBMmHmGr0txA== X-Received: by 2002:a67:806:0:b0:358:54a1:8e66 with SMTP id 6-20020a670806000000b0035854a18e66mr8092952vsi.24.1659979887189; Mon, 08 Aug 2022 10:31:27 -0700 (PDT) Received: from ?IPV6:2804:431:c7ca:930b:1501:cb0e:82b0:65e1? ([2804:431:c7ca:930b:1501:cb0e:82b0:65e1]) by smtp.gmail.com with ESMTPSA id w185-20020a1fdfc2000000b003774da8fd03sm9497294vkg.27.2022.08.08.10.31.25 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 08 Aug 2022 10:31:26 -0700 (PDT) Message-ID: <8c6fbd40-a0c6-d84f-4e5a-10e7109ffc08@linaro.org> Date: Mon, 8 Aug 2022 14:31:24 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.1.0 Content-Language: en-US To: libc-alpha From: Adhemerval Zanella Netto Subject: Should we make DT_HASH dynamic section for glibc? Organization: Linaro 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, KAM_SHORT, 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 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, 08 Aug 2022 17:31:29 -0000 It seems that the recent change to remove the multiple hash schemes on 2.36 [1] broke some specific tools used on proton games [2]. So instead of explicit set the section type to use both sysv and gnu, we use the toolchain default which might exclude the sysv type. The last gABI states that DT_HASH is mandatory [3], but DT_GNU_HASH works a direct replacement meaning that it contains all information for symbol resolution that DT_HASH provides. It was done as size optimization from perceived unused features since DT_GNU_HASH is being used as a default on most distros for a long time, meaning DT_HASH might not be set. For instance, on a Ubuntu 22.05 system (GLIBC 2.35) only the glibc provided binaries (pldd, gencat, etc.) and some external tools (nvidia command line) do provide DT_HASH. So the question is whether we should enforce at least on glibc by reverting e47de5cb2d4dbec. It does sounds muddle to keep this solely on glibc, where rest of the system is not enforcing it, and only for compatibility with an obscure tools where there is no much information on why it requires it. Another option might to extend gABI to state that if DT_GNU_HASH is presents, it works as DT_HASH and it should not mark as mandated. And if DT_HASH is require required, one possibility is to add a binutils option to emit an empty DT_HASH just for compatibility and get the code size improvement. [1] https://sourceware.org/git/?p=glibc.git;a=commit;h=e47de5cb2d4dbecb58f569ed241e8e95c568f03c [2] https://sourceware.org/bugzilla/show_bug.cgi?id=29456 [3] http://www.sco.com/developers/gabi/latest/ch5.dynamic.html