attr

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 7, 2024 License: BSD-3-Clause Imports: 3 Imported by: 6

Documentation

Overview

Package attr provides attributes for text and data sections.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attribute

type Attribute uint16

Attribute represents TEXT or DATA flags.

const (
	// Don't profile the marked routine. This flag is deprecated.
	NOPROF Attribute = 1

	// It is ok for the linker to get multiple of these symbols. It will
	// pick one of the duplicates to use.
	DUPOK Attribute = 2

	// Don't insert stack check preamble.
	NOSPLIT Attribute = 4

	// Put this data in a read-only section.
	RODATA Attribute = 8

	// This data contains no pointers.
	NOPTR Attribute = 16

	// This is a wrapper function and should not count as disabling 'recover'.
	WRAPPER Attribute = 32

	// This function uses its incoming context register.
	NEEDCTXT Attribute = 64

	// Allocate a word of thread local storage and store the offset from the
	// thread local base to the thread local storage in this variable.
	TLSBSS Attribute = 256

	// Do not insert instructions to allocate a stack frame for this function.
	// Only valid on functions that declare a frame size of 0.
	NOFRAME Attribute = 512

	// Function can call reflect.Type.Method or reflect.Type.MethodByName.
	REFLECTMETHOD Attribute = 1024

	// Function is the top of the call stack. Call stack unwinders should stop
	// at this function.
	TOPFRAME Attribute = 2048
)

Attribute values defined in textflag.h.

func (Attribute) Asm

func (a Attribute) Asm() string

Asm returns a representation of the attributes in assembly syntax. This may use macros from "textflags.h"; see ContainsTextFlags() to determine if this header is required.

func (Attribute) ContainsTextFlags

func (a Attribute) ContainsTextFlags() bool

ContainsTextFlags returns whether the Asm() representation requires macros in "textflags.h".

func (Attribute) DUPOK added in v0.2.0

func (a Attribute) DUPOK() bool

DUPOK reports whether the DUPOK flag is set.

func (Attribute) NEEDCTXT added in v0.2.0

func (a Attribute) NEEDCTXT() bool

NEEDCTXT reports whether the NEEDCTXT flag is set.

func (Attribute) NOFRAME added in v0.2.0

func (a Attribute) NOFRAME() bool

NOFRAME reports whether the NOFRAME flag is set.

func (Attribute) NOPROF added in v0.2.0

func (a Attribute) NOPROF() bool

NOPROF reports whether the NOPROF flag is set.

func (Attribute) NOPTR added in v0.2.0

func (a Attribute) NOPTR() bool

NOPTR reports whether the NOPTR flag is set.

func (Attribute) NOSPLIT added in v0.2.0

func (a Attribute) NOSPLIT() bool

NOSPLIT reports whether the NOSPLIT flag is set.

func (Attribute) REFLECTMETHOD added in v0.2.0

func (a Attribute) REFLECTMETHOD() bool

REFLECTMETHOD reports whether the REFLECTMETHOD flag is set.

func (Attribute) RODATA added in v0.2.0

func (a Attribute) RODATA() bool

RODATA reports whether the RODATA flag is set.

func (Attribute) TLSBSS added in v0.2.0

func (a Attribute) TLSBSS() bool

TLSBSS reports whether the TLSBSS flag is set.

func (Attribute) TOPFRAME added in v0.2.0

func (a Attribute) TOPFRAME() bool

TOPFRAME reports whether the TOPFRAME flag is set.

func (Attribute) WRAPPER added in v0.2.0

func (a Attribute) WRAPPER() bool

WRAPPER reports whether the WRAPPER flag is set.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL