From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x42b.google.com (mail-pf1-x42b.google.com [IPv6:2607:f8b0:4864:20::42b]) by sourceware.org (Postfix) with ESMTPS id E9FF3383303A for ; Fri, 18 Jun 2021 21:34:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E9FF3383303A Received: by mail-pf1-x42b.google.com with SMTP id z26so8722767pfj.5 for ; Fri, 18 Jun 2021 14:34:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=Ep3gqS/9Gj85xs+nTai5B2TnFx9OK8u4OUHZNQ/wzCU=; b=EqmG7BL3huhjQLsX3V7INZYOX7pGGFQzPWunslf1eEL7GjqyiMCMmGYxXw/X4zf+L0 w2jUF0wiO/LLBmUq3U7vhOF9xwZv6fJTW0AYR/Cbs841EF8C4PRuemzlnY3CA7MtVYSU RmFvPaIqfFuDJFEqyS89sE03OJeJVvboqi6syR9QRa3yK6jNl77nmFXgMpGDvCwbV0Ti xVp2bSaQyne92Gh2tuEoU3vxLyhbfqzlHztqALwW26tQeror6kUSEg1XXJR7e3Khxwpq gygrkQLk3+JwwYFzCiMu2rPiefRFeI+3nG+6u1OBMQyTzFZWJwvLJCYsfpss1UKUTODG uiOw== X-Gm-Message-State: AOAM530Xm9EcWUHjbOYLVJbjkeu+65/5xjfmy/6sR1VEtKfNMLGIs34y wB44p1FuBBpuPT174laJKv+rFUIVL/esww== X-Google-Smtp-Source: ABdhPJz27pOF4oisPADSRffti/bkFKm/1YbJEgvVqmgsbpjvmcMZgK82yA+aTNvWvGhX66/se+PbyQ== X-Received: by 2002:a63:2046:: with SMTP id r6mr11786535pgm.359.1624052094955; Fri, 18 Jun 2021 14:34:54 -0700 (PDT) Received: from google.com ([2620:15c:2ce:200:7718:8bff:acab:aa6b]) by smtp.gmail.com with ESMTPSA id e2sm9985967pgh.5.2021.06.18.14.34.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Jun 2021 14:34:54 -0700 (PDT) Date: Fri, 18 Jun 2021 14:34:50 -0700 From: Fangrui Song To: "H.J. Lu" Cc: GNU gABI gnu-gabi , GCC Development , Binutils , GNU C Library , llvm-dev@lists.llvm.org Subject: Re: [llvm-dev] RFC: Add GNU_PROPERTY_1_NEEDED Message-ID: <20210618213450.qdasgofw6hklzxip@google.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-18.3 required=5.0 tests=BAYES_00, DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, USER_IN_DEF_DKIM_WL, USER_IN_DEF_SPF_WL autolearn=unavailable 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: Fri, 18 Jun 2021 21:34:57 -0000 On 2021-06-18, H.J. Lu via llvm-dev wrote: >Add GNU_PROPERTY_1_NEEDED: > > #define GNU_PROPERTY_1_NEEDED GNU_PROPERTY_UINT32_OR_LO > >to indicate the needed properties by the object file. > I am fine with this logical OR style usage. But see below, do we need it for ld.so runtime check? (As I mentioned previously, I do not know how an AND-style property can be used/deployed if old object files without the .note.gnu.property is considered to have a value of 0.) >Add GNU_PROPERTY_1_NEEDED_SINGLE_GLOBAL_DEFINITION: > > #define GNU_PROPERTY_1_NEEDED_SINGLE_GLOBAL_DEFINITION (1U << 0) > >to indicate that the object file requires canonical function pointers and >cannot be used with copy relocation. In https://sourceware.org/pipermail/gnu-gabi/2021q2/000481.html you gave a rationale "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." First, I think such dynamic symbol visibility change is uncommon. Second, if ld.so finds that a symbol lookup for (st_value==0 st_shndx==SHN_UNDEF) will bind to a STV_PROTECTED definition in a shared object, can the diagnostic be moved there? The compatibility property is per-symbol and the symbol lookup is a perfect place for a diagnostic, like a symbol versioning error. I guess GCC folks may get noticed if you start a thread adding -fsingle-global-definition, otherwise many people who have opinions may just ignore threads about GNU PROPERTY addition. > >The PDF file is at > >https://gitlab.com/x86-psABIs/Linux-ABI/-/wikis/uploads/9eca2f2defe62b0c5015bf2e3e8a9f05/Linux-gABI-1_needed-2021-06-18.pdf