vdso

package
v0.0.0-...-e2b2867 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2020 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Overview

Package vdso provides the binary level virtual dynamic shared object (vDSO).

Index

Constants

View Source
const (
	// ArrayMax is the byte-size of a maximally sized array on this architecture.
	ArrayMax = 1<<50 - 1

	// Maximum indices for the array types used when traversing the vDSO ELF structures.
	SymTabSize     = ArrayMax / unsafe.Sizeof(elfdef.Sym{})
	DynSize        = ArrayMax / unsafe.Sizeof(elfdef.Dyn{})
	SymStringsSize = ArrayMax     // byte
	VerSymSize     = ArrayMax / 2 // uint16
	HashSize       = ArrayMax / 4 // uint32

	// BloomSizeScale is a scaling factor for gnuhash tables which are uint32 indexed, but contain uintptrs.
	BloomSizeScale = unsafe.Sizeof(uintptr(0)) / 4 // uint32
)

Variables

View Source
var (
	GettimeofdaySym uintptr = 0xffffffffff600000
	ClockgettimeSym uintptr = 0
)

initialize with vsyscall fallbacks.

View Source
var LinuxVersion = VersionKey{"LINUX_2.6", 0x3ae75f6}

LinuxVersion version of Linux Kernel in vDSO object.

View Source
var SymbolKeys = []SymbolKey{
	{"__vdso_gettimeofday", 0x315ca59, 0xb01bca00, &GettimeofdaySym},
	{"__vdso_clock_gettime", 0xd35ec75, 0x6e43a318, &ClockgettimeSym},
}

SymbolKeys is the Linux amd64 vDSO symbol keys.

Functions

func Auxv

func Auxv(tag, val uintptr)

Auxv parses auxv by tag and allocate elfdef.Header to val.

func FindVersion

func FindVersion(vdso *VDSO, ver *VersionKey) int32

FindVersion finds version from vDSO.

func InVDSOPage

func InVDSOPage(pc uintptr) bool

InVDSOPage reports whether the pc is on the VDSO page.

func InitFromSysinfoELFHeader

func InitFromSysinfoELFHeader(vdso *VDSO, hdr *elfdef.Header)

InitFromSysinfoELFHeader init vDSO from hdr.

func ParseSymbols

func ParseSymbols(vdso *VDSO, version int32)

ParseSymbols parses and allocates symbols from vDSO.

Types

type SymbolKey

type SymbolKey struct {
	Name    string
	SymHash uint32
	GnuHash uint32
	Ptr     *uintptr
}

SymbolKey represents a vDSO symbol key entries.

type VDSO

type VDSO struct {
	Valid bool

	// Load information
	LoadAddr   uintptr
	LoadOffset uintptr // LoadAddr - recorded vaddr

	// Symbol table
	Symtab     *[SymTabSize]elfdef.Sym
	Symstrings *[SymStringsSize]byte
	Chain      []uint32
	Bucket     []uint32
	SymOff     uint32
	IsGNUHash  bool

	// Version table
	Versym *[VerSymSize]uint16
	Verdef *elfdef.Verdef
}

VDSO represents a vDSO object.

type VersionKey

type VersionKey struct {
	Version string
	VerHash uint32
}

VersionKey represents a vDSO Version key entries.

Directories

Path Synopsis
Package elfdef prodives the ELF64 structure definitions for use by the vDSO loader.
Package elfdef prodives the ELF64 structure definitions for use by the vDSO loader.

Jump to

Keyboard shortcuts

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