This is the mail archive of the
mailing list for the binutils project.
Re: PPC gold doesn't check for overflow properly
- From: Cary Coutant <ccoutant at google dot com>
- To: Cary Coutant <ccoutant at google dot com>, Binutils <binutils at sourceware dot org>
- Date: Thu, 20 Nov 2014 10:33:53 -0800
- Subject: Re: PPC gold doesn't check for overflow properly
- Authentication-results: sourceware.org; auth=none
- References: <CAHACq4rr8Z6bKL74tmunhwZYUJx1s6md=+0vg5+oWVDjNr84bA at mail dot gmail dot com> <20141120111444 dot GB4477 at bubble dot grove dot modra dot org>
>> Aside from overflow detection, it seems like add_plt_call_entry(),
>> when it finds an existing stub, could check that the stub is within
>> range of the branch we're looking at, and go ahead and create a new
>> stub if it's not. As long as we create stubs in the same order as the
>> branches, it should always be possible for a branch to reach its stub,
>> regardless of the size of the stub table.
> That might work, but I reckon the complication isn't worth the
Another idea would be to automatically reduce the stub group size and
run another relaxation pass.
>> Also, I noted that using the default options, the stub group size is
>> set much smaller if we find 14-bit relocations in a section, but if
>> you set --stub-group-size, that's the size we use regardless. Would it
>> make sense to set stub14_group_size proportionally to stub_group_size,
>> or to provide a separate option?
> I've thought about doing that before, but didn't bother due to the
> fact that compiled code never makes use of 14-bit branches to external
> symbols. So the 14-bit support is there just for assembly code.
> However, it's easy to make them proportional..
Yeah, I figured 14-bit branches to external symbols were rare.