{"record":{"id":"7f2c55898592760f","repo":"golang/go","slug":"s-unknown-relocation-type-d-compiled-without","errorCode":null,"errorMessage":"%s: unknown relocation type %d; compiled without -fpic?","messagePattern":"(.+?): unknown relocation type (.+?); compiled without -fpic\\?","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cmd/link/internal/loadelf/ldelf.go","lineNumber":1021,"sourceCode":"\t// once golang.org/issue/15164 is fixed or found to not impair cmd/link\n\t// performance.\n\n\tconst (\n\t\tAMD64   = uint32(sys.AMD64)\n\t\tARM     = uint32(sys.ARM)\n\t\tARM64   = uint32(sys.ARM64)\n\t\tI386    = uint32(sys.I386)\n\t\tLOONG64 = uint32(sys.Loong64)\n\t\tMIPS    = uint32(sys.MIPS)\n\t\tMIPS64  = uint32(sys.MIPS64)\n\t\tPPC64   = uint32(sys.PPC64)\n\t\tRISCV64 = uint32(sys.RISCV64)\n\t\tS390X   = uint32(sys.S390X)\n\t)\n\n\tswitch uint32(arch.Family) | elftype<<16 {\n\tdefault:\n\t\treturn 0, 0, fmt.Errorf(\"%s: unknown relocation type %d; compiled without -fpic?\", pn, elftype)\n\n\tcase MIPS | uint32(elf.R_MIPS_HI16)<<16,\n\t\tMIPS | uint32(elf.R_MIPS_LO16)<<16,\n\t\tMIPS | uint32(elf.R_MIPS_GOT16)<<16,\n\t\tMIPS | uint32(elf.R_MIPS_GOT_HI16)<<16,\n\t\tMIPS | uint32(elf.R_MIPS_GOT_LO16)<<16,\n\t\tMIPS | uint32(elf.R_MIPS_GPREL16)<<16,\n\t\tMIPS | uint32(elf.R_MIPS_GOT_PAGE)<<16,\n\t\tMIPS | uint32(elf.R_MIPS_JALR)<<16,\n\t\tMIPS | uint32(elf.R_MIPS_GOT_OFST)<<16,\n\t\tMIPS64 | uint32(elf.R_MIPS_HI16)<<16,\n\t\tMIPS64 | uint32(elf.R_MIPS_LO16)<<16,\n\t\tMIPS64 | uint32(elf.R_MIPS_GOT16)<<16,\n\t\tMIPS64 | uint32(elf.R_MIPS_GOT_HI16)<<16,\n\t\tMIPS64 | uint32(elf.R_MIPS_GOT_LO16)<<16,\n\t\tMIPS64 | uint32(elf.R_MIPS_GPREL16)<<16,\n\t\tMIPS64 | uint32(elf.R_MIPS_GOT_PAGE)<<16,\n\t\tMIPS64 | uint32(elf.R_MIPS_JALR)<<16,","sourceCodeStart":1003,"sourceCodeEnd":1039,"githubUrl":"https://github.com/golang/go/blob/b6b368adc57c96c3151d224d172029f233ead2c3/src/cmd/link/internal/loadelf/ldelf.go#L1003-L1039","documentation":"Error \"%s: unknown relocation type %d; compiled without -fpic?\" thrown in golang/go.","triggerScenarios":"Thrown at src/cmd/link/internal/loadelf/ldelf.go:1021 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"b6b368adc57c96c3151d224d172029f233ead2c3","analyzedAt":"2026-08-12T00:22:02.250Z","schemaVersion":2},"datasetVersion":"2026-08-12T06:17:24.410Z"}