summaryrefslogtreecommitdiffstats
path: root/sys/boot/common/load_elf.c
diff options
context:
space:
mode:
authorraj <raj@FreeBSD.org>2008-10-14 10:11:14 +0000
committerraj <raj@FreeBSD.org>2008-10-14 10:11:14 +0000
commit745c5c702fbda516ce2ffc4ea5fab4733a300b08 (patch)
tree94686d1eac378d2739cca0ac82d224e003a620c6 /sys/boot/common/load_elf.c
parent556a6465983a877b5787e9b340efce702299dc65 (diff)
downloadFreeBSD-src-745c5c702fbda516ce2ffc4ea5fab4733a300b08.zip
FreeBSD-src-745c5c702fbda516ce2ffc4ea5fab4733a300b08.tar.gz
Initial support of loader(8) for ARM machines running U-Boot.
This uses the common U-Boot support lib (sys/boot/uboot, already used on FreeBSD/powerpc), and assumes the underlying firmware has the modern API for stand-alone apps enabled in the config (CONFIG_API). Only netbooting is supported at the moment. Obtained from: Marvell, Semihalf
Diffstat (limited to 'sys/boot/common/load_elf.c')
-rw-r--r--sys/boot/common/load_elf.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/sys/boot/common/load_elf.c b/sys/boot/common/load_elf.c
index eabc426..35b3f0b 100644
--- a/sys/boot/common/load_elf.c
+++ b/sys/boot/common/load_elf.c
@@ -289,7 +289,16 @@ __elfN(loadimage)(struct preloaded_file *fp, elf_file_t ef, u_int64_t off)
#ifdef ELF_VERBOSE
printf("Converted entry 0x%08x\n", ehdr->e_entry);
#endif
- } else
+ } else
+ off = 0;
+#elif defined(__arm__)
+ if (off & 0xf0000000u) {
+ off = -(off & 0xf0000000u);
+ ehdr->e_entry += off;
+#ifdef ELF_VERBOSE
+ printf("Converted entry 0x%08x\n", ehdr->e_entry);
+#endif
+ } else
off = 0;
#else
off = 0; /* other archs use direct mapped kernels */
OpenPOWER on IntegriCloud