From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9766 invoked by alias); 15 Dec 2017 15:38:31 -0000 Mailing-List: contact gnu-gabi-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Post: List-Help: List-Subscribe: Sender: gnu-gabi-owner@sourceware.org Received: (qmail 9748 invoked by uid 89); 15 Dec 2017 15:38:29 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.99.2 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2 spammy=H*MI:sk:1513245 X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on sourceware.org X-Spam-Level: X-HELO: gnu.wildebeest.org Received: from wildebeest.demon.nl (HELO gnu.wildebeest.org) (212.238.236.112) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 15 Dec 2017 15:38:28 +0000 Received: from tarox.wildebeest.org (tarox.wildebeest.org [172.31.17.39]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by gnu.wildebeest.org (Postfix) with ESMTPSA id CC06E32B90EF; Fri, 15 Dec 2017 16:38:25 +0100 (CET) Received: by tarox.wildebeest.org (Postfix, from userid 1000) id 7FF354001420; Fri, 15 Dec 2017 16:38:25 +0100 (CET) Message-ID: <1513352305.15696.89.camel@klomp.org> Subject: Re: What integer type should ELF note header have? From: Mark Wielaard To: "H.J. Lu" Cc: Generic System V Application Binary Interface , Suprateeka R Hegde , Cary Coutant , Mark Mentovai , gnu-gabi@sourceware.org Date: Sun, 01 Jan 2017 00:00:00 -0000 In-Reply-To: References: <99c8440b-54d8-41bc-6e4d-cd1894536bb7@Oracle.COM> <993f8818-65a6-b83a-9d55-1fbbd88db8c8@gmail.com> <1512985389.15696.45.camel@klomp.org> <1513173445.15696.62.camel@klomp.org> <1513245995.15696.78.camel@klomp.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Evolution 3.22.6 (3.22.6-10.el7) Mime-Version: 1.0 X-Spam-Flag: NO X-SW-Source: 2017-q4/txt/msg00023.txt.bz2 On Thu, 2017-12-14 at 08:39 -0800, H.J. Lu wrote: > > > > BTW. What is the reason you need 8 byte aligned notes? > > >=20 > > > NT_GNU_PROPERTY_TYPE_0 can have 64-bit integer properties > > > in 64-bit objects.=C2=A0=C2=A0They should be aligned to 8 bytes. > >=20 > > Not necessarily. You can have not naturally aligned data in files. > > ELF > > files are cross architectures, so you have to account for different >=20 > 64-bit integers in NT_GNU_PROPERTY_TYPE_0 note are naturally aligned > by design so that int64 can be used to access 64-bit integers in > NT_GNU_PROPERTY_TYPE_0 note on all architectures. >=20 > > alignments and endian issues anyway. Is there a specific property > > of > > these 64-bit integers that require them to be 8 byte aligned in the > > note descriptor data? >=20 > Currently it has GNU_PROPERTY_STACK_SIZE as 64-bit integer > in 64-bit objects.=C2=A0=C2=A0We may add more in the future. So is it just convenience, so you don't have to write a read_8byte_unaligned_value macro to read the data in the note? I sympathize that reading note data can be a bit of a pain because you cannot rely on the data being naturally aligned. But I am unsure that is such a big trouble that it needs new alignment/layout rules. Cheers, Mark