From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) by sourceware.org (Postfix) with ESMTPS id 542D13982C23 for ; Thu, 17 Jun 2021 19:38:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 542D13982C23 Received: by mail-pj1-x102b.google.com with SMTP id k22-20020a17090aef16b0290163512accedso5980560pjz.0 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=EIIJy33K2Yp4+jYO2nyCEBJ1fP6DSTQgoM+DzG3RAMDK5t+kLekUnd7XhyUd4iRngf vbQFCxCpwvykCEjl9CI9vBVprDKfKr7mfDqykiQ9l2LvTXEdN8+dVJkDvLipHs3Noren I/aOTDRbX3hkjhB1YCs5AiEqt3jargSv979qu7UCDESUnoyy7mHfhoON6uXZcw88BW8O dzlN2jFuBP5a0z+YX2MHN6V0y+C+UVlj7XF5DLmjXcX6yTBXq4vUFhZ2RyKCowC8Flbf zTA9xQjTNB+U7rMHC+V4byXzKdOk8NSD8Dzk6hUbS7S7BNY3phr4XWiXPYXOfEYg0vcc /uEA== X-Gm-Message-State: AOAM530aXO6QHnFbn/5SEH/d/+8cjBEXrJBzT0bG/oRimYd1PmmTOzT6 LAMRkdUcrKIOKHLZw4d+1tOxkw== 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: 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, 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.