aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAyrton Munoz <ayrton@google.com>2022-12-21 12:25:55 -0500
committerAyrton Munoz <ayrton@google.com>2022-12-21 12:25:55 -0500
commit99cff63bbb5778f27da9d0cf5a119d2c08a8a446 (patch)
tree418eb2710ffd90a992b81c4c5d0a842f00ac2269 /include
parent091ac7144f860c13de75f04a2a00faedf38d7d68 (diff)
downloadcommon-99cff63bbb5778f27da9d0cf5a119d2c08a8a446.tar.gz
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
Diffstat (limited to 'include')
-rw-r--r--include/shared/lk/compiler.h2
1 files changed, 1 insertions, 1 deletions
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[]; \