summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDale Rahn <drahn@cvs.openbsd.org>2002-12-13 20:45:55 +0000
committerDale Rahn <drahn@cvs.openbsd.org>2002-12-13 20:45:55 +0000
commita2940e4d83b5a5318aa30f8cde74dc9d1d362836 (patch)
tree95409e20b421eee857bc4ec7e7a39dd2b0ae8935
parent6817fdf6d882774efa343619f83e4835d932f081 (diff)
Compare to ELFMAG byte by byte rather than using full fledged function.
Also avoids a gas problem for the moment.
-rw-r--r--libexec/ld.so/library.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libexec/ld.so/library.c b/libexec/ld.so/library.c
index 7045c805586..fd7ebe1c98b 100644
--- a/libexec/ld.so/library.c
+++ b/libexec/ld.so/library.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: library.c,v 1.23 2002/11/17 20:27:20 drahn Exp $ */
+/* $OpenBSD: library.c,v 1.24 2002/12/13 20:45:54 drahn Exp $ */
/*
* Copyright (c) 2002 Dale Rahn
@@ -378,7 +378,8 @@ _dl_tryload_shlib(const char *libname, int type)
_dl_read(libfile, hbuf, sizeof(hbuf));
ehdr = (Elf_Ehdr *)hbuf;
- if (_dl_strncmp(ehdr->e_ident, ELFMAG, SELFMAG) ||
+ if (ehdr->e_ident[0] != ELFMAG0 || ehdr->e_ident[1] != ELFMAG1 ||
+ ehdr->e_ident[2] != ELFMAG2 || ehdr->e_ident[3] != ELFMAG3 ||
ehdr->e_type != ET_DYN || ehdr->e_machine != MACHID) {
_dl_close(libfile);
_dl_errno = DL_NOT_ELF;