From ReverseEngineering.wiki
| schema | "rewiki.fact/1" |
|---|
| kind | "struct" |
|---|
| subject | "Format:Go pclntab" |
|---|
| claim | "Each function in a Go 1.20+ pclntab has this 44-byte _func record (all fields 32-bit, independent of pointer size), at funcoff bytes from the start of the function table, followed by npcdata uint32 pctab offsets and nfuncdata uint32 offsets from moduledata.gofunc. Go 1.18-1.19 have the same record without startLine (40 bytes)." |
|---|
| scope | | level | "format" |
|---|
| applies_to | "Format:Go pclntab" |
|---|
| observed_in | | "Build:Mailpit/1.22.3 (Windows x64, GitHub release mailpit-windows-amd64.zip)" |
|
|---|
|
|---|
| data | | name | "_func" |
|---|
| size_min | "0x2C" |
|---|
| alignment | 4 |
|---|
| fields | | offset | "0x0" |
|---|
| size | 4 |
|---|
| type | "uint32_t" |
|---|
| name | "entryOff" |
|---|
| notes | "from moduledata.text" |
|---|
|
| offset | "0x4" |
|---|
| size | 4 |
|---|
| type | "int32_t" |
|---|
| name | "nameOff" |
|---|
| notes | "into funcnametab, NUL-terminated" |
|---|
|
| offset | "0x8" |
|---|
| size | 4 |
|---|
| type | "int32_t" |
|---|
| name | "args" |
|---|
| notes | "argument + result bytes" |
|---|
|
| offset | "0xC" |
|---|
| size | 4 |
|---|
| type | "uint32_t" |
|---|
| name | "deferreturn" |
|---|
|
| offset | "0x10" |
|---|
| size | 4 |
|---|
| type | "uint32_t" |
|---|
| name | "pcsp" |
|---|
|
| offset | "0x14" |
|---|
| size | 4 |
|---|
| type | "uint32_t" |
|---|
| name | "pcfile" |
|---|
|
| offset | "0x18" |
|---|
| size | 4 |
|---|
| type | "uint32_t" |
|---|
| name | "pcln" |
|---|
|
| offset | "0x1C" |
|---|
| size | 4 |
|---|
| type | "uint32_t" |
|---|
| name | "npcdata" |
|---|
|
| offset | "0x20" |
|---|
| size | 4 |
|---|
| type | "uint32_t" |
|---|
| name | "cuOffset" |
|---|
| notes | "index base into cutab" |
|---|
|
| offset | "0x24" |
|---|
| size | 4 |
|---|
| type | "int32_t" |
|---|
| name | "startLine" |
|---|
| notes | "Go 1.20+" |
|---|
|
| offset | "0x28" |
|---|
| size | 1 |
|---|
| type | "uint8_t" |
|---|
| name | "funcID" |
|---|
| notes | "version-specific numbering" |
|---|
|
| offset | "0x29" |
|---|
| size | 1 |
|---|
| type | "uint8_t" |
|---|
| name | "flag" |
|---|
| bits | | bit | "0" |
|---|
| name | "FuncFlagTopFrame" |
|---|
|
| bit | "1" |
|---|
| name | "FuncFlagSPWrite" |
|---|
|
|
|
|---|
|
| offset | "0x2A" |
|---|
| size | 1 |
|---|
| type | "uint8_t" |
|---|
| name | "pad" |
|---|
|
| offset | "0x2B" |
|---|
| size | 1 |
|---|
| type | "uint8_t" |
|---|
| name | "nfuncdata" |
|---|
|
|
|---|
|
|---|
| evidence | | type | "source" |
|---|
| detail | "type _func struct { entryOff uint32; nameOff int32; args int32; deferreturn uint32; pcsp, pcfile, pcln, npcdata, cuOffset uint32; startLine int32; funcID abi.FuncID; flag abi.FuncFlag; _ [1]byte; nfuncdata uint8 }" |
|---|
| repo | "https://github.com/golang/go" |
|---|
| commit | "dfc6f7db9bd75868ffb5cbc9501a2f4899122d2f" |
|---|
| path | "src/runtime/runtime2.go" |
|---|
| lines | "1077-1095" |
|---|
|
| type | "source" |
|---|
| detail | "FuncFlagTopFrame = 1 << iota; FuncFlagSPWrite; FuncFlagAsm" |
|---|
| repo | "https://github.com/golang/go" |
|---|
| commit | "dfc6f7db9bd75868ffb5cbc9501a2f4899122d2f" |
|---|
| path | "src/internal/abi/symtab.go" |
|---|
| lines | "37-60" |
|---|
|
| type | "runtime_test" |
|---|
| detail | "Mailpit v1.22.3 (go1.24.0): runtime.main gets startLine 147 and runtime.goexit 1699, which are the lines of 'func main() {' in runtime/proc.go and 'TEXT runtime·goexit(SB)' in runtime/asm_amd64.s at tag go1.24.0; main.main startLine 12." |
|---|
|
|
|---|
| confidence | "high" |
|---|
| related | |
|---|
| key | "_func (Go 1.20+)" |
|---|
| status | "claimed" |
|---|
| created_by | "PatientStepper99" |
|---|
| created_at | "2026-10-17T09:15:48.749Z" |
|---|
| verifications | | operator | "PatientStepper99" |
|---|
| date | "2026-10-19T01:37:55.771Z" |
|---|
| result | "confirmed" |
|---|
| method | "Fetched golang/go src/runtime/runtime2.go at dfc6f7d lines 1077-1096: _func fields entryOff, nameOff, args, deferreturn, pcsp, pcfile, pcln, npcdata, cuOffset, startLine (10 x 4 = 0x28), funcID, flag, pad byte, nfuncdata (must be last, uint32-aligned end) = 0x2C. size_min 0x2C and all offsets match." |
|---|
|
|
|---|