mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-29 21:14:27 +01:00
baremetal: fix heap and stack position in preparation for CLI arguments
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
/* https://cirosantilli.com/linux-kernel-module-cheat#baremetal-linker-script */
|
||||
ENTRY(_start)
|
||||
SECTIONS
|
||||
{
|
||||
@@ -10,10 +11,18 @@ SECTIONS
|
||||
}
|
||||
/* gem5 uses the bss as a measure of the kernel size. */
|
||||
.bss : { *(.bss) }
|
||||
heap_low = .;
|
||||
/* Fix the addresses of everything that comes after, no matter
|
||||
* the exact size of the code present in .text. This allows us to
|
||||
* place CLI arguments in memory at a known location! */
|
||||
. = ADDR(.text) + 0x1000000;
|
||||
lkmc_heap_low = .;
|
||||
. = . + 0x1000000;
|
||||
heap_top = .;
|
||||
lkmc_heap_top = .;
|
||||
. = . + 0x1000000;
|
||||
stack_top = .;
|
||||
lkmc_stack_top = .;
|
||||
. = . + 0x1000000;
|
||||
lkmc_argv = .;
|
||||
. = . + 0x4;
|
||||
lkmc_argc = .;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user