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

runtime: funcdata.h - GO_RESULTS_INITIALIZED produces a syntax error #14772

Closed
millerresearch opened this issue Mar 11, 2016 · 3 comments
Closed
Milestone

Comments

@millerresearch
Copy link
Contributor

The assembly macro GO_RESULTS_INITIALIZED (as documented in https://golang.org/doc/asm) produces a syntax error. Working in src/runtime:

cpu% cat resinit_arm.s
#include "funcdata.h"

TEXT resinit(SB),0,$0
    GO_RESULTS_INITIALIZED
    RET
cpu% go tool asm resinit_arm.s
resinit_arm.s:4: expected '(', found $
asm: assembly of resinit_arm.s failed

The definition of the macro in funcdata.h is:
#define GO_RESULTS_INITIALIZED FUNCDATA PCDATA $PCDATA_StackMapIndex, 1
Removing FUNCDATA and changing 1 to $1 makes the syntax error go away, but I haven't been able to find documentation for these pseudo instructions so this is only guesswork.

@bradfitz bradfitz changed the title go tool asm: GO_RESULTS_INITIALIZED produces a syntax error cmd/asm: GO_RESULTS_INITIALIZED produces a syntax error Mar 11, 2016
@ianlancetaylor ianlancetaylor added this to the Go1.7 milestone Mar 11, 2016
@robpike robpike assigned rsc and unassigned robpike Mar 13, 2016
@robpike
Copy link
Contributor

robpike commented Mar 13, 2016

Assigning to Russ. This is some runtime-internal magic and to the assembler it is just a black box. It is not an assembler bug, as far as I can tell.

@millerresearch millerresearch changed the title cmd/asm: GO_RESULTS_INITIALIZED produces a syntax error runtime: funcdata.h - GO_RESULTS_INITIALIZED produces a syntax error Mar 14, 2016
@millerresearch
Copy link
Contributor Author

That's right, it seems to be just a typo in funcdata.h (I've changed the issue title accordingly). Experimenting with compiler output suggests that the right definition is

#define GO_RESULTS_INITIALIZED PCDATA $PCDATA_StackMapIndex, $1

I'll offer this as a CL for Russ to check.

@gopherbot
Copy link

CL https://golang.org/cl/20680 mentions this issue.

@golang golang locked and limited conversation to collaborators Mar 14, 2017
@rsc rsc removed their assignment Jun 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants