diff options
author | Wojtek Kosior <kwojtus@protonmail.com> | 2019-10-03 11:00:21 +0200 |
---|---|---|
committer | Wojtek Kosior <kwojtus@protonmail.com> | 2019-10-03 11:00:21 +0200 |
commit | 4e7666742e6089e7f0ff359c42f726acde7e2a0c (patch) | |
tree | 102d0dbf4983a81651d05f0c0ecaa86dc7c0a8e3 /linker.ld | |
parent | 5f5df2cbe593b8d4365b5a20c2ec240746c9d914 (diff) | |
download | rpi-MMU-example-4e7666742e6089e7f0ff359c42f726acde7e2a0c.tar.gz rpi-MMU-example-4e7666742e6089e7f0ff359c42f726acde7e2a0c.zip |
copy-paste broken code from wiki.osdev; fix it; add Makefile
Diffstat (limited to 'linker.ld')
-rw-r--r-- | linker.ld | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/linker.ld b/linker.ld new file mode 100644 index 0000000..7f3ee57 --- /dev/null +++ b/linker.ld @@ -0,0 +1,44 @@ +ENTRY(_start) + +SECTIONS +{ + /* Starts at LOADER_ADDR. */ + . = 0x8000; + /* For AArch64, use . = 0x80000; */ + __start = .; + __text_start = .; + .text : + { + KEEP(*(.text.boot)) + *(.text) + } + . = ALIGN(4096); /* align to page size */ + __text_end = .; + + __rodata_start = .; + .rodata : + { + *(.rodata) + } + . = ALIGN(4096); /* align to page size */ + __rodata_end = .; + + __data_start = .; + .data : + { + *(.data) + } + . = ALIGN(4096); /* align to page size */ + __data_end = .; + + __bss_start = .; + .bss : + { + bss = .; + *(.bss) + } + . = ALIGN(4096); /* align to page size */ + __bss_end = .; + __bss_size = __bss_end - __bss_start; + __end = .; +} |