This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH][GOLD] Fix PR20765 [2.27 Regression] gold internal error in fix_errata on aarch64-linux-gnu
- From: Cary Coutant <ccoutant at gmail dot com>
- To: Peter Smith <peter dot smith at linaro dot org>, Han Shen <shenhan at google dot com>
- Cc: Binutils <binutils at sourceware dot org>
- Date: Thu, 30 Nov 2017 15:06:04 -0800
- Subject: Re: [PATCH][GOLD] Fix PR20765 [2.27 Regression] gold internal error in fix_errata on aarch64-linux-gnu
- Authentication-results: sourceware.org; auth=none
> 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