Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
cmd/link: incorrect offset generated for indirect calls on amd64 #15609
Please answer these questions before submitting your issue. Thanks!
Upon closer inspection, I noticed that the offset in the call instruction is wrong. In particular, it's an absolute value instead of being relative to PC. Here's the generated code for main.jump:
So instead of reading from
This was broken in 1.5 and 1.6, which use the new assembler. I don't know how to write this instruction with the old assembler, so I don't know whether it was broken then.
There is a reasonably easy workaround:
I think 1.8 is the right target. We could consider a clearly correct fix for 1.7 but I don't see the CL that was sent out as clearly correct.