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

--- Comment #4 from Jan Beulich <jbeulich at suse dot com> ---
(In reply to Nick Clifton from comment #3)
> The intention was to allow objcopy's --section-alignment option to not only
> set the SectionAlignment field in the PE format's optional header but to
> also set the IMAGE_SCN_ALIGN_POWER field in the pe_flags field of each
> section's data.  (Since presumably the PE header's value is a minimum
> required alignment, so individual sections should also have at least this
> much alignment).

Observations in practice suggest that this, while perhaps even documented this
way somewhere, isn't necessarily the case. Our own ld, just to give an example,
may emits sections whose RVA isn't a multiple of the header's section alignment
field. I'm observing this for build-ID in particular, when emitted to a
separate .buildid section. Also for Dwarf .debug_* sections. But even a custom
.data.* followed by .data and then .bss won't necessarily have the latter two
put on section alignment boundaries. (Aiui sections obeying to the header field
is largely relevant for binaries to be run in paged environments. EFI binaries,
for example, wouldn't fall in this group.)

As alluded to earlier, I think --section-alignment needs to be limited to
setting the header field. (We may certainly emit warnings where we see fit.)
Individual sections' alignment ought to be controlled by
--set-section-alignment, and that's for object files only anyway.

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

Reply via email to