PPC gold doesn't check for overflow properly

Cary Coutant ccoutant@google.com
Thu Nov 20 18:33:00 GMT 2014

>> 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
> benefit.

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.


More information about the Binutils mailing list