|
|
@ -855,7 +855,7 @@ impl ComputedRelocation {
|
|
|
|
let instructions = &mut program.function.instructions;
|
|
|
|
let instructions = &mut program.function.instructions;
|
|
|
|
let num_instructions = instructions.len();
|
|
|
|
let num_instructions = instructions.len();
|
|
|
|
let ins_index = rel.ins_offset / mem::size_of::<bpf_insn>();
|
|
|
|
let ins_index = rel.ins_offset / mem::size_of::<bpf_insn>();
|
|
|
|
let mut ins =
|
|
|
|
let ins =
|
|
|
|
instructions
|
|
|
|
instructions
|
|
|
|
.get_mut(ins_index)
|
|
|
|
.get_mut(ins_index)
|
|
|
|
.ok_or(RelocationError::InvalidInstructionIndex {
|
|
|
|
.ok_or(RelocationError::InvalidInstructionIndex {
|
|
|
@ -934,7 +934,7 @@ impl ComputedRelocation {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
BPF_LD => {
|
|
|
|
BPF_LD => {
|
|
|
|
ins.imm = target_value as i32;
|
|
|
|
ins.imm = target_value as i32;
|
|
|
|
let mut next_ins = instructions.get_mut(ins_index + 1).ok_or(
|
|
|
|
let next_ins = instructions.get_mut(ins_index + 1).ok_or(
|
|
|
|
RelocationError::InvalidInstructionIndex {
|
|
|
|
RelocationError::InvalidInstructionIndex {
|
|
|
|
index: ins_index + 1,
|
|
|
|
index: ins_index + 1,
|
|
|
|
num_instructions,
|
|
|
|
num_instructions,
|
|
|
|