bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug binutils/24942] objcopy: Add option for setting section alignment


From: i at maskray dot me
Subject: [Bug binutils/24942] objcopy: Add option for setting section alignment
Date: Tue, 24 Sep 2019 03:18:36 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=24942

--- Comment #9 from Fangrui Song <i at maskray dot me> ---
I don't require the support for non power-of-2 alignment. I just want to say
--set-section-alignment .foo=8 => sh_addralign=256  is counterintuitive. It is
not what readelf -S displays. (objdump -h displays it as `2**8`. The `**` at
least makes it clear that an exponent is involved.)

> I think not all BFD targets support arbitrary alignment, some may only 
> support powers of 2.

We can simply reject non power-of-2 alignment when parsing the command line
option, like what you've done when there is no string on the right of `=`

> The ".align" directive also works this way (at least on ARM).

I know that the .align directive is in powers of 2 on ARM/AArch64/MIPS/PowerPC,
but it is in bytes on x86, Sparc and System z. I don't know how this
inconsistency came, .balign and .p2align may be better.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]