Skip to content
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/asm: bad error about ABI0 #29852

Closed
rsc opened this issue Jan 21, 2019 · 3 comments
Closed

cmd/asm: bad error about ABI0 #29852

rsc opened this issue Jan 21, 2019 · 3 comments
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@rsc
Copy link
Contributor

rsc commented Jan 21, 2019

I tried to refer to zero<>(SB) as a memory operand without defining that symbol.
The error was:

myfunc: relocation target zero not defined for ABI0 (but is defined for ABI0)

It should have been more like 'zero not defined' (period).

@rsc
Copy link
Contributor Author

rsc commented Jan 21, 2019

/cc @aclements

@aclements
Copy link
Member

Interesting. This happens because the symbol is both static and named "zero". If you change the name to, say, "zeroxxx<>", you get the right error message. It seems that runtime.a contains a reference to (though not a definition of) a symbol named "zero" with ABI0, which causes zero to be entered in the symbol table with ABI0. The code that looks for alternative ABI symbols finds that symbol in the symbol table, but doesn't check that it's actually defined, which is where the "but is defined for ABI0" comes from. The "not defined for ABI0" is because the same code failed to turn the static symbol's version back into an ABI, and it happened to print the zero value for an ABI.

I'll send a fix shortly.

@aclements aclements self-assigned this Jan 22, 2019
@aclements aclements added this to the Go1.12 milestone Jan 22, 2019
@FiloSottile FiloSottile added the NeedsFix The path to resolution is known, but the work has not been done. label Jan 23, 2019
@gopherbot
Copy link

Change https://golang.org/cl/159518 mentions this issue: cmd/link: fix confusing error on unresolved symbol

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

4 participants