From 99cff63bbb5778f27da9d0cf5a119d2c08a8a446 Mon Sep 17 00:00:00 2001 From: Ayrton Munoz Date: Wed, 21 Dec 2022 12:25:55 -0500 Subject: include/shared: Align symbol size inserted by INCBIN_ALIGNED to 4 bytes This commit ensures the 4 bytes inserted for the symbol size by INCBIN_ALIGNED are always aligned to 4 bytes. This prevents unaligned accesses in the case that the alignment parameter is less than 4. It also simplifies how offsets are computed when using this macro for multiple embedded device tree blobs. Bug: 231151995 Change-Id: I812fe5a87914b7693fe5231e0bec117bb86f434f --- include/shared/lk/compiler.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/shared/lk/compiler.h b/include/shared/lk/compiler.h index f3bcfc83..8f05fc6b 100644 --- a/include/shared/lk/compiler.h +++ b/include/shared/lk/compiler.h @@ -59,7 +59,7 @@ __asm__ (".section " section ", \"a\"; .balign " #align "; .globl "#symname); \ __asm__ (""#symname ":\n.incbin \"" filename "\""); \ __asm__ (".balign 1; "#symname "_end:"); \ - __asm__ (".balign " #align "; .globl "#sizename); \ + __asm__ (".balign 4; .globl "#sizename); \ __asm__ (""#sizename ": .long "#symname "_end - "#symname); \ __asm__ (".previous"); \ extern unsigned char symname[]; \ -- cgit v1.2.3