[DTrace-devel] [PATCH 4/7] Add support for R_BPF_INSN_32 relocations

Kris Van Hees kris.van.hees at oracle.com
Thu Jul 27 15:30:14 UTC 2023


Signed-off-by: Kris Van Hees <kris.van.hees at oracle.com>
---
 include/port.h    | 3 +++
 libdtrace/dt_cc.c | 3 ++-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/include/port.h b/include/port.h
index 11215a94..7a89402d 100644
--- a/include/port.h
+++ b/include/port.h
@@ -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
diff --git a/libdtrace/dt_cc.c b/libdtrace/dt_cc.c
index 2293892c..79410139 100644
--- a/libdtrace/dt_cc.c
+++ b/libdtrace/dt_cc.c
@@ -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;
 	}
 }
-- 
2.39.3




More information about the DTrace-devel mailing list