summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/Makefile2
-rw-r--r--include/elf-hints.h9
-rw-r--r--include/elf.h53
-rw-r--r--lib/libc/gen/nlist.c3
-rw-r--r--libexec/rtld-elf/rtld.h3
-rw-r--r--sbin/ldconfig/elfhints.c2
-rw-r--r--sbin/ldconfig/ldconfig.c2
-rw-r--r--sys/boot/i386/boot2/boot2.c2
-rw-r--r--sys/boot/i386/gptboot/gptboot.c2
-rw-r--r--usr.bin/brandelf/brandelf.c3
-rw-r--r--usr.bin/gcore/aoutcore.c2
-rw-r--r--usr.bin/gcore/elfcore.c2
-rw-r--r--usr.bin/gcore/gcore.c2
-rw-r--r--usr.bin/gprof/elf.c7
-rw-r--r--usr.bin/ldd/ldd.c2
-rw-r--r--usr.bin/ldd/sods.c2
-rw-r--r--usr.sbin/crunch/crunchide/exec_elf32.c8
-rw-r--r--usr.sbin/kgzip/elfhdr.h3
-rw-r--r--usr.sbin/kgzip/kgzcmp.c2
19 files changed, 33 insertions, 78 deletions
diff --git a/include/Makefile b/include/Makefile
index a7759c33..56b2618 100644
--- a/include/Makefile
+++ b/include/Makefile
@@ -9,7 +9,7 @@
CLEANFILES= osreldate.h version vers.c
SUBDIR= rpcsvc rpc
FILES= a.out.h ar.h assert.h bitstring.h ctype.h db.h dirent.h disktab.h \
- dlfcn.h elf.h err.h fnmatch.h fstab.h \
+ dlfcn.h elf-hints.h err.h fnmatch.h fstab.h \
fts.h glob.h grp.h strhash.h \
hesiod.h histedit.h ieeefp.h ifaddrs.h iso646.h langinfo.h \
libgen.h limits.h link.h locale.h malloc.h memory.h mpool.h \
diff --git a/include/elf-hints.h b/include/elf-hints.h
index 9633083..e009074 100644
--- a/include/elf-hints.h
+++ b/include/elf-hints.h
@@ -26,11 +26,8 @@
* $FreeBSD$
*/
-#ifndef _ELF_H_
-#define _ELF_H_
-
-#include <sys/types.h>
-#include <machine/elf.h>
+#ifndef _ELF_HINTS_H_
+#define _ELF_HINTS_H_
/*
* Hints file produced by ldconfig.
@@ -50,4 +47,4 @@ struct elfhints_hdr {
#define _PATH_ELF_HINTS "/var/run/ld-elf.so.hints"
-#endif /* !_ELF_H_ */
+#endif /* !_ELF_HINTS_H_ */
diff --git a/include/elf.h b/include/elf.h
deleted file mode 100644
index 9633083..0000000
--- a/include/elf.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*-
- * Copyright (c) 1997 John D. Polstra.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD$
- */
-
-#ifndef _ELF_H_
-#define _ELF_H_
-
-#include <sys/types.h>
-#include <machine/elf.h>
-
-/*
- * Hints file produced by ldconfig.
- */
-struct elfhints_hdr {
- u_int32_t magic; /* Magic number */
- u_int32_t version; /* File version (1) */
- u_int32_t strtab; /* Offset of string table in file */
- u_int32_t strsize; /* Size of string table */
- u_int32_t dirlist; /* Offset of directory list in
- string table */
- u_int32_t dirlistlen; /* strlen(dirlist) */
- u_int32_t spare[26]; /* Room for expansion */
-};
-
-#define ELFHINTS_MAGIC 0x746e6845
-
-#define _PATH_ELF_HINTS "/var/run/ld-elf.so.hints"
-
-#endif /* !_ELF_H_ */
diff --git a/lib/libc/gen/nlist.c b/lib/libc/gen/nlist.c
index ed0fd48..2e35e36 100644
--- a/lib/libc/gen/nlist.c
+++ b/lib/libc/gen/nlist.c
@@ -54,7 +54,8 @@ static char sccsid[] = "@(#)nlist.c 8.1 (Berkeley) 6/4/93";
#define _NLIST_DO_ELF
#ifdef _NLIST_DO_ELF
-#include <elf.h>
+#include <machine/elf.h>
+#include <elf-hints.h>
#endif
int __fdnlist __P((int, struct nlist *));
diff --git a/libexec/rtld-elf/rtld.h b/libexec/rtld-elf/rtld.h
index 68b6c4e..5ac7c12 100644
--- a/libexec/rtld-elf/rtld.h
+++ b/libexec/rtld-elf/rtld.h
@@ -28,11 +28,12 @@
#ifndef RTLD_H /* { */
#define RTLD_H 1
+#include <machine/elf.h>
#include <sys/types.h>
#include <sys/queue.h>
+#include <elf-hints.h>
#include <link.h>
-#include <elf.h>
#include <stddef.h>
#include "rtld_machdep.h"
diff --git a/sbin/ldconfig/elfhints.c b/sbin/ldconfig/elfhints.c
index cda2269..9bdf56e 100644
--- a/sbin/ldconfig/elfhints.c
+++ b/sbin/ldconfig/elfhints.c
@@ -32,7 +32,7 @@
#include <ctype.h>
#include <dirent.h>
-#include <elf.h>
+#include <elf-hints.h>
#include <err.h>
#include <errno.h>
#include <fcntl.h>
diff --git a/sbin/ldconfig/ldconfig.c b/sbin/ldconfig/ldconfig.c
index 5c655b4..00c951d 100644
--- a/sbin/ldconfig/ldconfig.c
+++ b/sbin/ldconfig/ldconfig.c
@@ -40,7 +40,7 @@ static const char rcsid[] =
#include <a.out.h>
#include <ctype.h>
#include <dirent.h>
-#include <elf.h>
+#include <elf-hints.h>
#include <err.h>
#include <errno.h>
#include <fcntl.h>
diff --git a/sys/boot/i386/boot2/boot2.c b/sys/boot/i386/boot2/boot2.c
index 67b9064..ef3f504 100644
--- a/sys/boot/i386/boot2/boot2.c
+++ b/sys/boot/i386/boot2/boot2.c
@@ -23,6 +23,7 @@
#include <sys/disklabel.h>
#include <sys/dirent.h>
#include <machine/bootinfo.h>
+#include <machine/elf.h>
#include <ufs/ffs/fs.h>
#include <ufs/ufs/dinode.h>
@@ -30,7 +31,6 @@
#include <stdarg.h>
#include <a.out.h>
-#include <elf.h>
#include <btxv86.h>
diff --git a/sys/boot/i386/gptboot/gptboot.c b/sys/boot/i386/gptboot/gptboot.c
index 67b9064..ef3f504 100644
--- a/sys/boot/i386/gptboot/gptboot.c
+++ b/sys/boot/i386/gptboot/gptboot.c
@@ -23,6 +23,7 @@
#include <sys/disklabel.h>
#include <sys/dirent.h>
#include <machine/bootinfo.h>
+#include <machine/elf.h>
#include <ufs/ffs/fs.h>
#include <ufs/ufs/dinode.h>
@@ -30,7 +31,6 @@
#include <stdarg.h>
#include <a.out.h>
-#include <elf.h>
#include <btxv86.h>
diff --git a/usr.bin/brandelf/brandelf.c b/usr.bin/brandelf/brandelf.c
index ec591e6..75cc783 100644
--- a/usr.bin/brandelf/brandelf.c
+++ b/usr.bin/brandelf/brandelf.c
@@ -28,7 +28,8 @@
* $FreeBSD$
*/
-#include <elf.h>
+#include <sys/types.h>
+#include <sys/elf_common.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/usr.bin/gcore/aoutcore.c b/usr.bin/gcore/aoutcore.c
index b5f6143..65dd35e 100644
--- a/usr.bin/gcore/aoutcore.c
+++ b/usr.bin/gcore/aoutcore.c
@@ -63,11 +63,11 @@ static const char rcsid[] =
#include <sys/proc.h>
#include <sys/user.h>
#include <sys/sysctl.h>
+#include <machine/elf.h>
#include <machine/vmparam.h>
#include <a.out.h>
-#include <elf.h>
#include <err.h>
#include <fcntl.h>
#include <kvm.h>
diff --git a/usr.bin/gcore/elfcore.c b/usr.bin/gcore/elfcore.c
index 775fd3b..4cb5f0f 100644
--- a/usr.bin/gcore/elfcore.c
+++ b/usr.bin/gcore/elfcore.c
@@ -29,11 +29,11 @@
#include <sys/param.h>
#include <sys/lock.h>
#include <sys/procfs.h>
+#include <machine/elf.h>
#include <vm/vm_param.h>
#include <vm/vm.h>
#include <vm/pmap.h>
#include <vm/vm_map.h>
-#include <elf.h>
#include <err.h>
#include <errno.h>
#include <fcntl.h>
diff --git a/usr.bin/gcore/gcore.c b/usr.bin/gcore/gcore.c
index b5f6143..65dd35e 100644
--- a/usr.bin/gcore/gcore.c
+++ b/usr.bin/gcore/gcore.c
@@ -63,11 +63,11 @@ static const char rcsid[] =
#include <sys/proc.h>
#include <sys/user.h>
#include <sys/sysctl.h>
+#include <machine/elf.h>
#include <machine/vmparam.h>
#include <a.out.h>
-#include <elf.h>
#include <err.h>
#include <fcntl.h>
#include <kvm.h>
diff --git a/usr.bin/gprof/elf.c b/usr.bin/gprof/elf.c
index 359d76e..ed1aeb1 100644
--- a/usr.bin/gprof/elf.c
+++ b/usr.bin/gprof/elf.c
@@ -1,8 +1,13 @@
+#ifndef lint
+static const char rcsid[] =
+ "$FreeBSD$";
+#endif /* not lint */
+
#include <sys/types.h>
#include <sys/mman.h>
#include <sys/stat.h>
+#include <machine/elf.h>
-#include <elf.h>
#include <err.h>
#include <fcntl.h>
#include <string.h>
diff --git a/usr.bin/ldd/ldd.c b/usr.bin/ldd/ldd.c
index cf9ebde..0f82b89 100644
--- a/usr.bin/ldd/ldd.c
+++ b/usr.bin/ldd/ldd.c
@@ -34,8 +34,8 @@ static const char rcsid[] =
#endif /* not lint */
#include <sys/wait.h>
+#include <machine/elf.h>
#include <a.out.h>
-#include <elf.h>
#include <err.h>
#include <fcntl.h>
#include <stdio.h>
diff --git a/usr.bin/ldd/sods.c b/usr.bin/ldd/sods.c
index 6917616..9b150ec 100644
--- a/usr.bin/ldd/sods.c
+++ b/usr.bin/ldd/sods.c
@@ -38,11 +38,11 @@ static const char rcsid[] =
#include <sys/mman.h>
#include <sys/stat.h>
+#include <machine/elf.h>
#define FREEBSD_AOUT
#include <a.out.h>
-#include <elf.h>
#include <link.h>
#include <stab.h>
diff --git a/usr.sbin/crunch/crunchide/exec_elf32.c b/usr.sbin/crunch/crunchide/exec_elf32.c
index 45883f4..0087408 100644
--- a/usr.sbin/crunch/crunchide/exec_elf32.c
+++ b/usr.sbin/crunch/crunchide/exec_elf32.c
@@ -1,5 +1,3 @@
-/* $NetBSD: exec_elf32.c,v 1.4 1997/08/12 06:07:24 mikel Exp $ */
-
/*
* Copyright (c) 1997 Christopher G. Demetriou. All rights reserved.
*
@@ -32,8 +30,12 @@
#include <sys/cdefs.h>
#ifndef lint
+#if 0
__RCSID("$NetBSD: exec_elf32.c,v 1.4 1997/08/12 06:07:24 mikel Exp $");
#endif
+static const char rcsid[] =
+ "$FreeBSD$";
+#endif
#ifndef ELFSIZE
#define ELFSIZE 32
@@ -53,7 +55,7 @@ __RCSID("$NetBSD: exec_elf32.c,v 1.4 1997/08/12 06:07:24 mikel Exp $");
#if (defined(NLIST_ELF32) && (ELFSIZE == 32)) || \
(defined(NLIST_ELF64) && (ELFSIZE == 64))
-#include <elf.h>
+#include <machine/elf.h>
#define CONCAT(x,y) __CONCAT(x,y)
#define ELFNAME(x) CONCAT(elf,CONCAT(ELFSIZE,CONCAT(_,x)))
diff --git a/usr.sbin/kgzip/elfhdr.h b/usr.sbin/kgzip/elfhdr.h
index b14b9f1..f689119 100644
--- a/usr.sbin/kgzip/elfhdr.h
+++ b/usr.sbin/kgzip/elfhdr.h
@@ -26,7 +26,8 @@
* $FreeBSD$
*/
-#include <elf.h>
+#include <sys/types.h>
+#include <machine/elf.h>
#include "kgz.h"
/* Section header indices */
diff --git a/usr.sbin/kgzip/kgzcmp.c b/usr.sbin/kgzip/kgzcmp.c
index 09086ad..b692315 100644
--- a/usr.sbin/kgzip/kgzcmp.c
+++ b/usr.sbin/kgzip/kgzcmp.c
@@ -29,6 +29,7 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/wait.h>
+#include <machine/elf.h>
#include <err.h>
#include <fcntl.h>
@@ -37,7 +38,6 @@
#include <unistd.h>
#include <a.out.h>
-#include <elf.h>
#include "aouthdr.h"
#include "elfhdr.h"
OpenPOWER on IntegriCloud