This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH] elf: Add declarations for BPF
- From: Richard Henderson <rth at twiddle dot net>
- To: libc-alpha at sourceware dot org
- Cc: hsowa at redhat dot com, mjw at redhat dot com
- Date: Tue, 7 Jun 2016 11:07:59 -0700
- Subject: [PATCH] elf: Add declarations for BPF
- Authentication-results: sourceware.org; auth=none
The e_machine value is provisionary, but will serve for now.
I want to use this value in elfutils and systemtap. I will
also propagate the value to llvm and their bpf backend.
The R_BPF_MAP_FD value is being used by llvm, although they are
using the name R_X86_64_64, which is perhaps less than ideal. ;-)
r~
* elf/elf.h (EM_BPF): New.
(R_BPF_NONE, R_BPF_MAP_FD): New.
---
elf/elf.h | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/elf/elf.h b/elf/elf.h
index ce96bd5..2db03c3 100644
--- a/elf/elf.h
+++ b/elf/elf.h
@@ -261,6 +261,7 @@ typedef struct
chances of collision with official or non-GNU unofficial values. */
#define EM_ALPHA 0x9026
+#define EM_BPF 0xeb9f
/* Legal values for e_version (version). */
@@ -3566,6 +3567,10 @@ enum
#define R_TILEGX_NUM 130
+/* BPF specific declarations. */
+
+#define R_BPF_NONE 0 /* No reloc */
+#define R_BPF_MAP_FD 1 /* Map fd to pointer */
__END_DECLS
--
2.5.5