Commit 7aa68756 authored by Shenghou Ma's avatar Shenghou Ma Committed by Minux Ma

doc/asm: document that assembly function must use short name

e.g. ·Name instead of package·Name for automatic stack map to
be applied from its Go prototype.

The underlying reason is that liblink look up name with suffix
".args_stackmap" for the stackmap coming from its Go prototype,
but all the Go functions are named "".Name as this stage. Thus
an assembly function named package·Name will never find its
stackmap, which is named "".package.Name.args_stackmap.

Perhaps cmd/vet should give a warning for this.

Change-Id: I10d154a73ec969d574d20af877f747424350fbd1
Reviewed-on: https://go-review.googlesource.com/2588Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
parent 788f78ad
...@@ -350,7 +350,11 @@ live pointers in its arguments, results, and local stack frame. ...@@ -350,7 +350,11 @@ live pointers in its arguments, results, and local stack frame.
For an assembly function with no pointer results and For an assembly function with no pointer results and
either no local stack frame or no function calls, either no local stack frame or no function calls,
the only requirement is to define a Go prototype for the function the only requirement is to define a Go prototype for the function
in a Go source file in the same package. in a Go source file in the same package. The name of the assembly
function must not contain the package name component (for example,
function <code>Syscall</code> in package <code>syscall</code> should
use the name <code>·Syscall</code> instead of the equivalent name
<code>syscall·Syscall</code> in its <code>TEXT</code> directive).
For more complex situations, explicit annotation is needed. For more complex situations, explicit annotation is needed.
These annotations use pseudo-instructions defined in the standard These annotations use pseudo-instructions defined in the standard
<code>#include</code> file <code>funcdata.h</code>. <code>#include</code> file <code>funcdata.h</code>.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment