[PATCH RFC] bfd/ELF: restrict file alignment for object files
Jan Beulich
jbeulich@suse.com
Mon Sep 9 13:15:50 GMT 2024
On 09.09.2024 14:01, Nick Clifton wrote:
>>> A fair point. To be honest I am not sure how much the kernel cares about
>>> alignments of any sections in .ko files. But better to play safe is my
>>> feeling.
>>
>> yet then - any hint from where to take the two alignment values? Do they
>> need adding from scratch, for every architecture?
>
> Maybe bfd->xvec->section_alignment_power ?
>
> (I have not looked to see if this is used consistently, so the suggestion
> may be a non-starter).
I'm afraid I can't even spot a field of this name. If there was one, it
also couldn't possibly express both minimal code and minimal data _file_
alignment (we're not really talking of in-memory alignment here, after
all).
> Or asection.alignment_power ?
That's what results from .align etc directives in sources, isn't it? Or
for the linker from what incoming sections specify. Pretty clearly what
we want here can't very well be a per-section property.
Jan
More information about the Binutils
mailing list