bug-binutils
[Top][All Lists]
Advanced

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

[Bug gas/29145] GAS always generates padding instructions regardless of


From: lh_mouse at 126 dot com
Subject: [Bug gas/29145] GAS always generates padding instructions regardless of `--no-pad-sections`
Date: Wed, 18 May 2022 16:48:54 +0000

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

--- Comment #2 from LIU Hao <lh_mouse at 126 dot com> ---
(In reply to Nick Clifton from comment #1)
> (In reply to LIU Hao from comment #0)
>   
> > We attempt to compile the same code targeting mingw-w64:
> 
> > This time the `.text` section has a size of 16 and alignment of 16 bytes,
> > which is undesired.
> 
> Unfortunately this is required by the PE specification, so it cannot
> be changed.  (The alignment of the .text section can be increased, but
> it cannot be decreased below 16 bytes).
> 

Thank you for the reply.

Would you please provide a link to this specification? I doubt whether it is
necessary to keep a 16-byte aligned .text section in every object.

If I was including all source files into a big .c file, then compiling it with
`-Os`, there would be no such padding, as expected. This is however pretty bad
when building a static library, as it will pull in all symbols when only a few
of them are requested.

Normally we have quite a few .o files; each of them has its own .text section.
Does it really matter that each individual such section isn't aligned? During
the linking phase, LD will join them together, and the final, merged .text
section will have a 512-byte alignment in files and a 4096-byte alignment in
memory. I don't see how that can malfunction.

-- 
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]