Skip to content

Commit 3d1e91a

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

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/linker.ld

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,16 @@ 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 up to the align
64+
*/
65+
BYTE(0x00)
66+
. = ALIGN(PAGE_SIZE);
67+
}
68+
6069
_image_load_end = .;
6170
#ifdef MEM_NON_UNIFIED
6271
/* Save the current location counter (VMA) and switch to LMA for .vm_images */

0 commit comments

Comments
 (0)