[PATCH] x86: Set alignment of output SEC_EXCLUDE section to 1
H.J. Lu
hjl.tools@gmail.com
Fri Nov 30 13:53:00 GMT 2018
On Fri, Nov 30, 2018 at 12:43:36AM -0700, Jan Beulich wrote:
> >>> 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.
>
I will take Alan's approach.
H.J.
More information about the Binutils
mailing list