Skip to content

Commit 674ffd5

Browse files
committed
fix(linker): add padding section to linker
Signed-off-by: Daniel Oliveira <[email protected]>
1 parent 504bce1 commit 674ffd5

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/linker.ld

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,17 @@ SECTIONS
5656
_ipi_cpumsg_handlers_id_end = .;
5757
}
5858

59-
. = ALIGN(PAGE_SIZE);
59+
.pad_load : {
60+
/**
61+
* This section ensures the loadable portion of the image (_image_load_end) is page-aligned
62+
* by adding padding if necessary. The BYTE(0x00) forces this section to be PROGBITS rather
63+
* than NOBITS, ensuring any padding bytes are actually written to the file.
64+
*/
65+
BYTE(0x00)
66+
FILL(0x00) /* Force at least one byte */
67+
. = ALIGN(PAGE_SIZE);
68+
}
69+
6070
_image_load_end = .;
6171
#ifdef MEM_NON_UNIFIED
6272
/* Save the current location counter (VMA) and switch to LMA for .vm_images */

0 commit comments

Comments
 (0)