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: inconsistent handling of explicit zero offset for TEXT pseudo #30968

Closed
benjaminp opened this issue Mar 21, 2019 · 5 comments
Closed
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@benjaminp
Copy link
Contributor

cmd/asm in Go 1.12.1 and before willingly assembles

TEXT ·MyFunc+0(SB), $0

However, cmd/asm in -gensymabis mode doesn't recognize this line as a definition. That leads to esoteric symbol ABI errors during linking on Go 1.12.

Either offset for the TEXT pseudo should be fully banned or -gensymabis should handle explicit zero offsets.

@benjaminp benjaminp changed the title cmd/asm: inconsistent handling of explicit zero 0 offset on TEXT sudo cmd/asm: inconsistent handling of explicit zero 0 offset on TEXT pseudo Mar 21, 2019
@benjaminp benjaminp changed the title cmd/asm: inconsistent handling of explicit zero 0 offset on TEXT pseudo cmd/asm: inconsistent handling of explicit zero offset for TEXT pseudo Mar 21, 2019
@josharian
Copy link
Contributor

cc @aclements @robpike

@ALTree ALTree added this to the Go1.13 milestone Mar 21, 2019
@ALTree ALTree added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Mar 21, 2019
@cherrymui
Copy link
Member

I would guess that accepting +0 offset was not intentional. Maybe we should just reject it.

@robpike
Copy link
Contributor

robpike commented Mar 22, 2019

It was certainly intentional. The first example in the assembly document has that form, and that output came from a compiler. I don't think it should be rejected and there's nothing wrong with it.

@gopherbot
Copy link

Change https://golang.org/cl/174537 mentions this issue: cmd/asm: accept TEXT f+0(SB) in -gensymabis mode

@gopherbot
Copy link

Change https://golang.org/cl/175757 mentions this issue: doc: update /doc/asm compiler output example

gopherbot pushed a commit that referenced this issue May 8, 2019
The compiler output shown in the doc is now quite old
(most of the changes happened in Go 1.5).
Update it to be more like what users will actually see.

Also explain how to get literal machine code again.

Prompted by #30968.

Change-Id: I0ce139c3fe299ccc43e85b6aca81c6e0aac1a2df
Reviewed-on: https://go-review.googlesource.com/c/go/+/175757
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
@golang golang locked and limited conversation to collaborators May 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

6 participants