This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [gold][PATCH] PR gold/17619: Check PC-relative offset overflow in PLT entry
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Cary Coutant <ccoutant at google dot com>
- Cc: Binutils <binutils at sourceware dot org>
- Date: Wed, 19 Nov 2014 17:08:21 -0800
- Subject: Re: [gold][PATCH] PR gold/17619: Check PC-relative offset overflow in PLT entry
- Authentication-results: sourceware.org; auth=none
- References: <20141118193634 dot GA16737 at intel dot com> <CAHACq4pASeVcQQa=iMw+WywpTEmWbnEvqp9DgcxQ1saAtYoo7Q at mail dot gmail dot com>
On Wed, Nov 19, 2014 at 4:37 PM, Cary Coutant <ccoutant@google.com> wrote:
>> + // Check PC-relative offset overflow in PLT entry.
>> + bool gotplt_after_plt = got_address > plt_address;
>> + int32_t plt_got_pcrel_offset = (got_address + got_offset
>> + - (plt_address + plt_offset + 6));
>> + if ((gotplt_after_plt && plt_got_pcrel_offset < 0)
>> + || (!gotplt_after_plt && plt_got_pcrel_offset > 0))
>> + gold_error(_("PC-relative offset overflow in PLT entry"));
>
> It would be nice to print more information here. I think it's
> next-to-impossible at this point to translate the PLT index into a
I will update it.
> symbol, but we could at least print the PLT index. Is there a remedy
> we can suggest?
>
We can use large PIC model. But it isn't supported by gold:
https://sourceware.org/bugzilla/show_bug.cgi?id=17593
--
H.J.