Aligns ARM with x86: initialize bss with a small assembly loop before
inmate_main is invoked. This allows to move it after other sections,
effectively removing it from the image file.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
* Jailhouse, a Linux-based partitioning hypervisor
*
* Copyright (c) ARM Limited, 2014
+ * Copyright (c) Siemens AG, 2016
*
* Authors:
* Jean-Philippe Brucker <jean-philippe.brucker@arm.com>
+ * Jan Kiszka <jan.kiszka@siemens.com>
*
* This work is licensed under the terms of the GNU GPL, version 2. See
* the COPYING file in the top-level directory.
ldr r0, =vectors
mcr p15, 0, r0, c12, c0, 0 @ VBAR
+ mov r0, #0
+ ldr r1, =bss_start
+ ldr r2, =bss_dwords
+1: str r0, [r1]
+ add r1, #4
+ subs r2, #1
+ bne 1b
+
ldr sp, =stack_top
b inmate_main
* Jailhouse, a Linux-based partitioning hypervisor
*
* Copyright (c) ARM Limited, 2014
+ * Copyright (c) Siemens AG, 2016
*
* Authors:
* Jean-Philippe Brucker <jean-philippe.brucker@arm.com>
+ * Jan Kiszka <jan.kiszka@siemens.com>
*
* This work is licensed under the terms of the GNU GPL, version 2. See
* the COPYING file in the top-level directory.
. = 0;
.boot : { *(.boot) }
- bss_start = .;
- .bss : {
- *(.bss)
- }
-
. = ALIGN(4);
.text : {
*(.text)
*(.data)
}
+ .bss : {
+ bss_start = .;
+ *(.bss)
+ . = ALIGN(4);
+ }
+ bss_dwords = SIZEOF(.bss) / 4;
+
. = ALIGN(4096);
. += 0x1000;
stack_top = .;