[PATCH] fixup! scripts: gen-dtb-s: reference OF IMD entries automatically

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



While the reference is just there, so linker garbage collection doesn't
remove it, it's still a reference and it will be relocated.

This means it must be aligned, otherwise we will crash doing an unaligned
access during relocation if device tree size isn't evenly divisible by
pointer length...

Signed-off-by: Ahmad Fatoum <a.fatoum@xxxxxxxxxxxxxx>
---
 scripts/gen-dtb-s | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/scripts/gen-dtb-s b/scripts/gen-dtb-s
index 6a624e0bd5d0..f6fa1525933e 100755
--- a/scripts/gen-dtb-s
+++ b/scripts/gen-dtb-s
@@ -51,6 +51,7 @@ echo ".incbin \"$dtb\""
 echo "__dtb_${name}_end:"
 echo ".global __dtb_${name}_end"
 if [ "$imd" = "y" ]; then
+	echo ".balign ASM_SZPTR"
 	echo "ASM_PTR __barebox_imd_OF_${name}"
 fi
 echo ".balign STRUCT_ALIGNMENT"
@@ -70,6 +71,7 @@ echo ".incbin \"$dtb.z\""
 echo "__dtb_z_${name}_end:"
 echo ".global __dtb_z_${name}_end"
 if [ "$imd" = "y" ]; then
+	echo ".balign ASM_SZPTR"
 	echo "ASM_PTR __barebox_imd_OF_${name}"
 fi
 echo ".balign STRUCT_ALIGNMENT"
-- 
2.39.2





[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux