From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x1030.google.com (mail-pj1-x1030.google.com [IPv6:2607:f8b0:4864:20::1030]) by sourceware.org (Postfix) with ESMTPS id 5E846398E478 for ; Thu, 17 Jun 2021 19:38:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5E846398E478 Received: by mail-pj1-x1030.google.com with SMTP id g6-20020a17090adac6b029015d1a9a6f1aso5955563pjx.1 for ; Thu, 17 Jun 2021 12:38:31 -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=5ikYLhKPBrNUNPUy5w+Tp6cncZMDB8QWWsS2V9gm8J4=; b=A08Re7bhkiPAMp5JIy4BrJuGQ6Q7bwSCmTtb6dcMgdyqZpG4Lh8Io3c9NbY1wDAJlC M0mwvdWQiVp+l4o7IzSNFMpSLwasJL98pC9S1btjHCNO3iWgtNLAxlW6XuXaAZezyw89 pgwyN1QI+xBj34pk/vUYadTfOFFW/HYpdw0BnQs2eVsHs4nVz5y6POCNG6ttMcOBaw7y y9KVrywQ4KzQcwiZeTDWZBUIIHWpuTsDiq7bD8zKN0PX1vutWAcGoCz3L27x8hHRvlnt GkPBCT1Wko0WlA1dwd2GeoCsGcmXw/T9fIRxuBtCuh0K23gf4F8mzPZyvpFkt2yJOQYz FATg== X-Gm-Message-State: AOAM531QmZcZHaKlK5Qp05i8Y1972HblSxgZvjuJHJZ4hq4ajqciGLur 3Im/T7JfluZyVha/jWEpbvfriw== X-Google-Smtp-Source: ABdhPJyrMQs+OlvlTyrqQcW50shssbIEA87n/jCb/aCfMnOxemabXD8ideN6t8jskN4HIUhntB8MyA== X-Received: by 2002:a17:90b:2282:: with SMTP id kx2mr6746332pjb.60.1623958710251; Thu, 17 Jun 2021 12:38:30 -0700 (PDT) Received: from google.com ([2620:15c:2ce:200:c340:a8ac:3002:293c]) by smtp.gmail.com with ESMTPSA id c184sm5639992pfa.38.2021.06.17.12.38.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Jun 2021 12:38:29 -0700 (PDT) Date: Thu, 17 Jun 2021 12:38:25 -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_UINT32_AND_XXX/GNU_PROPERTY_UINT32_OR_XXX Message-ID: <20210617193825.zzjyoybttajksw5x@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: gcc@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jun 2021 19:38:34 -0000 On 2021-06-17, H.J. Lu via llvm-dev wrote: >On Thu, Jan 21, 2021 at 7:02 AM H.J. Lu wrote: >> >> On Wed, Jan 13, 2021 at 9:06 AM H.J. Lu wrote: >> > >> > 1. GNU_PROPERTY_UINT32_AND_LO..GNU_PROPERTY_UINT32_AND_HI >> > >> > #define GNU_PROPERTY_UINT32_AND_LO 0xb0000000 >> > #define GNU_PROPERTY_UINT32_AND_HI 0xb0007fff >> > >> > A bit in the output pr_data field is set only if it is set in all >> > relocatable input pr_data fields. If all bits in the the output >> > pr_data field are zero, this property should be removed from output. >> > >> > If the bit is 1, all input relocatables have the feature. If the >> > bit is 0 or the property is missing, the info is unknown. How to use AND in practice? Are you going to add .note.gnu.property to all of crt1.o crti.o crtbegin.o crtend.o crtn.o and miscellaneous libc_nonshared.a object files written in assembly? >> > 2. GNU_PROPERTY_UINT32_OR_LO..GNU_PROPERTY_UINT32_OR_HI >> > >> > #define GNU_PROPERTY_UINT32_OR_LO 0xb0008000 >> > #define GNU_PROPERTY_UINT32_OR_HI 0xb000ffff >> > >> > A bit in the output pr_data field is set if it is set in any >> > relocatable input pr_data fields. If all bits in the the output >> > pr_data field are zero, this property should be removed from output. >> > >> > If the bit is 1, some input relocatables have the feature. If the >> > bit is 0 or the property is missing, the info is unknown. >> > >> > The PDF is at >> > >> > https://gitlab.com/x86-psABIs/Linux-ABI/-/wikis/uploads/0690db0a3b7e5d8a44e0271a4be54aa7/linux-gABI-and-or-2021-01-13.pdf >> > >> > -- >> > H.J. >> >> Here is the binutils patch to implement it. >> > >If there are no objections, I will check it in tomorrow. If the use case is just ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA, it'd be very kind of you if you can collect more use cases before generalizing this into a non-arch-specific GNU PROPERTY. The "copy relocations on protected data symbols" thing is x86 specific and only applies with gcc+GNU ld+glibc. Non-x86 architectures don't have this thing. gold doesn't have this thing. clang doesn't have this thing.