aboutsummaryrefslogtreecommitdiff
path: root/linker.ld
diff options
context:
space:
mode:
authorWojtek Kosior <kwojtus@protonmail.com>2019-12-26 19:02:32 +0100
committerWojtek Kosior <kwojtus@protonmail.com>2019-12-26 19:02:32 +0100
commit4d3cd9bd400b3d07d752d60ce2b3c425a53b72d6 (patch)
tree4b7333d69113fff1137fe1bf805be8905c5b752e /linker.ld
parent9d587f9f750253461314757f2f861c5214563120 (diff)
downloadrpi-MMU-example-4d3cd9bd400b3d07d752d60ce2b3c425a53b72d6.tar.gz
rpi-MMU-example-4d3cd9bd400b3d07d752d60ce2b3c425a53b72d6.zip
improve linking of initial boot code
Diffstat (limited to 'linker.ld')
-rw-r--r--linker.ld14
1 files changed, 5 insertions, 9 deletions
diff --git a/linker.ld b/linker.ld
index 5bdbfd2..a0ad1ae 100644
--- a/linker.ld
+++ b/linker.ld
@@ -1,4 +1,4 @@
-ENTRY(_start) /* defined in boot.S */
+ENTRY(_boot) /* defined in boot.S; qemu needs it to run elf file */
SECTIONS
{
@@ -15,20 +15,16 @@ SECTIONS
. = 0x8000;
- /* For AArch64, use . = 0x80000 */
+ /* RPi in 64-bit mode uses address 0x80000 instead */
__start = .;
- .boot :
- {
- boot.o
- }
- __kernel_start = .;
.kernel :
{
+ __kernel_start = .;
+ KEEP(boot.o)
*(EXCLUDE_FILE (libkernel.o interrupt_vector.o interrupts.o) *)
+ __kernel_end = .;
}
- . = ALIGN(4096); /* align to page size */
- __kernel_end = .;
__kernel_size = __kernel_end - __kernel_start;