From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by sourceware.org (Postfix) with ESMTPS id 6B5A7393A418 for ; Mon, 21 Jun 2021 12:57:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6B5A7393A418 Received: by mail-pl1-x630.google.com with SMTP id v13so8494471ple.9 for ; Mon, 21 Jun 2021 05:57:46 -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; bh=+H+X+4Hzfrx7zqAWp0xGSLRiVB6XG3lWJ5vTE9XRlKc=; b=R8dLPfRLyjx7ZcM14UN0+5CYRgRr5whv3u2fJ3NstOwx//Vr8ylyPEpMFm89vQYfju aYoORQ2/FtmEdYH2sWNAxeu6EgguLkpsfA7mqBZC5f3DHMHw8IdiaQRRoOqaot8bUvTG cgfWRpoeWGHMzzfQaoOGsArHnTjTvYj8B4xe1hV3D1tqRp1RjEGel0KcaTv+1zUxyrqu Z4qdCbPzdRAtGr+545IOuulK15iHLiov95iUs0mKfcQxZ1wq577Ot6D8xqNp8poNLzmi YC6FFgQwjYHJWwZ7sWUnE6hTG+RhjLc6pJs9tMJXuN2JSFy5aSjZL8y8/1mTVRWFyDt8 kABQ== X-Gm-Message-State: AOAM531G8HR8SDcMBPRI5pdjZZJ0SNh8c1NOCdBsOXc2pSRyWjqAyCYW 7oh7hfoEFffdJ1P8UhuS0FH/uyFYq5+lLJtyRYg= X-Google-Smtp-Source: ABdhPJwRpdUWuLKoDDJuFApwJz6lNl9TIIZhH5R4U6Z6VUYAHeSonOkK8fTjSzBwcXSw+wqFLYNKfbkwxCmiR7sWnJk= X-Received: by 2002:a17:90a:4d84:: with SMTP id m4mr37446059pjh.136.1624280265655; Mon, 21 Jun 2021 05:57:45 -0700 (PDT) MIME-Version: 1.0 References: <20210620233620.391576-1-hjl.tools@gmail.com> <20210620233620.391576-2-hjl.tools@gmail.com> <87k0mnn1d0.fsf@oldenburg.str.redhat.com> In-Reply-To: <87k0mnn1d0.fsf@oldenburg.str.redhat.com> From: "H.J. Lu" Date: Mon, 21 Jun 2021 05:57:09 -0700 Message-ID: Subject: Re: [PATCH 1/4] Initial support for GNU_PROPERTY_1_NEEDED To: Florian Weimer Cc: "H.J. Lu via Libc-alpha" Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3033.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, 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: 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: Mon, 21 Jun 2021 12:57:47 -0000 On Mon, Jun 21, 2021 at 12:06 AM Florian Weimer wrote: > > * H. J. Lu via Libc-alpha: > > > diff --git a/elf/elf.h b/elf/elf.h > > index 2a62b98d4a..45b107fdcf 100644 > > --- a/elf/elf.h > > +++ b/elf/elf.h > > @@ -1310,6 +1310,23 @@ typedef struct > > /* No copy relocation on protected data symbol. */ > > #define GNU_PROPERTY_NO_COPY_ON_PROTECTED 2 > > > > +/* A 4-byte unsigned integer property: A bit is set if it is set in all > > + relocatable inputs. */ > > +#define GNU_PROPERTY_UINT32_AND_LO 0xb0000000 > > +#define GNU_PROPERTY_UINT32_AND_HI 0xb0007fff > > + > > +/* A 4-byte unsigned integer property: A bit is set if it is set in any > > + relocatable inputs. */ > > +#define GNU_PROPERTY_UINT32_OR_LO 0xb0008000 > > +#define GNU_PROPERTY_UINT32_OR_HI 0xb000ffff > > + > > +/* The needed properties by the object file. */ > > +#define GNU_PROPERTY_1_NEEDED GNU_PROPERTY_UINT32_OR_LO > > + > > +/* Set if the object file requires canonical function pointers and > > + cannot be used with copy relocation. */ > > +#define GNU_PROPERTY_1_NEEDED_SINGLE_GLOBAL_DEFINITION (1U << 0) > > + > > /* Processor-specific semantics, lo */ > > #define GNU_PROPERTY_LOPROC 0xc0000000 > > /* Processor-specific semantics, hi */ > > Please add a stable link to the full specification. I will work on it. > I think we need more bits: one bit to indicate the status (in this > patch), and another bit to indicate linker support for this feature. > And perhaps yet another to indicate incompatibility with this feature. > There is #define GNU_PROPERTY_1_NEEDED GNU_PROPERTY_UINT32_OR_LO Since the setting on output is ORed from inputs, one bit is sufficient. -- H.J.