Move the generated IDT stubs to a separate section, .gentext16, so
that they aren't immediately adjacent to a piece of highly mutable
data.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
section .earlybss nobits
section .config write progbits align=4
section .replacestub exec write progbits align=16
+ section .gentextnr exec write nobits align=16
; Use .bss16 for things that doesn't have to be in low memory;
; .earlybss should be used for things that absolutely have
section .earlybss
alignb 8
IDT: resq 256
-IRQStubs: resb 4*256+3*8
-
RealModeSSSP resd 1 ; Real-mode SS:SP
+ section .gentextnr ; Autogenerated 32-bit code
+IRQStubs: resb 4*256+3*8
+
section .text16
%include "callback.inc" ; Real-mode callbacks
__config_len = __config_end - __config_start;
__config_dwords = (__config_len + 3) >> 2;
- . = ALIGN(16);
+ /* Generated and/or copied code */
+
+ . = ALIGN(128); /* Minimum separation from mutable data */
.replacestub : AT (__replacestub_lma) {
__replacestub_start = .;
*(.replacestub)
__replacestub_len = __replacestub_end - __replacestub_start;
__replacestub_dwords = (__replacestub_len + 3) >> 2;
+ . = ALIGN(16);
+ __gentextnr_lma = .;
+ .gentextnr : AT(__gentextnr_lma) {
+ __gentextnr_start = .;
+ *(.gentextnr)
+ __gentextnr_end = .;
+ }
+ __gentextnr_len = __gentextnr_end - __gentextnr_start;
+ __gentextnr_dwords = (__gentextnr_len + 3) >> 2;
+
/* 16-bit stack */
STACK16_BASE = 0x7c00 - STACK16_LEN;