[v2,2/2] elf.h: Add declarations for BPF

Message ID 1466463849-21440-3-git-send-email-rth@twiddle.net
State New, archived
Headers

Commit Message

Richard Henderson June 20, 2016, 11:04 p.m. UTC
  The EM_BPF number has been officially assigned, though it
has not yet been posted to the gabi webpage yet.

        * elf/elf.h (EM_BPF): New.
        (EM_NUM): Update.
        (R_BPF_NONE, R_BPF_MAP_FD): New.
---
 ChangeLog | 4 ++++
 elf/elf.h | 8 +++++++-
 2 files changed, 11 insertions(+), 1 deletion(-)
  

Comments

Carlos O'Donell June 28, 2016, 3:57 p.m. UTC | #1
On 06/20/2016 07:04 PM, Richard Henderson wrote:
> The EM_BPF number has been officially assigned, though it
> has not yet been posted to the gabi webpage yet.
> 
>         * elf/elf.h (EM_BPF): New.
>         (EM_NUM): Update.
>         (R_BPF_NONE, R_BPF_MAP_FD): New.

Looks good to me. Thanks for getting an official number :-)
  

Patch

diff --git a/ChangeLog b/ChangeLog
index 14892e6..2abe0b8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@ 
 2016-06-20  Richard Henderson  <rth@redhat.com>
 
+	* elf/elf.h (EM_BPF): New.
+	(EM_NUM): Update.
+	(R_BPF_NONE, R_BPF_MAP_FD): New.
+
 	* elf/elf.h (EM_IAMCU, EM_SPU, EM_PDP10, EM_PDP11, EM_ARC_COMPACT,
 	EM_VIDEOCORE, EM_TMM_GPP, EM_NS32K, EM_TPC, EM_SNP1K, EM_ST200,
 	EM_IP2K, EM_MAX, EM_CR, EM_F2MC16, EM_MSP430, EM_BLACKFIN, EM_SE_C33,
diff --git a/elf/elf.h b/elf/elf.h
index 7fc09b9..b6112d9 100644
--- a/elf/elf.h
+++ b/elf/elf.h
@@ -359,7 +359,9 @@  typedef struct
 				/* reserved 225-242 */
 #define EM_RISCV	243	/* RISC-V */
 
-#define EM_NUM		244
+#define EM_BPF		247	/* Linux BPF -- in-kernel virtual machine */
+
+#define EM_NUM		248
 
 /* Old spellings/synonyms.  */
 
@@ -3675,6 +3677,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