This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] Plumb --pic-veneer option for gold.
- From: Han Shen <shenhan at google dot com>
- To: Ian Coolidge <icoolidge at google dot com>
- Cc: binutils <binutils at sourceware dot org>, Cary Coutant <ccoutant at gmail dot com>, Luis Lozano <llozano at google dot com>
- Date: Thu, 23 Jul 2015 14:29:31 -0700
- Subject: Re: [PATCH] Plumb --pic-veneer option for gold.
- Authentication-results: sourceware.org; auth=none
- References: <1437642401-10412-1-git-send-email-icoolidge at google dot com>
Hi Ian, ok for me with the following minor changes in gold/ChangeLog.
Waiting for owners approval.
Thanks,
Han
On Thu, Jul 23, 2015 at 2:06 AM, Ian Coolidge <icoolidge@google.com> wrote:
> This fixes ARM Linux gold link after
> 02e541d: ARM: 8323/1: force linker to use PIC veneers
>
> gold/
> * arm.cc (function): Plumb pic-veneer option to stub generation.
s/function/Reloc_stub::stub_type_for_reloc/
> * options.h (function): Add --pic-veneer option.
s/function/General_options/
> ---
> gold/arm.cc | 7 ++++---
> gold/options.h | 3 +++
> 2 files changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/gold/arm.cc b/gold/arm.cc
> index 621b28e..fa9fdb2 100644
> --- a/gold/arm.cc
> +++ b/gold/arm.cc
> @@ -4542,7 +4542,7 @@ Reloc_stub::stub_type_for_reloc(
> // This is a bit ugly but we want to avoid using a templated class for
> // big and little endianities.
> bool may_use_blx;
> - bool should_force_pic_veneer;
> + bool should_force_pic_veneer = parameters->options().pic_veneer();
> bool thumb2;
> bool thumb_only;
> if (parameters->target().is_big_endian())
> @@ -4550,7 +4550,7 @@ Reloc_stub::stub_type_for_reloc(
> const Target_arm<true>* big_endian_target =
> Target_arm<true>::default_target();
> may_use_blx = big_endian_target->may_use_v5t_interworking();
> - should_force_pic_veneer = big_endian_target->should_force_pic_veneer();
> + should_force_pic_veneer |= big_endian_target->should_force_pic_veneer();
> thumb2 = big_endian_target->using_thumb2();
> thumb_only = big_endian_target->using_thumb_only();
> }
> @@ -4559,7 +4559,8 @@ Reloc_stub::stub_type_for_reloc(
> const Target_arm<false>* little_endian_target =
> Target_arm<false>::default_target();
> may_use_blx = little_endian_target->may_use_v5t_interworking();
> - should_force_pic_veneer = little_endian_target->should_force_pic_veneer();
> + should_force_pic_veneer |=
> + little_endian_target->should_force_pic_veneer();
> thumb2 = little_endian_target->using_thumb2();
> thumb_only = little_endian_target->using_thumb_only();
> }
> diff --git a/gold/options.h b/gold/options.h
> index f4da128..d1a2e1e 100644
> --- a/gold/options.h
> +++ b/gold/options.h
> @@ -981,6 +981,9 @@ class General_options
> N_("Create a position independent executable"),
> N_("Do not create a position independent executable"),
> false);
> + DEFINE_bool(pic_veneer, options::TWO_DASHES, '\0', false,
> + N_("Force PIC sequences for ARM/Thumb interworking veneers"),
> + NULL);
>
> DEFINE_bool(pipeline_knowledge, options::ONE_DASH, '\0', false,
> NULL, N_("(ARM only) Ignore for backward compatibility"));
> --
> 2.4.3.573.g4eafbef
>
Han Shen