[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug#649241: binutils: Either gas or ld is doing the wrong thing with R_SPARC_WDISP22 relocations on sparc



Control: retitle -1 binutils: ld should give an error for WDISP relocations against preemptible symbols
Control: severity -1 normal

On Fri, Apr 28, 2017 at 10:21:25PM +0100, James Clarke wrote:
>  2. Perhaps new R_SPARC_WPLT{10,16,19,22} should be introduced to allow
>     shorter tail-call sequences like this? Glancing at bfd it should be
>     fairly straightforward, and I imagine the same is true for gold.

So I went ahead and implemented this in bfd/gas/gold, and I now see why
it hasn't been done before. The default linker script for bfd (though
not for gold) puts the PLT too far away from the .text section to be
reachable with a WPLT{10,16,19} (even with gold WPLT10 overflows). That
leaves only the deprecated V8 branches which have a hope of reaching the
PLT. I don't think it's worth doing it just for these, and in fact,
branches on other architectures can't be used to jump to preemptible
functions either, so it would be more surprising if this *did* work.
Therefore I think the only bug here is that ld does not give any errors.

Regards,
James


Reply to: