{"record":{"id":"8484b138d63ec9d8","repo":"golang/go","slug":"cannot-find-go-fipsinfo-8484b1","errorCode":null,"errorMessage":"cannot find .go.fipsinfo","messagePattern":"cannot find \\.go\\.fipsinfo","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cmd/link/internal/ld/fips140.go","lineNumber":426,"sourceCode":"\t}\n\tdefer ef.Close()\n\n\twf, err := os.OpenFile(exe, os.O_RDWR, 0)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer wf.Close()\n\n\tf, err := newFipsObj(wf, fipso)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer f.Close()\n\n\t// Find the go:fipsinfo symbol.\n\tsect := ef.Section(\".go.fipsinfo\")\n\tif sect == nil {\n\t\treturn fmt.Errorf(\"cannot find .go.fipsinfo\")\n\t}\n\n\tdata, err := sect.Data()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tuptr := ctxt.Arch.ByteOrder.Uint64\n\tif ctxt.Arch.PtrSize == 4 {\n\t\tuptr = func(x []byte) uint64 {\n\t\t\treturn uint64(ctxt.Arch.ByteOrder.Uint32(x))\n\t\t}\n\t}\n\n\t// Add the sections listed in go:fipsinfo to the FIPS object.\n\t// We expect R_zzz_RELATIVE relocations where the zero-based\n\t// values are already stored in the data. That is, the addend\n\t// is in the data itself in addition to being in the relocation tables.","sourceCodeStart":408,"sourceCodeEnd":444,"githubUrl":"https://github.com/golang/go/blob/b6b368adc57c96c3151d224d172029f233ead2c3/src/cmd/link/internal/ld/fips140.go#L408-L444","documentation":"During ELF (Linux) FIPS 140 post-link processing, the linker opens the linked executable and looks for the .go.fipsinfo section using elf.File.Section(\".go.fipsinfo\"). If this section is absent, the FIPS info data was not emitted during compilation or was stripped.","triggerScenarios":"The elffips function calls ef.Section(\".go.fipsinfo\") on the opened ELF binary. If the return is nil (section not found), the error is returned. This section should contain the FIPS info structure emitted by the Go compiler when FIPS support is active.","commonSituations":"FIPS post-linking runs but compilation did not emit the section (GOFIPS not set); section stripped by external tools (strip, objcopy) or -ldflags='-s'; mixing object files from different Go versions; using a Go version without FIPS compilation support.","solutions":["Ensure FIPS is enabled at compile time: GOFIPS=1 go build","Do not strip the binary with -s, -w, or external strip tools when FIPS is required","Verify all packages use the same FIPS-enabled Go toolchain","Clean rebuild: go clean -cache && GOFIPS=1 go build","Confirm Go version supports FIPS for Linux/ELF (1.24+)"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Before FIPS post-link, verify the ELF section exists\nfunc verifyELFFipsInfo(exe string) error {\n    f, err := elf.Open(exe)\n    if err != nil {\n        return err\n    }\n    defer f.Close()\n    if f.Section(\".go.fipsinfo\") == nil {\n        return fmt.Errorf(\"binary lacks .go.fipsinfo — was FIPS enabled at compile time?\")\n    }\n    return nil\n}","typeGuard":null,"tryCatchPattern":"// Handle missing FIPS section with actionable guidance\nsect := ef.Section(\".go.fipsinfo\")\nif sect == nil {\n    return fmt.Errorf(\"cannot find .go.fipsinfo (rebuild with GOFIPS=1, do not use -s/-w)\")\n}","preventionTips":["Enable FIPS at compile time: GOFIPS=1 go build","Do not use -ldflags='-s' or '-w' when FIPS verification is needed","Ensure consistent Go toolchain versions across all packages","Verify Go version supports FIPS for Linux/ELF (1.24+)"],"tags":["fips","fips140","elf","linker","go-toolchain","linux"],"analyzedSha":"b6b368adc57c96c3151d224d172029f233ead2c3","analyzedAt":"2026-08-12T00:22:02.250Z","schemaVersion":2},"datasetVersion":"2026-08-12T08:17:17.861Z"}