diff options
author | Wojtek Kosior <kwojtus@protonmail.com> | 2019-10-11 11:59:59 +0200 |
---|---|---|
committer | Wojtek Kosior <kwojtus@protonmail.com> | 2019-10-11 11:59:59 +0200 |
commit | 23e6ba8ef9f9967e0c15c6245fd92cdd5f60fc55 (patch) | |
tree | e7c51792a025b1d9a71eba5aa0a85128515b43d4 /loader_stage2.ld | |
parent | 50814e0cbd58590a7e367b604afa8c06271a273a (diff) | |
download | rpi-MMU-example-23e6ba8ef9f9967e0c15c6245fd92cdd5f60fc55.tar.gz rpi-MMU-example-23e6ba8ef9f9967e0c15c6245fd92cdd5f60fc55.zip |
add initial bootloader work
Diffstat (limited to 'loader_stage2.ld')
-rw-r--r-- | loader_stage2.ld | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/loader_stage2.ld b/loader_stage2.ld new file mode 100644 index 0000000..8f215e9 --- /dev/null +++ b/loader_stage2.ld @@ -0,0 +1,44 @@ +ENTRY(_start) + +SECTIONS +{ + /* stage2 bootloader gets loaded at 0x4000 */ + . = 0x4000; + __start = .; + __text_start = .; + .text : + { + /* have entry point at the beginning */ + KEEP(*(.text.stage2main)) + *(.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 = .; +} |