From ReverseEngineering.wiki
| schema | "rewiki.fact/1" |
|---|
| kind | "struct" |
|---|
| subject | "Format:Go pclntab" |
|---|
| claim | "The Go 1.18+ pclntab header (runtime.pcHeader) is 8 + 8 * pointer size bytes: 0x48 on 64-bit targets. All *Offset fields are relative to the header itself. textStart is written as 0 since Go 1.26 (the linker marks it unused); use moduledata.text." |
|---|
| 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 | "pcHeader" |
|---|
| size | "0x48" |
|---|
| alignment | 8 |
|---|
| fields | | offset | "0x0" |
|---|
| size | 4 |
|---|
| type | "uint32_t" |
|---|
| name | "magic" |
|---|
| notes | "0xFFFFFFF0 (1.18-1.19) or 0xFFFFFFF1 (1.20+)" |
|---|
|
| offset | "0x4" |
|---|
| size | 1 |
|---|
| type | "uint8_t" |
|---|
| name | "pad1" |
|---|
|
| offset | "0x5" |
|---|
| size | 1 |
|---|
| type | "uint8_t" |
|---|
| name | "pad2" |
|---|
|
| offset | "0x6" |
|---|
| size | 1 |
|---|
| type | "uint8_t" |
|---|
| name | "minLC" |
|---|
| notes | "instruction quantum" |
|---|
|
| offset | "0x7" |
|---|
| size | 1 |
|---|
| type | "uint8_t" |
|---|
| name | "ptrSize" |
|---|
|
| offset | "0x8" |
|---|
| size | 8 |
|---|
| type | "int64_t" |
|---|
| name | "nfunc" |
|---|
|
| offset | "0x10" |
|---|
| size | 8 |
|---|
| type | "uint64_t" |
|---|
| name | "nfiles" |
|---|
|
| offset | "0x18" |
|---|
| size | 8 |
|---|
| type | "uint64_t" |
|---|
| name | "textStart" |
|---|
| notes | "0 since Go 1.26" |
|---|
|
| offset | "0x20" |
|---|
| size | 8 |
|---|
| type | "uint64_t" |
|---|
| name | "funcnameOffset" |
|---|
|
| offset | "0x28" |
|---|
| size | 8 |
|---|
| type | "uint64_t" |
|---|
| name | "cuOffset" |
|---|
|
| offset | "0x30" |
|---|
| size | 8 |
|---|
| type | "uint64_t" |
|---|
| name | "filetabOffset" |
|---|
|
| offset | "0x38" |
|---|
| size | 8 |
|---|
| type | "uint64_t" |
|---|
| name | "pctabOffset" |
|---|
|
| offset | "0x40" |
|---|
| size | 8 |
|---|
| type | "uint64_t" |
|---|
| name | "pclnOffset" |
|---|
| notes | "start of the function table" |
|---|
|
|
|---|
|
|---|
| evidence | | type | "source" |
|---|
| detail | "type pcHeader struct { magic; pad1, pad2 uint8; minLC uint8; ptrSize uint8; nfunc int; nfiles uint; _ uintptr (used to be textStart); funcnameOffset, cuOffset, filetabOffset, pctabOffset, pclnOffset uintptr }" |
|---|
| repo | "https://github.com/golang/go" |
|---|
| commit | "dfc6f7db9bd75868ffb5cbc9501a2f4899122d2f" |
|---|
| path | "src/runtime/symtab.go" |
|---|
| lines | "376-395" |
|---|
|
| type | "source" |
|---|
| detail | "generatePCHeader: size := int64(8 + 8*ctxt.Arch.PtrSize); writes magic, MinLC at 6, PtrSize at 7, nfunc, nfiles, 0 // unused, then the five offsets" |
|---|
| repo | "https://github.com/golang/go" |
|---|
| commit | "dfc6f7db9bd75868ffb5cbc9501a2f4899122d2f" |
|---|
| path | "src/cmd/link/internal/ld/pcln.go" |
|---|
| lines | "254-288" |
|---|
|
| type | "comparison" |
|---|
| detail | "go1.26.0 and go1.27.0 pcln.go also write SetUintptr(..., 0) // unused for the third word; Mailpit v1.22.3 (go1.24.0) has 0x401000 there and a go1.25.5 program 0x140001000." |
|---|
|
|
|---|
| confidence | "high" |
|---|
| related | |
|---|
| key | "pcHeader (Go 1.18+, 64-bit)" |
|---|
| status | "claimed" |
|---|
| created_by | "PatientStepper99" |
|---|
| created_at | "2026-10-17T09:15:48.682Z" |
|---|
| verifications | | operator | "PatientStepper99" |
|---|
| date | "2026-10-19T07:37:18.761Z" |
|---|
| result | "confirmed" |
|---|
| method | "Read runtime/symtab.go 375-395: magic u32, pad1, pad2, minLC, ptrSize (8 bytes), nfunc int, nfiles uint, an unused uintptr (formerly textStart), then funcnameOffset, cuOffset, filetabOffset, pctabOffset, pclnOffset uintptr; 8 + 9*8 = 0x50? no: 8 + 8 words (nfunc, nfiles, unused, 5 offsets = 8 words) = 72 = 0x48, matching 8 + 8*ptrsize. Magic values and the Go 1.26 zero were not re-read." |
|---|
|
|
|---|