{"record":{"id":"01e0195247071e3e","repo":"wasmerio/wasmer","slug":"dwarf-relocation-size-not-yet-supported-01e019","errorCode":null,"errorMessage":"dwarf relocation size not yet supported: {}","messagePattern":"dwarf relocation size not yet supported: (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"lib/compiler-singlepass/src/dwarf.rs","lineNumber":76,"sourceCode":"    }\n\n    fn write_at(&mut self, offset: usize, bytes: &[u8]) -> Result<()> {\n        self.writer.write_at(offset, bytes)\n    }\n\n    fn write_address(&mut self, address: Address, size: u8) -> Result<()> {\n        match address {\n            Address::Constant(val) => self.write_udata(val, size),\n            Address::Symbol { symbol, addend } => {\n                // Is a function relocation\n                if symbol == Self::FUNCTION_SYMBOL {\n                    // We use the addend to detect the function index\n                    let function_index = LocalFunctionIndex::new(addend as _);\n                    let reloc_target = RelocationTarget::LocalFunc(function_index);\n                    let offset = self.len() as u32;\n                    let kind = match size {\n                        8 => RelocationKind::Abs8,\n                        _ => unimplemented!(\"dwarf relocation size not yet supported: {}\", size),\n                    };\n                    let addend = 0;\n                    self.relocs.push(Relocation {\n                        kind,\n                        reloc_target,\n                        offset,\n                        addend,\n                    });\n                    self.write_udata(addend as u64, size)\n                } else {\n                    unreachable!(\"Symbol {} in DWARF not recognized\", symbol);\n                }\n            }\n        }\n    }\n\n    fn write_offset(&mut self, _val: usize, _section: SectionId, _size: u8) -> Result<()> {\n        unimplemented!(\"write_offset not yet implemented\");","sourceCodeStart":58,"sourceCodeEnd":94,"githubUrl":"https://github.com/wasmerio/wasmer/blob/8c4b9ee9d33fb2068863fbb3d328683e7e6ff7f5/lib/compiler-singlepass/src/dwarf.rs#L58-L94","documentation":"The singlepass backend's DWARF writer only implements 8-byte absolute relocations (Abs8) when emitting eh_frame pointers to local functions (the addend encodes the function index); any other size panics with unimplemented!().","triggerScenarios":"Generating unwind/DWARF info with the singlepass compiler when write_address is called with a size other than 8 for a local-function symbol pointer.","commonSituations":"Compiling with singlepass on a 32-bit target or with an eh-frame encoding that requests 4-byte pointers; generating debug info with singlepass on unusual hosts.","solutions":["Compile with singlepass on 64-bit targets (x86_64/aarch64) where 8-byte pointers are used","Use the cranelift or LLVM backend if you need broader DWARF/eh-frame support","Disable unwind-info/EH generation for singlepass","Update Wasmer in case the size support has been extended"],"exampleFix":"// before\nlet kind = match size {\n    8 => RelocationKind::Abs8,\n    _ => unimplemented!(\"dwarf relocation size not yet supported: {}\", size),\n};\n// after\nlet kind = match size {\n    8 => RelocationKind::Abs8,\n    4 => RelocationKind::Abs4,\n    other => return Err(CompileError::Codegen(format!(\"unsupported dwarf reloc size: {}\", other))),\n};","handlingStrategy":"validation","validationCode":"// singlepass DWARF relocations require 8-byte (64-bit) targets\nfn singlepass_dwarf_supported(triple: &Triple) -> bool {\n    matches!(triple.architecture,\n        Architecture::X86_64 | Architecture::Aarch64(_))\n}","typeGuard":"fn is_size8(size: u8) -> bool { size == 8 }","tryCatchPattern":null,"preventionTips":["Use singlepass only on 64-bit mainstream targets when generating unwind info","Prefer cranelift/LLVM elsewhere","Disable debug/EH generation with singlepass on unsupported hosts","Keep singlepass and target combinations covered by CI"],"tags":["rust","singlepass","dwarf","unimplemented"],"backgroundTag":"unimplemented-dwarf-relocation","analyzedSha":"8c4b9ee9d33fb2068863fbb3d328683e7e6ff7f5","analyzedAt":"2026-09-01T23:06:31.009Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}