golang/go · info

unknown load address

Error message

unknown load address

What it means

plan9File.loadAddress() unconditionally returns 'unknown load address'. A Plan 9 a.out does not encode a recoverable fixed load base the way PE/ELF do, so the loader declines rather than fabricate one. Callers that need a base must use textStart from text() instead.

Source

Thrown at src/cmd/internal/objfile/plan9obj.go:145

	}
	textStart := f.LoadAddress + f.HdrSize
	return data[ssym.Value-textStart : esym.Value-textStart], nil
}

func (f *plan9File) goarch() string {
	switch f.plan9.Magic {
	case plan9obj.Magic386:
		return "386"
	case plan9obj.MagicAMD64:
		return "amd64"
	case plan9obj.MagicARM:
		return "arm"
	}
	return ""
}

func (f *plan9File) loadAddress() (uint64, error) {
	return 0, fmt.Errorf("unknown load address")
}

func (f *plan9File) dwarf() (*dwarf.Data, error) {
	return nil, errors.New("no DWARF data in Plan 9 file")
}

View on GitHub (pinned to b6b368adc5)

Solutions

  1. Do not rely on loadAddress for Plan 9; use the textStart value returned from text().
  2. Handle this specific error as non-fatal in the caller.
Defensive patterns

Strategy: type-guard

Type guard

// Plan 9 has no recoverable load address; detect the backend and skip loadAddress.
// switch pf.(type) {
// case *plan9File:
//     // use textStart from text() instead
// default:
//     base, err = pf.loadAddress()
// }

Try / catch

// base, err := pf.loadAddress()
// if err != nil && err.Error() == "unknown load address" {
//     // expected for plan9; fall back to textStart
// }

Prevention

When it happens

Trigger: Any call to plan9File.loadAddress() — this is a permanent limitation of the Plan 9 backend, not a recoverable runtime condition.

Common situations: A tool that uniformly calls loadAddress on every backend will always see this error for Plan 9 binaries. It is expected behavior, not a defect.

Related errors


AI-assisted analysis of golang/go@b6b368adc5 (2026-08-12). Data as JSON: /api/errors/3a789e227acb7db7. Report an issue: GitHub.