From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com [IPv6:2607:f8b0:4864:20::1031]) by sourceware.org (Postfix) with ESMTPS id 4D82F398B8B9 for ; Thu, 17 Jun 2021 19:38:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4D82F398B8B9 Received: by mail-pj1-x1031.google.com with SMTP id h16so4394630pjv.2 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=epnasj046L6Mm5nGWa8CtTruffD+QJduFz3qF15MsrVYKGghTLnwY7K7v2dL0dy83a pLKnqYk4oWHj5Ay3rZZle5O8p9eG8D/Zax4z29EQ4n/uLCkTETBb7bYbFqNxzId6P4oz iXV+W58gtqXaL8HQvtM8QuhGj4We3CnQxNUy699KeQ2W4RxNp/rk63F2owoYEjH+D8N+ gFT3eJtYM7qnLuK5kWlc6niDMoeUI96kLVzZ/rb8MuPNl/8Jyw6tPhuv7rBfkeTerJNm e4cvo8bla8nX+gwbSxRoN5bFZF8E7ifA9Xqfgtt44dWRYBRTTOWsc6s6LG61tbe3g1J0 CyKA== X-Gm-Message-State: AOAM533gf+tAHepM0ei+40uILj2hb2+HGSjQjTcRxvydhw9/2HAmyZhO AqawY7NumepTTLwBYW9pG7jP+S/zt3Kc8g== 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=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: 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.