Skip to content

Commit

Permalink
Fixes incorrect target_pc calculation. (#178)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lichtso authored May 28, 2021
1 parent 494145f commit 97e6a55
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/elf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,7 @@ impl<'a, E: UserDefinedError, I: InstructionMeter> EBpfElf<E, I> {
{
return Err(ElfError::OutOfBounds);
}
let target_pc = symbol.st_value as usize / ebpf::INSN_SIZE - ebpf::ELF_INSN_DUMP_OFFSET;
let target_pc = (symbol.st_value - text_section.sh_addr) as usize / ebpf::INSN_SIZE;
let name = elf
.strtab
.get(symbol.st_name)
Expand Down

0 comments on commit 97e6a55

Please sign in to comment.