User Tools

Site Tools


This is an old revision of the document!

Table of Contents


A flag for the “ld” linker, with special link-time information about a function.

textflag 7

Extracted from a comment in pkg/runtime/proc.c:

* Newproc and deferproc need to be textflag 7 * (no possible stack split when nearing overflow)

See split stacks.


In “cc” C, add a pragma directive before the function definition – example:

#pragma textflag 7
somefunction(int x, int y)

In “asm” assembly, put the number 7 in function's entry point definition line – example:

TEXT runtime·tstart(SB),7,$0

Note: These C and assembly syntaxes are supported only by the C compilers and assemblers shipped with Go (i.e. the modified Plan 9 ones). Stock Gcc does not have the ability to set these flags (but maybe a Gcc with gccgo integrated in it can?)

go/internals/textflag.1551696591.txt.gz · Last modified: 2020/11/23 17:23 (external edit)