Add stubs for constant relocation in RelocSink

This commit is contained in:
Andrew Brown
2019-07-29 13:09:25 -07:00
committed by Dan Gohman
parent 364300f6cf
commit bb0a443747
2 changed files with 19 additions and 0 deletions

View File

@@ -72,6 +72,17 @@ impl binemit::RelocSink for RelocSink {
addend,
});
}
fn reloc_constant(
&mut self,
_code_offset: binemit::CodeOffset,
_reloc: binemit::Reloc,
_constant_offset: ir::ConstantOffset,
) {
// Do nothing for now: cranelift emits constant data after the function code and also emits
// function code with correct relative offsets to the constant data.
}
fn reloc_jt(&mut self, offset: binemit::CodeOffset, reloc: binemit::Reloc, jt: ir::JumpTable) {
self.func_relocs.push(Relocation {
reloc,

View File

@@ -330,6 +330,14 @@ impl binemit::RelocSink for RelocSink {
) {
panic!("trampoline compilation should not produce external symbol relocs");
}
fn reloc_constant(
&mut self,
_code_offset: binemit::CodeOffset,
_reloc: binemit::Reloc,
_constant_offset: ir::ConstantOffset,
) {
panic!("trampoline compilation should not produce constant relocs");
}
fn reloc_jt(
&mut self,
_offset: binemit::CodeOffset,