summaryrefslogtreecommitdiffstats
path: root/sys/boot/common/bootstrap.h
diff options
context:
space:
mode:
authoriedowse <iedowse@FreeBSD.org>2004-08-28 23:03:05 +0000
committeriedowse <iedowse@FreeBSD.org>2004-08-28 23:03:05 +0000
commit95dd728f5ca86b8ad7346a25bb7375eac27169e9 (patch)
treea007fb362198e8ded37c0b9b88dfba7840982665 /sys/boot/common/bootstrap.h
parenta5fd03708571a88d49c5fb9df27bac2ccace8656 (diff)
downloadFreeBSD-src-95dd728f5ca86b8ad7346a25bb7375eac27169e9.zip
FreeBSD-src-95dd728f5ca86b8ad7346a25bb7375eac27169e9.tar.gz
Separate out the ELF relocation code from the ELF loader, and add
better relocation support for the amd64 and i386 platforms. This should not result in any change in functionality, but moves a step towards supporting the relocatable object file modules on amd64. The same hack/trick as load_elf*.c uses is used here to simultaneously support both elf32 and elf64 on amd64 and i386.
Diffstat (limited to 'sys/boot/common/bootstrap.h')
-rw-r--r--sys/boot/common/bootstrap.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/sys/boot/common/bootstrap.h b/sys/boot/common/bootstrap.h
index 21845ce..e79172a 100644
--- a/sys/boot/common/bootstrap.h
+++ b/sys/boot/common/bootstrap.h
@@ -235,7 +235,17 @@ int file_addmodule(struct preloaded_file *fp, char *modname, int version,
/* MI module loaders */
#ifdef __elfN
+/* Relocation types. */
+#define ELF_RELOC_REL 1
+#define ELF_RELOC_RELA 2
+
+struct elf_file;
+typedef Elf_Addr (symaddr_fn)(struct elf_file *ef, Elf_Word symidx);
+
int __elfN(loadfile)(char *filename, u_int64_t dest, struct preloaded_file **result);
+int __elfN(reloc)(struct elf_file *ef, symaddr_fn *symaddr,
+ const void *reldata, int reltype, Elf_Addr relbase,
+ Elf_Addr dataaddr, void *data, size_t len);
#endif
/*
OpenPOWER on IntegriCloud