[gold][aarch64]: Fixing gold pr/21491 - Errata workaround can produce broken images.

Han Shen via binutils binutils@sourceware.org
Fri Jul 7 17:48:00 GMT 2017


Hi Cary, android bot reported a compilation failure on Mac Darwin
systems due to duplicated instantiated template methods. This was
fixed.

Attached is the revised patch. ChangeLog is also updated. Sorry for
the confusion.

gold/ChangeLog:

        2017-07-06  Han Shen  <shenhan@google.com>

        * aarch64.cc (do_relocate_stub_tables): New method (implementation).
        (do_relocate_sections): Removed relocate stub code.
        * gold.cc (queue_final_tasks): Queue Relocstub_tasks.
        * object.h (Relobj::relocate_stub_tables): New method.
        (Relobj::clear_views): Pure virtual method.
        (Relobj::do_relocate_stub_tables): Pure virtual method.
        (Sized_relobj::do_relocate_stub_tables): New method declaration.
        (Sized_relobj::clear_views): New method declaration.
        (Sized_relobj_file::create_views): New method.
        (Sized_relobj_file::get_views): New method.
        (Sized_relobj_file::clear_views): New method declaration.
        * object.cc (Sized_relobj::clear_views): New method (empty).
        (Sized_relobj::do_relocate_stub_tables): New method (empty).
        (Sized_relobj_file::clear_views): New method (implementation).
        * reloc.h (Relocstub_task): New task class.
        (Relocate_task::symbol_table): New method.
        (Relocate_task::layout): New method.
        (Relocate_task::object): New method.
        (Relocate_task::defer_object_cleanup_): New member.
        * reloc.cc (Relocstub_task): New task class definition.
        (Sized_relobj_file::do_relocate): Removed relocate_stub code.

Han

On Thu, Jul 6, 2017 at 11:03 AM, Han Shen <shenhan@google.com> wrote:
> Hi Cary, this patch fixes gold pr/21491 - Errata workaround can
> produce broken images.
>
> The root cause of the bug is that in the origin implementation,
> relocate_sections and relocate_stubs phases are interleaved, in some
> cases, relocate_stubs copy instructions before they are relocated in
> relocate_sections phase, resulting stale and invalid insns in the
> final stub table.
>
> This patch fixes the problem by adding a new task "Relocstub_task"
> that runs after "Relocate_task", so relocate_stubs always pick the
> relocated insn.
>
> Tested: test case in bug passed and from Android toolchain team -
> "built all platform source tree for all Android architectures; pushed
> Angler build onto device & tested device."
>
> gold/ChangeLog:
>
> 2017-07-06  Han Shen  <shenhan@google.com>
>
> * aarch64.cc (do_relocate_stub_tables): New method.
> (do_relocate_sections): Removed relocate stub code.
> * gold.cc (queue_final_tasks): Queue Relocstub_tasks.
> * object.h (Relobj::relocate_stub_tables): New method.
> (Relobj::clear_views): New method.
> (Relobj::do_relocate_stub_tables): New method.
> (Sized_relobj_file::do_relocate_stub_tables): New method.
> (Sized_relobj_file::create_views): New method.
> (Sized_relobj_file::get_views): New method.
> (Sized_relobj_file::clear_views): New method.
> * reloc.h (Relocstub_task): New task class.
> (Relocate_task::symbol_table): New method.
> (Relocate_task::layout): New method.
> (Relocate_task::object): New method.
> * reloc.cc (Relocstub_task): New task class definition.
> (Sized_relobj_file::do_relocate): Removed relocate_stub code.
> (Sized_relobj_file::do_relocate_stub_tables): New specialized functions.
> (Sized_relobj_file::do_clear_views): New specialized functions.
>
> Ok for trunk?



-- 
Han Shen |  Software Engineer |  shenhan@google.com |  +1-650-440-3330
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr21491-v2.patch
Type: text/x-patch
Size: 19426 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20170707/a17d2b95/attachment.bin>


More information about the Binutils mailing list