vmbase: Support generating a Linux image header
Expose a Rust macro to vmbase clients which they can use as opt-in for a
Linux image header to be prepended to their generated binary.
To test this new feature, add an image header to vmbase_example.
Bug: 355696053
Test: m vmbase_example_bin && llvm-objdump -d out/{...}/vmbase_example
Change-Id: I7964d647fb3a068c37edf1beeceed396e879f5a0
diff --git a/libs/libvmbase/sections.ld b/libs/libvmbase/sections.ld
index 01b7e39..7d464bc 100644
--- a/libs/libvmbase/sections.ld
+++ b/libs/libvmbase/sections.ld
@@ -34,6 +34,8 @@
* as executable-only.
*/
.text : ALIGN(4096) {
+ KEEP(*(.init.head));
+ *(.init.head)
text_begin = .;
*(.init.entry)
*(.init.*)