-
Notifications
You must be signed in to change notification settings - Fork 18k
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
cmd/link: missing arg stack map for functions defined in different package #24419
Comments
Ok, for normal assembly functions, the obj package will insert a FUNCDATA which refers to the args_stackmap generated by the compiler from the Go declaration. Maybe we can make the obj package also insert FUNCDATA for functions not defined in the same package as the declaration? Or the assembly writer is expected to write a |
I'd rather avoid the What happens if we just remove the Maybe we could restrict to functions which have a declaration but no body. I'm not sure whether we have that bit in the data exported from a package, though. |
This doesn't work, since not all assembly functions have Go declarations. For them, it will result in undefined relocation targets at link time. I tried restricting to only functions whose name has a ".", but still some functions don't have Go declarations. Maybe we can establish a convention that if a function doesn't have Go declaration (therefore cannot be called from Go), it should not have "." (written as "·" in assembly source code) in its name? We could fix up the exceptions in std, but not sure what to do with code outside our repo. |
Can we restrict to exported functions? I think it would be reasonable to require that exported assembly functions have Go declarations. In fact, I don't think it would work otherwise (unless assembly was calling assembly?). |
I may be misunderstanding, but doesn't this also require that the assembly routine be implemented in a different package than its Go declaration? I'm okay with saying that end users don't get to do that. |
@aclements Yes, I guess that's true. |
Change https://golang.org/cl/122519 mentions this issue: |
My patch didn't quite work, due to shared libraries. Adding something like:
to the |
Change https://golang.org/cl/122676 mentions this issue: |
What version of Go are you using (
go version
)?tip (86a3389)
Does this issue reproduce with the latest release?
yes
What did you do?
https://play.golang.org/p/4-OeiC68PO4
The stack map of
bytes.Compare
is missing.The compiler does generate the stack map
But it doesn't make into the binary. Apparently the linker dropped it on the floor?
This doesn't seem to be the case for assembly function defined in the same package.
The text was updated successfully, but these errors were encountered: