From ef9fc1bced6dbad3b63213dc849741cfbb758916 Mon Sep 17 00:00:00 2001
From: Raymond Toy <toy.raymond@gmail.com>
Date: Fri, 15 Jan 2021 13:59:13 -0800
Subject: [PATCH] Minor tweak to put use the right EI_OSABI value

Previously, the EI_OSABI value was either ELFOSAB_SOLARIS for solaris
or ELFOSABI_FREEBSD for everything else.  Let's update this to include
NetBSD and Linux.  Unlikely we'll ever support other things like
HP-UX, AIX, IRIX, Tru64, etc.

The value currently doesn't seem matter, but it seems nice to get it
right.
---
 src/lisp/elf.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/lisp/elf.c b/src/lisp/elf.c
index 1e8659e5b..52747a8f4 100644
--- a/src/lisp/elf.c
+++ b/src/lisp/elf.c
@@ -132,8 +132,15 @@ write_elf_header(int fd)
     eh.e_ident[EI_VERSION]	= EV_CURRENT;
 #ifdef SOLARIS
     eh.e_ident[EI_OSABI]	= ELFOSABI_SOLARIS;
-#else
+#elif defined(__FREEBSD__)
     eh.e_ident[EI_OSABI]	= ELFOSABI_FREEBSD;
+#elif defined(__NetBSD__)
+    eh.e_ident[EI_OSABI]	= ELFOSABI_NETBSD;
+#elif defined(__linux__)
+    eh.e_ident[EI_OSABI]	= ELFOSABI_LINUX;
+#else
+    /* Default to NONE */
+    eh.e_ident[EI_OSABI]	= ELFOSABI_NONE;
 #endif
 
 #ifdef SOLARIS
-- 
GitLab