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

Comments

Projects
None yet
4 participants
@rsc
Copy link
Contributor

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

This comment has been minimized.

Copy link
Contributor Author

commented Jan 21, 2019

@aclements

This comment has been minimized.

Copy link
Member

commented Jan 22, 2019

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

@gopherbot

This comment has been minimized.

Copy link

commented Jan 28, 2019

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

@gopherbot gopherbot closed this in 66065c3 Jan 29, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.