Re: [PATCH 30/38] Allow relocation on BPF_OR instructions

Kris Van Hees
2024-07-19T21:34:24Z

On Thu, Jun 27, 2024 at 01:38:56AM -0400, eugene.loh@oracle.com wrote:
> From: Eugene Loh <eugene.loh@oracle.com>
>
> Signed-off-by: Eugene Loh <eugene.loh@oracle.com>

Reviewed-by: Kris Van Hees <kris.van.hees@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
>