From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) by sourceware.org (Postfix) with ESMTPS id A51813857001; Tue, 22 Jun 2021 14:31:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A51813857001 Received: by mail-pj1-x1035.google.com with SMTP id p4-20020a17090a9304b029016f3020d867so2373630pjo.3; Tue, 22 Jun 2021 07:31:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=XJ5nZZF2RfZ3AM0z+SRdM0HdU+O3nfI24UTlVrYfI0A=; b=iElGgOoSgCjkp0mx9i38Qu8vNWp4IYqpFcF69y/C9qYmGPNZ6w/f5o1m2GpiLhoc7D a3ortPxm50w0uJq9hEcGeabucqIg+LnyWqGTFEyhTDD8MUEmPVjETRvAQAz7Rc798de9 NeXjKHlSsW4iiSMtcWKp/gj1oXZkAuTJJl+YluMkrExc2qZ2O70hqDADU58IYBQZmEKl wTWjqhRriLz43dyqtRprKVDevL28qZkTLhiA0SZqAzz+C3JGjHPD6bDEcyzmrGjduyWK P0dqy44iGijIInE+4/fpf0LHSncD1kpeRlcm3y+XHGaDg87iYhhPWGFhGQdPc+B5gXr2 qpbA== X-Gm-Message-State: AOAM5301XbPkMRqxZ0+DTbv4BW676SA5RkjQTtFVsKiXy0y9xK70O36U eORLuyb6Gtiq4apehW6vMyhYwcws+UNJ8K48ZAU= X-Google-Smtp-Source: ABdhPJyYJoNnvc2lnyD+QPAc5VMeUabC/U+E1WAY92B5qYosBrrfdFGeLKHUNRYnWYmbNT4lIQ5zTTYp1krKBNHIXFA= X-Received: by 2002:a17:90b:10e:: with SMTP id p14mr4343567pjz.153.1624372279781; Tue, 22 Jun 2021 07:31:19 -0700 (PDT) MIME-Version: 1.0 References: <20210617193825.zzjyoybttajksw5x@google.com> <20210618000600.c7yh6twgbukmyouj@google.com> In-Reply-To: From: "H.J. Lu" Date: Tue, 22 Jun 2021 07:30:43 -0700 Message-ID: Subject: Re: [llvm-dev] RFC: Add GNU_PROPERTY_UINT32_AND_XXX/GNU_PROPERTY_UINT32_OR_XXX To: Michael Matz Cc: =?UTF-8?B?RsSBbmctcnXDrCBTw7JuZw==?= , llvm-dev@lists.llvm.org, GCC Development , GNU C Library , GNU gABI gnu-gabi , Binutils Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-3025.9 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 autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gnu-gabi@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gnu-gabi mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jun 2021 14:31:22 -0000 On Mon, Jun 21, 2021 at 7:36 AM Michael Matz wrote: > > Hello, > > On Thu, 17 Jun 2021, H.J. Lu via Gcc wrote: > > > > > =E2=80=A2 Disallow copy relocation against definition with the STV_= PROTECTED > > > > visibility in the shared library with the marker. > > > > > > If this is for GNU ld x86 only, I'm fine with it:) > > > > > > gold and ld.lld just emit an error unconditionally. I think non-x86 > > > GNU ld ports which never support "copy relocations on protected data > > > symbols" may want to make the diagnostic unconditional as well. > > > Well, while (Michael Matz and ) I think compatibility check for "copy > > > relocations on protected data symbols" is over-engineering (and > > > Alan/Cary think it was a mistake), if you still want to add it, it is > > > fine for me... > > > For Clang, I hope we will not emit such a property, because Clang > > > never supports the "copy relocations on protected data symbols" > > > scheme. > > > > The issue is that libfoo.so used in link-time can be different from > > libfoo.so at run-time. The symbol, foobar, in libfoo.so at link-time > > has the default visibility. But foobar in libfoo.so at run-time can be > > protected. ld.so should detect such cases which can lead to run-time > > failures. > > Yes, but I think we can _unconditionally_ give an error in this case, eve= n > without a marker. I view restricting visiblity of a symbol in furture Unconditionally issuing an error can be an option, but mandatory. Otherwise working binary today will fail to run tomorrow. > versions of shared libraries to be an ABI change, hence it has to be > something that either requires a soname bump or at the very least symbol To support existing binaries, we need a soname bump. > versioning with the old version staying on default visibility. Symbol versioning doesn't work here since both symbols are at the same address. > Compare the situation to one where the old libfoo.so provided a symbol > bar, and the new one doesn't (sort of very restricted visiblity). ld.so > will unconditionally give an error. I don't see this situation materiall= y > different from bar's visibility be changed from default to protected. > > > > I think this can be unconditional, because the "pointer equality for > > > STV_PROTECTED function address in -shared" case hasn't been working > > > for GNU ld for at least 20 years... Many ports don't even produce a > > > dynamic relocation. > > > > True. But see above. You may not care about such use cases. But I > > believe that ld.so should not knowingly and silently allow such run-tim= e > > failure to happen. > > Agreed, but giving an error message unconditionally wouldn't be silent. > > > Ciao, > Michael. --=20 H.J.