[PATCH] x86: Set alignment of output SEC_EXCLUDE section to 1

Jan Beulich JBeulich@suse.com
Fri Nov 30 07:43:00 GMT 2018


>>> On 29.11.18 at 23:57, <hjl.tools@gmail.com> wrote:
> The first pass of one_lang_size_sections_pass doesn't check the
> SEC_EXCLUDE bit in input sections.  But the excluded input section
> alignment will affect vma and lma of the following sections.  When the
> excluded input section is stripped by strip_excluded_output_sections
> later, the subsequent pass of one_lang_size_sections_pass may move dot
> of the following section moving backwards, resulting in a warning and
> section lma not being set properly which later leads to a "File truncated"
> error.  To work around it, we set alignment of the output section to
> 1 if there is only one excluded input section.

Why the special treatment of a single excluded input section?
Doesn't the same apply if multiple excluded input ones contribute
to the same output one? I.e. the treatment would need to occur
when an output section consists of only excluded input ones?

Even in the mixed case I would then wonder whether the
behavior is correct, but I could agree that such a case would
better be prevented by the programmer in the first place.

Jan




More information about the Binutils mailing list