summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2001-02-03 22:59:14 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2001-02-03 22:59:14 +0000
commitd87d8f7737192030a2af2457478511d445245ed8 (patch)
tree01179dd366612583c89b9a005d0a6672b3ea6242 /lib
parentbcacdefa040b9d0a6c4b088cac83166a42f6d697 (diff)
Add an OS note identifying OpenBSD binaries.
This appears to be the standard way to do it.
Diffstat (limited to 'lib')
-rw-r--r--lib/csu/crtbegin.c4
-rw-r--r--lib/csu/os-note-elf.h20
2 files changed, 23 insertions, 1 deletions
diff --git a/lib/csu/crtbegin.c b/lib/csu/crtbegin.c
index d18d35a652c..750af70c7b4 100644
--- a/lib/csu/crtbegin.c
+++ b/lib/csu/crtbegin.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: crtbegin.c,v 1.2 2001/02/03 22:51:31 art Exp $ */
+/* $OpenBSD: crtbegin.c,v 1.3 2001/02/03 22:59:13 art Exp $ */
/* $NetBSD: crtbegin.c,v 1.1 1996/09/12 16:59:03 cgd Exp $ */
/*
@@ -41,6 +41,8 @@
*/
#include <stdlib.h>
+#include "os-note-elf.h"
+
static void (*__CTOR_LIST__[1]) __P((void))
__attribute__((section(".ctors"))) = { (void *)-1 }; /* XXX */
static void (*__DTOR_LIST__[1]) __P((void))
diff --git a/lib/csu/os-note-elf.h b/lib/csu/os-note-elf.h
new file mode 100644
index 00000000000..f9bcd9ad6a5
--- /dev/null
+++ b/lib/csu/os-note-elf.h
@@ -0,0 +1,20 @@
+/*
+ * Contents:
+ *
+ * long Name length
+ * long Description length
+ * long ELF_NOTE_TYPE_OSVERSION (1) XXX - need a define.
+ * "OpenBSD\0"
+ * version? 0 XXX
+ */
+
+__asm(" .section \".note.openbsd.ident\", \"a\"
+ .p2align 2
+
+ .long 8
+ .long 4
+ .long 1
+ .ascii \"OpenBSD\\0\"
+ .long 0
+
+ .p2align 2"); \ No newline at end of file