From 9a7bc47bf065405c2e7b6c46d692a7d137d5f544 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Fri, 17 Nov 2017 05:41:09 -0800 Subject: [PATCH] Add a section for alignment of note sections 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..c33965d 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_NOTE} 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