aboutsummaryrefslogtreecommitdiff
path: root/arch/riscv/boot/loader.lds.S
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2019-10-28 13:10:42 +0100
committerPaul Walmsley <paul.walmsley@sifive.com>2019-11-17 15:17:39 -0800
commit405fe7aa0dbaa6cb8cfe62771eee67076d30aca1 (patch)
treeff3c0f7b7c06d02cb87a148db3e2a1a3ddf28124 /arch/riscv/boot/loader.lds.S
parent6bd33e1ece528f67646db33bf97406b747dafda0 (diff)
downloadlinux-405fe7aa0dbaa6cb8cfe62771eee67076d30aca1.tar.gz
riscv: provide a flat image loader
This allows just loading the kernel at a pre-set address without qemu going bonkers trying to map the ELF file. Contains a contribution from Aurabindo Jayamohanan to reuse the PAGE_OFFSET definition. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Anup Patel <anup@brainfault.org> [paul.walmsley@sifive.com: fixed checkpatch issue; minor commit message fix] Signed-off-by: Paul Walmsley <paul.walmsley@sifive.com>
Diffstat (limited to 'arch/riscv/boot/loader.lds.S')
-rw-r--r--arch/riscv/boot/loader.lds.S16
1 files changed, 16 insertions, 0 deletions
diff --git a/arch/riscv/boot/loader.lds.S b/arch/riscv/boot/loader.lds.S
new file mode 100644
index 000000000000..47a5003c2e28
--- /dev/null
+++ b/arch/riscv/boot/loader.lds.S
@@ -0,0 +1,16 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+
+#include <asm/page.h>
+
+OUTPUT_ARCH(riscv)
+ENTRY(_start)
+
+SECTIONS
+{
+ . = PAGE_OFFSET;
+
+ .payload : {
+ *(.payload)
+ . = ALIGN(8);
+ }
+}