|
@@ -63,14 +63,19 @@ PECOFF_FILE_ALIGNMENT = 0x200;
|
|
|
#endif
|
|
|
|
|
|
#if defined(CONFIG_DEBUG_ALIGN_RODATA)
|
|
|
-#define ALIGN_DEBUG_RO . = ALIGN(1<<SECTION_SHIFT);
|
|
|
-#define ALIGN_DEBUG_RO_MIN(min) ALIGN_DEBUG_RO
|
|
|
-#elif defined(CONFIG_DEBUG_RODATA)
|
|
|
-#define ALIGN_DEBUG_RO . = ALIGN(1<<PAGE_SHIFT);
|
|
|
-#define ALIGN_DEBUG_RO_MIN(min) ALIGN_DEBUG_RO
|
|
|
+/*
|
|
|
+ * 4 KB granule: 1 level 2 entry
|
|
|
+ * 16 KB granule: 128 level 3 entries, with contiguous bit
|
|
|
+ * 64 KB granule: 32 level 3 entries, with contiguous bit
|
|
|
+ */
|
|
|
+#define SEGMENT_ALIGN SZ_2M
|
|
|
#else
|
|
|
-#define ALIGN_DEBUG_RO
|
|
|
-#define ALIGN_DEBUG_RO_MIN(min) . = ALIGN(min);
|
|
|
+/*
|
|
|
+ * 4 KB granule: 16 level 3 entries, with contiguous bit
|
|
|
+ * 16 KB granule: 4 level 3 entries, without contiguous bit
|
|
|
+ * 64 KB granule: 1 level 3 entry
|
|
|
+ */
|
|
|
+#define SEGMENT_ALIGN SZ_64K
|
|
|
#endif
|
|
|
|
|
|
SECTIONS
|
|
@@ -114,12 +119,12 @@ SECTIONS
|
|
|
*(.got) /* Global offset table */
|
|
|
}
|
|
|
|
|
|
- ALIGN_DEBUG_RO_MIN(PAGE_SIZE)
|
|
|
+ . = ALIGN(SEGMENT_ALIGN);
|
|
|
RO_DATA(PAGE_SIZE) /* everything from this point to */
|
|
|
EXCEPTION_TABLE(8) /* _etext will be marked RO NX */
|
|
|
NOTES
|
|
|
|
|
|
- ALIGN_DEBUG_RO_MIN(PAGE_SIZE)
|
|
|
+ . = ALIGN(SEGMENT_ALIGN);
|
|
|
_etext = .; /* End of text and rodata section */
|
|
|
__init_begin = .;
|
|
|
|
|
@@ -168,7 +173,7 @@ SECTIONS
|
|
|
*(.hash)
|
|
|
}
|
|
|
|
|
|
- . = ALIGN(PAGE_SIZE);
|
|
|
+ . = ALIGN(SEGMENT_ALIGN);
|
|
|
__init_end = .;
|
|
|
|
|
|
_data = .;
|