This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [gold][aarch64]Give informative error message when stub-group-size is too large
- From: Cary Coutant <ccoutant at google dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: Jing Yu <jingyu at google dot com>, binutils <binutils at sourceware dot org>, Han Shen <shenhan at google dot com>
- Date: Sun, 14 Dec 2014 09:00:31 -0800
- Subject: Re: [gold][aarch64]Give informative error message when stub-group-size is too large
- Authentication-results: sourceware.org; auth=none
- References: <CAJ_rGWQaPCnS-sPM=Q-S0YRcisbfah4i4Btjgs_Ni-rqBPdFgQ at mail dot gmail dot com> <CAHACq4ohzU4Lx2eky0JNqh3OXqyk7J1bPuM_w16Rz+QEMC1oQQ at mail dot gmail dot com> <CAMe9rOpfWSyZj8_WYT6R1u-hDEWVeUvx=tqFpp5CgOGHDTb53Q at mail dot gmail dot com>
Thanks!
-cary
On Sun, Dec 14, 2014 at 7:02 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Wed, Dec 10, 2014 at 3:11 PM, Cary Coutant <ccoutant@google.com> wrote:
>>> 2014-12-10 Jing Yu <jingyu@google.com>
>>>
>>> * aarch64.cc (Target_aarch64): Add new variable: stub_group_size_.
>>> (AArch64_relocate_functions::maybe_apply_stub): Add new parameter.
>>> Update error message.
>>> (Target_aarch64::do_relax): Use absolute value of option
>>> stub_group_size. Replace local variable with class member
>>> stub_group_size_.
>>
>> This is OK. Thanks!
>>
>> -cary
>
> This failed on 32-bit host:
>
> /export/linux/src/binutils/binutils/gold/target-select.h:39:7:
> required from here
> /export/linux/src/binutils/binutils/gold/aarch64.cc:4208:27: error:
> format â%lxâ expects argument of type âlong unsigned intâ, but
> argument 2 has type âgold::section_size_type {aka unsigned int}â
> [-Werror=format=]
> cc1plus: all warnings being treated as errors
> make[6]: *** [aarch64.o] Error 1
>
> I am checking in this as an obvious fix.
>
> --
> H.J.
> ----
> Cast current_group_size to unsigned long
>
> * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
> Cast current_group_size to unsigned long when reporting error.
>
> diff --git a/gold/ChangeLog b/gold/ChangeLog
> index 5c32168..8f56043 100644
> --- a/gold/ChangeLog
> +++ b/gold/ChangeLog
> @@ -1,3 +1,8 @@
> +2014-12-14 H.J. Lu <hongjiu.lu@intel.com>
> +
> + * aarch64.cc (AArch64_relocate_functions::maybe_apply_stub):
> + Cast current_group_size to unsigned long when reporting error.
> +
> 2014-12-10 Jing Yu <jingyu@google.com>
>
> * aarch64.cc (Target_aarch64): Add new variable stub_group_size_.
> diff --git a/gold/aarch64.cc b/gold/aarch64.cc
> index f2505d6..05933e0 100644
> --- a/gold/aarch64.cc
> +++ b/gold/aarch64.cc
> @@ -4205,7 +4205,7 @@ maybe_apply_stub(unsigned int r_type,
> if (status != This::STATUS_OKAY)
> gold_error(_("Stub is too far away, try a smaller value "
> "for '--stub-group-size'. The current value is 0x%lx."),
> - current_group_size);
> + static_cast<unsigned long>(current_group_size));
> return true;
> }