public inbox for gnu-gabi@sourceware.org
 help / color / mirror / Atom feed
From: "H.J. Lu" <hjl.tools@gmail.com>
To: gnu-gabi@sourceware.org
Subject: GNU-gABI: Alignment of .note.ABI-tag and .note.gnu.build-id sections
Date: Sun, 01 Jan 2017 00:00:00 -0000	[thread overview]
Message-ID: <20171117135925.GA24338@gmail.com> (raw)

According to gABI, each note entry should be aligned to 4 bytes in 32-bit
objects or 8 bytes in 64-bit objects.  But Linux has been using 4 byte 
alignment for .note.ABI-tag note and .note.gnu.build-id note in 64-bit
objects.  We can't change their alignment to 8 bytes.  Since all notes i
n one PT_LOAD segment must have the same alignment which equals to p_align.
Note parser can use p_align of PT_LOAD segment for note alignment, instead
of assuming alignment based on ELF file class.

Here is a patch to Linux Extensions to gABI.  I also regenerated PDF
file at

https://github.com/hjl-tools/linux-abi/wiki/Linux-Extensions-to-gABI

H.J.
---
Document difference in alignment of .note.ABI-tag and .note.gnu.build-id
sections from gABI.
---
 object-files.tex | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/object-files.tex b/object-files.tex
index 64ce243..5b7b414 100644
--- a/object-files.tex
+++ b/object-files.tex
@@ -518,6 +518,18 @@ identify OS and version targeted.  It can be merged with other
    signifies a 2.2.5 kernel.
 \end{description}
 
+\subsection{Alignment of Note Sections}
+
+All entries in a \texttt{PT_LOAD} segment have the same alignment which
+equals to the {\tt p_align} field in program header.
+
+According to gABI, each note entry should be aligned to 4 bytes in
+32-bit objects or 8 bytes in 64-bit objects.  But \code{.note.ABI-tag}
+section (see Section~\ref{sec_abi_tag}) and \code{.note.gnu.build-id}
+section (see Section~\ref{sec_build_id}) are aligned to 4 bytes in
+both 32-bit and 64-bit objects.  Note parser should use {\tt p_align}
+for note alignment, instead of assuming alignment based on ELF file class.
+
 \section{Symbol Table}
 
 \begin{table}[H]
-- 
2.14.3

             reply	other threads:[~2017-11-17 13:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-01  0:00 H.J. Lu [this message]
2017-01-01  0:00 ` H.J. Lu
     [not found] <CAHk1GDxbS6Pgm3a3K9pkorzEg9cm8bWU+=LaRK_yGTrrQ57A-A@mail.gmail.com>
     [not found] ` <CAHk1GDy79gf3YpzPt83WEXP-OLOKW+UH=aYUqvEjLfC=_ZHwew@mail.gmail.com>
2017-01-01  0:00   ` Mark Mentovai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171117135925.GA24338@gmail.com \
    --to=hjl.tools@gmail.com \
    --cc=gnu-gabi@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).