[PATCH 30/38] Allow relocation on BPF_OR instructions

eugene.loh
2024-06-27T05:39:33Z

From: Eugene Loh <eugene.loh@oracle.com>

Signed-off-by: Eugene Loh <eugene.loh@oracle.com>
---
libdtrace/dt_as.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/libdtrace/dt_as.c b/libdtrace/dt_as.c
index a634b855..4b397f51 100644
--- a/libdtrace/dt_as.c
+++ b/libdtrace/dt_as.c
@@ -280,6 +280,7 @@ dt_as(dt_pcb_t *pcb)
case BPF_ST | BPF_MEM | BPF_DW: /* stdw */
case BPF_ALU64 | BPF_MOV | BPF_K: /* mov */
case BPF_ALU64 | BPF_ADD | BPF_K: /* add */
+ case BPF_ALU64 | BPF_OR | BPF_K: /* or */
if (idp->di_flags & DT_IDFLG_BPF)
brel++;
else
@@ -492,6 +493,7 @@ fail:
case BPF_ST | BPF_MEM | BPF_DW: /* stdw */
case BPF_ALU64 | BPF_MOV | BPF_K: /* mov */
case BPF_ALU64 | BPF_ADD | BPF_K: /* add */
+ case BPF_ALU64 | BPF_OR | BPF_K: /* or */
rp->dofr_type = R_BPF_64_32;
break;
case BPF_LD | BPF_IMM | BPF_DW: /* lddw */
--
2.18.4