summaryrefslogtreecommitdiff
path: root/lib/csu
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
commit1e709818823f910e24ff49737dfa1d3206ec6d01 (patch)
tree10f5097cbf7554faeb95938027713509a54f246f /lib/csu
parent99dcff54ab48750caee115787252c69f5017030b (diff)
Add an OS note identifying OpenBSD binaries.
This appears to be the standard way to do it.
Diffstat (limited to 'lib/csu')
-rw-r--r--lib/csu/common_elf/crtbegin.c4
-rw-r--r--lib/csu/common_elf/os-note-elf.h20
2 files changed, 23 insertions, 1 deletions
diff --git a/lib/csu/common_elf/crtbegin.c b/lib/csu/common_elf/crtbegin.c
index d18d35a652c..750af70c7b4 100644
--- a/lib/csu/common_elf/crtbegin.c
+++ b/lib/csu/common_elf/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/common_elf/os-note-elf.h b/lib/csu/common_elf/os-note-elf.h
new file mode 100644
index 00000000000..f9bcd9ad6a5
--- /dev/null
+++ b/lib/csu/common_elf/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