I would assume that 2**2
means 22, or 4 byte alignment, while 2**0
means no (one byte) alignment.
This value comes from the sh_addralign
field of the ELF section header. The ELF specification states (emphasis mine):
sh_addralign
Some sections have address alignment constraints. For example, if a section holds a
doubleword, the system must ensure doubleword alignment for the entire section.
That is, the value of sh_addr must be congruent to 0, modulo the value of
sh_addralign. Currently, only 0 and positive integral powers of two are allowed.
Values 0 and 1 mean the section has no alignment constraints.
As Ray Toal mentioned, since the alignment must be a power of two, it only makes sense that objdump
would express this value as a power of two with the 2**x
notation.
Note that in some languages, like Python and FORTRAN, **
is a power or exponentiation operator.
Looking at objdump.c
, we see:
static void
dump_section_header (bfd *abfd, asection *section,
void *ignored ATTRIBUTE_UNUSED)
{
// ...
printf (" %08lx 2**%u", (unsigned long) section->filepos,
bfd_get_section_alignment (abfd, section));
And in objdump.h
:
#define bfd_get_section_alignment(bfd, ptr) ((ptr)->alignment_power + 0)
where the alignment_power
member of bfd
is:
/* The alignment requirement of the section, as an exponent of 2 -
e.g., 3 aligns to 2^3 (or 8). */
unsigned int alignment_power;