-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/link: SDYNIMPORT on arm results in incorrect assembly #40769
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Seems to reproduce with |
Is this new on tip (with the merge of the new linker), or it was wrong before as well? As Is it for ARM (32-bit) or ARM64? I saw both mentioned in the original post. (The disassembly looks like ARM32.) |
I'm reproducing with I see similar |
I think CL https://go-review.googlesource.com/c/go/+/248399 fixes it. It is related to issue #19811, which I really hate... |
Change https://golang.org/cl/248399 mentions this issue: |
I should have mentioned that this is the same with 1.13.9, so I do not believe it is a regression.
Apologies - that should have been ARM32 ( |
It does indeed, thanks (I was looking at the correct line of code, but failed to spot the obvious fix!) The disassembly now gives:
And executes correctly.
Indeed, that is quite ugly and error prone. |
What version of Go are you using (
go version
)?What did you do?
Building the following code for
openbsd/arm
(and presumably any ELFGOARCH=arm
):Results in a binary that decompiles to the following assembly:
In particular, note that the
main.trampoline
function contains anandeq
instruction where abl
instruction would be expected. What I believe is happening is that theCALL
is being replaced with a PLT and my current guess is that the actual instruction opcode is either not being included or is being being wiped in the process. I would think that the00000019
value is specifying the offset to the PLT entry, however should have a0xeb
for the first byte in order to make this abl
instruction.The text was updated successfully, but these errors were encountered: