This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH][GOLD] Fix PR20765 [2.27 Regression] gold internal error in fix_errata on aarch64-linux-gnu


Hi Cary, thanks for pointing this out and providing a suggestion. Hi Peter,
thanks for providing the fix. I'll take a look into this issue and report
back. Thanks, Han

On Thu, Nov 30, 2017 at 3:06 PM Cary Coutant <ccoutant@gmail.com> wrote:

> > The full details are in the PR, to summarise:
> > - The internal fault is caused when there is more than one stub table
> > and the addresses in the second stub table are dependent on the size
> > of the first stub table. As the erratum stub addresses are only set
> > once, an internal fault is triggered at relocation time when the
> > inconsistency is detected.
> > - The patch is to update the erratum stub addresses on each relaxation
> pass.
>
> First, thanks for investigating and finding the problem!
>
> I think the stub code needs a little bit of rework in order to avoid
> this extra work on each relaxation pass.
>
> I'd prefer to see the erratum_address stored as an offset relative to
> the output address of the input section; the actual address can be
> easily computed at the one time it's needed in
> fix_errata_and_relocate_erratum_stubs(). The destination_address isn't
> actually needed at all for errata stubs -- it's always erratum_address
> + BPI -- so I don't think it needs to be stored or readjusted. It
> could be ignored for errata stubs, or could be moved out of Stub_base
> and into a new derived class for relocation stubs.
>
> This is not a change I can make on my own without adequate testing,
> and I'm not set up to do any native aarch64 testing. Since this
> appears to be a significant problem, though, I don't want to delay a
> fix, and I'm inclined to go ahead and apply the patch you've provided.
> I'd like to ask either you or Han to take a look at the suggestions
> I've made above and submit a clean-up patch at a later time.
>
> I've committed this with the following ChangeLog:
>
> 2017-11-30  Peter Smith  <peter.smith@linaro.org>
>
> gold/
>         PR gold/20765
>         * aarch64.cc (Aarch64_relobj::update_erratum_address): New method.
>         (AArch64_relobj::scan_errata): Update addresses in stub table after
>         relaxation pass.
>
> -cary
>
-- 
Han Shen |  Software Engineer |  shenhan@google.com |  +1-650-440-3330


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]