summaryrefslogtreecommitdiffstats
path: root/sys/boot/i386
diff options
context:
space:
mode:
authoriedowse <iedowse@FreeBSD.org>2004-08-29 00:48:42 +0000
committeriedowse <iedowse@FreeBSD.org>2004-08-29 00:48:42 +0000
commit0d52a8d8ca171566ed4578aaf8dd3343be846472 (patch)
treed04731906dfe0de532e3945f9198eb4997fa6836 /sys/boot/i386
parent95dd728f5ca86b8ad7346a25bb7375eac27169e9 (diff)
downloadFreeBSD-src-0d52a8d8ca171566ed4578aaf8dd3343be846472.zip
FreeBSD-src-0d52a8d8ca171566ed4578aaf8dd3343be846472.tar.gz
Add the loader side of support for preloading ELF relocatable object
format modules, which are currently only used on the amd64 platform. This initial implementation just parses enough of the module to allow it to extract dependencies and load all the bits into the right place in memory, so the kernel must still do the full relocation and linking. The details of the loaded sections are passed to the kernel by supplying a copy of the ELF section header table as module metadata with the MODINFOMD_SHDR tag.
Diffstat (limited to 'sys/boot/i386')
-rw-r--r--sys/boot/i386/libi386/elf32_freebsd.c8
-rw-r--r--sys/boot/i386/libi386/elf64_freebsd.c8
-rw-r--r--sys/boot/i386/loader/conf.c4
3 files changed, 20 insertions, 0 deletions
diff --git a/sys/boot/i386/libi386/elf32_freebsd.c b/sys/boot/i386/libi386/elf32_freebsd.c
index a508201..5d85927 100644
--- a/sys/boot/i386/libi386/elf32_freebsd.c
+++ b/sys/boot/i386/libi386/elf32_freebsd.c
@@ -40,8 +40,10 @@ __FBSDID("$FreeBSD$");
#include "btxv86.h"
static int elf32_exec(struct preloaded_file *amp);
+static int elf32_obj_exec(struct preloaded_file *amp);
struct file_format i386_elf = { elf32_loadfile, elf32_exec };
+struct file_format i386_elf_obj = { elf32_obj_loadfile, elf32_obj_exec };
/*
* There is an a.out kernel and one or more a.out modules loaded.
@@ -74,3 +76,9 @@ elf32_exec(struct preloaded_file *fp)
panic("exec returned");
}
+
+static int
+elf32_obj_exec(struct preloaded_file *fp)
+{
+ return (EFTYPE);
+}
diff --git a/sys/boot/i386/libi386/elf64_freebsd.c b/sys/boot/i386/libi386/elf64_freebsd.c
index 229c259..1a5b0b2 100644
--- a/sys/boot/i386/libi386/elf64_freebsd.c
+++ b/sys/boot/i386/libi386/elf64_freebsd.c
@@ -41,8 +41,10 @@ __FBSDID("$FreeBSD$");
#include "btxv86.h"
static int elf64_exec(struct preloaded_file *amp);
+static int elf64_obj_exec(struct preloaded_file *amp);
struct file_format amd64_elf = { elf64_loadfile, elf64_exec };
+struct file_format amd64_elf_obj = { elf64_obj_loadfile, elf64_obj_exec };
#define PG_V 0x001
#define PG_RW 0x002
@@ -116,3 +118,9 @@ elf64_exec(struct preloaded_file *fp)
panic("exec returned");
}
+
+static int
+elf64_obj_exec(struct preloaded_file *fp)
+{
+ return (EFTYPE);
+}
diff --git a/sys/boot/i386/loader/conf.c b/sys/boot/i386/loader/conf.c
index e312959..1d8bd04 100644
--- a/sys/boot/i386/loader/conf.c
+++ b/sys/boot/i386/loader/conf.c
@@ -83,11 +83,15 @@ struct fs_ops *file_system[] = {
* rather than reading the file go first.
*/
extern struct file_format i386_elf;
+extern struct file_format i386_elf_obj;
extern struct file_format amd64_elf;
+extern struct file_format amd64_elf_obj;
struct file_format *file_formats[] = {
&i386_elf,
+ &i386_elf_obj,
&amd64_elf,
+ &amd64_elf_obj,
NULL
};
OpenPOWER on IntegriCloud