From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x436.google.com (mail-pf1-x436.google.com [IPv6:2607:f8b0:4864:20::436]) by sourceware.org (Postfix) with ESMTPS id 8F8563858C83 for ; Thu, 14 Apr 2022 01:54:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8F8563858C83 Received: by mail-pf1-x436.google.com with SMTP id z16so3550812pfh.3 for ; Wed, 13 Apr 2022 18:54:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ynwxn7fmNZNhzwWjKP7kvJmEeesa3tLfl6kguCLpm0w=; b=2drT9chBMRvM6izG9/wJujUjPQr+L5Dp5dv613JnQ2fSlD1h0yk/9dnjsn2dPW62Yh U/m82dWMOPxsIIpNKnPwZpEOoCHe8DXWC47v6XG5S9NgpTK3reFRLTWlH2XFy8MpCGr3 VpAaa+nK7Q/SW8isy5b1zbFgxgyZYjY55hnmQjIXNcykFzKxANczFWyBNdfNC1N9KjiC c6UBm7l+Pf/HkvsUy4iVaBzY70vJU+pgXRwYiUnH5xqPV5yPGmC+beopQbmCjaOUAeyq gpW6QbR92PlzO/LQCgHo4Dcgbk0Mwz6Ga35pNPNNkrA46IpBDouXz2SUngO+5WPfABkK gP/w== X-Gm-Message-State: AOAM530XHVBrTUe2fliY4llNdXAVI6sa0cyODRYiBycZAXdYhOSi89s8 MfYe6ZFR2ESqqddtQp2uveXmtPiH9YxOZAJ+cPc= X-Google-Smtp-Source: ABdhPJwNFvWG6Q+BQtVooOVs7CeJlZsXR5UP8V5NwpnPEeBdNC+4XEIEd2jGVtA0LdEq5+Rv3xGjq/zzUPPyXdR0Ylo= X-Received: by 2002:a05:6a00:c85:b0:4fa:f806:10f5 with SMTP id a5-20020a056a000c8500b004faf80610f5mr1574228pfv.43.1649901293554; Wed, 13 Apr 2022 18:54:53 -0700 (PDT) MIME-Version: 1.0 References: <20220228064052.3413334-1-amodra@gmail.com> <20220409001412.ezhmy7i2sqq7t256@google.com> In-Reply-To: From: "H.J. Lu" Date: Wed, 13 Apr 2022 18:54:17 -0700 Message-ID: Subject: DT_RELR without libc.so dependency To: Alan Modra Cc: Fangrui Song , GNU C Library , Tulio Magno Quites Machado Filho Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3019.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE, URIBL_BLACK autolearn=no 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: Thu, 14 Apr 2022 01:54:56 -0000 On Wed, Apr 13, 2022 at 5:34 PM Alan Modra wrote: > > On Fri, Apr 08, 2022 at 05:14:12PM -0700, Fangrui Song wrote: > > HJ's DT_RELR patch series has been upgraded to v7 > > (https://patchwork.sourceware.org/project/glibc/list/?series=8295) > > > > git-pw series apply 8295 > > # `Add --disable-default-dt-relr` does not apply cleanly > > > > If no regressions with default DT_RELR, that will be cool! > > I did find one error when testing a build of glibc using Ubuntu gcc-8. > elf/filter fails with "error while loading shared libraries: > .../elf/filtmod1.so: DT_RELR without GLIBC_ABI_DT_RELR dependency". > > A little analysis shows the problem occurs when filtmod1.so is linked > with --as-needed and libc.so is not needed. filtmod1.so ends up with > no .gnu.version or .gnu.version_r sections, and of course no > GLIBC_ABI_DT_RELR version. > > The error check is not one that belongs in ld.so. If you have the > error checking code, then you have DT_RELR support in ld.so and there > is no reason at all to refuse to run the program! The check should be > in the linker, if anywhere. > The GLIBC_ABI_DT_RELR dependency is added to avoid the random crush at run-time with older glibc binaries. Since it is possible to create a DSO with DT_RELR, but without the libc.so dependency. Should ld.so skip the GLIBC_ABI_DT_RELR check if the DSO doesn't depend on libc.so? -- H.J.