From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mailbackend.panix.com (mailbackend.panix.com [166.84.1.89]) by sourceware.org (Postfix) with ESMTPS id 34AAB386F839 for ; Fri, 1 May 2020 14:07:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 34AAB386F839 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=panix.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=zackw@panix.com Received: from mail-ej1-f44.google.com (mail-ej1-f44.google.com [209.85.218.44]) by mailbackend.panix.com (Postfix) with ESMTPSA id 49DDb96hDPzVM5 for ; Fri, 1 May 2020 10:07:17 -0400 (EDT) Received: by mail-ej1-f44.google.com with SMTP id x1so7544792ejd.8 for ; Fri, 01 May 2020 07:07:17 -0700 (PDT) X-Gm-Message-State: AGi0PubcPAFrEU6UxlQoOeMFXw4OfVFC7RqrHXYg6SHHHSrvT2Nzey0G IIrDPpukNh+ZqmYHannZWehPYagydFj+QQgSiJA= X-Google-Smtp-Source: APiQypKquC4L4blFukclFf/dzbGFcuMLiVhuxulBxR6f8ING2JNqmxTS27Ht24nQocQ3UrktRYd06+hTlxTPlwRVsoE= X-Received: by 2002:a17:906:8286:: with SMTP id h6mr3464886ejx.28.1588342036944; Fri, 01 May 2020 07:07:16 -0700 (PDT) MIME-Version: 1.0 References: <20200430173458.GV29015@arm.com> <20200430174329.GD29015@arm.com> <20200501092351.GI29015@arm.com> In-Reply-To: <20200501092351.GI29015@arm.com> From: Zack Weinberg Date: Fri, 1 May 2020 10:07:06 -0400 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 08/12] Rewrite abi-note.S in C. To: Szabolcs Nagy Cc: GNU C Library , Sudakshina Das Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no 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: Fri, 01 May 2020 14:07:20 -0000 On Fri, May 1, 2020 at 5:24 AM Szabolcs Nagy wrote: > what about > > /* Note: Custom type is used as ElfW(Nhdr) is wrong on 64 bit targets. */ > > __attribute__((used, aligned(4), section(".note.ABI-tag"))) > static const struct > { > int32_t namesz; > int32_t descsz; > int32_t type; > char name[4]; > int32_t desc[4]; > } __abi_tag = { > 4, /* name length: 4 */ > 16, /* data length: 4 32-bit numbers */ > 1, > "GNU", > { __ABI_TAG_OS, __ABI_TAG_VERSION } > }; > > this fixes the alignment, makes the symbol local, does not need > endian.h and uses identifiers according to the gabi specification. Looks good to me. Fixing the array length means the compiler should complain if __ABI_TAG_VERSION ever expands to the wrong number of initializers. zw