SECTIONS {
- /* Start at virtual address zero */
- . = 0;
-
/* Weak symbols that need zero values if not otherwise defined */
+ saved_pos = .;
.weak 0x0 : {
_weak = .;
*(.weak)
_eweak = .;
}
_assert = ASSERT ( ( _weak == _eweak ), ".weak is non-zero length" );
+ _assert = ASSERT ( ( . == saved_pos ), ".weak altered current position" );
/* Prefix code */
.prefix : {
_ereloc = ( _reloc + __load_stop_reladyn - __load_start_reladyn );
/* Length of initialised data */
- _sbi_filesz = ABSOLUTE ( _ereloc );
+ _sbi_filesz = ( ABSOLUTE ( _ereloc ) - ABSOLUTE ( _prefix ) );
/* Unwanted sections */
/DISCARD/ : {
# -*- makefile -*- : Force emacs to use Makefile mode
+# Set base virtual address to 0xeb000000
+#
+# This is aligned to a 4MB boundary and so allows 4MB megapages to be
+# used to map the iPXE binary. The address pattern is also easily
+# recognisable if leaked to unexpected contexts.
+#
+LDFLAGS += --section-start=.prefix=0xeb000000
+
# Include generic SBI Makefile
#
MAKEDEPS += arch/riscv/Makefile.sbi
# -*- makefile -*- : Force emacs to use Makefile mode
+# Set base virtual address to 0xffffffffeb000000
+#
+# This is aligned to a 2MB boundary and so allows 2MB megapages to be
+# used to map the iPXE binary. The address pattern is also easily
+# recognisable if leaked to unexpected contexts.
+#
+LDFLAGS += --section-start=.prefix=0xffffffffeb000000
+
# Include generic SBI Makefile
#
MAKEDEPS += arch/riscv/Makefile.sbi