From ec5dc3384e8f9f1c3b651caacd733249ec166e78 Mon Sep 17 00:00:00 2001 From: Lars T Hansen Date: Fri, 7 Jun 2019 14:37:58 +0200 Subject: [PATCH] Handle Reloc::X86PCRelRodata4 in sundry reloc_jt --- cranelift/faerie/src/backend.rs | 12 ++++++++++-- cranelift/simplejit/src/backend.rs | 12 ++++++++++-- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/cranelift/faerie/src/backend.rs b/cranelift/faerie/src/backend.rs index 9313ddaae9..29f3c0480d 100644 --- a/cranelift/faerie/src/backend.rs +++ b/cranelift/faerie/src/backend.rs @@ -413,7 +413,15 @@ impl<'a> RelocSink for FaerieRelocSink<'a> { .expect("faerie relocation error"); } - fn reloc_jt(&mut self, _offset: CodeOffset, _reloc: Reloc, _jt: ir::JumpTable) { - unimplemented!(); + fn reloc_jt(&mut self, _offset: CodeOffset, reloc: Reloc, _jt: ir::JumpTable) { + match reloc { + Reloc::X86PCRelRodata4 => { + // Not necessary to record this unless we are going to split apart code and its + // jumptbl/rodata. + } + _ => { + panic!("Unhandled reloc"); + } + } } } diff --git a/cranelift/simplejit/src/backend.rs b/cranelift/simplejit/src/backend.rs index 81b44459ec..3786e3e964 100644 --- a/cranelift/simplejit/src/backend.rs +++ b/cranelift/simplejit/src/backend.rs @@ -533,7 +533,15 @@ impl RelocSink for SimpleJITRelocSink { }); } - fn reloc_jt(&mut self, _offset: CodeOffset, _reloc: Reloc, _jt: ir::JumpTable) { - unimplemented!(); + fn reloc_jt(&mut self, _offset: CodeOffset, reloc: Reloc, _jt: ir::JumpTable) { + match reloc { + Reloc::X86PCRelRodata4 => { + // Not necessary to record this unless we are going to split apart code and its + // jumptbl/rodata. + } + _ => { + panic!("Unhandled reloc"); + } + } } }