Skip to content

Commit

Permalink
Add support for R_BPF_INSN_32 relocations
Browse files Browse the repository at this point in the history
Signed-off-by: Kris Van Hees <kris.van.hees@oracle.com>
  • Loading branch information
kvanhees committed Jul 27, 2023
1 parent dae1b9e commit 6d246ce
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions include/port.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ int close_range(unsigned int first, unsigned int last, unsigned int flags);
#ifndef R_BPF_64_64
#define R_BPF_64_64 1
#endif
#ifndef R_BPF_INSN_32
#define R_BPF_INSN_32 2
#endif
#ifndef R_BPF_64_32
#define R_BPF_64_32 10
#endif
Expand Down
3 changes: 2 additions & 1 deletion libdtrace/dt_cc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2563,7 +2563,8 @@ dt_link_resolve(dtrace_hdl_t *dtp, dtrace_difo_t *dp)
if (rp->dofr_type == R_BPF_64_64) {
buf[ioff].imm = val & 0xffffffff;
buf[ioff + 1].imm = val >> 32;
} else if (rp->dofr_type == R_BPF_64_32)
} else if (rp->dofr_type == R_BPF_64_32 ||
rp->dofr_type == R_BPF_INSN_32)
buf[ioff].imm = (uint32_t)val;
}
}
Expand Down

0 comments on commit 6d246ce

Please sign in to comment.