From 89cfa35bfc4c5bcabdcf31c8e4631e0dddd508c3 Mon Sep 17 00:00:00 2001 From: Sean Anderson Date: Sat, 30 Sep 2023 16:45:46 -0400 Subject: [PATCH] misc: fs_loader: Fix alignment of fs_loader driver DM_DRIVER_GET will redeclare the fs_loader driver without the correct alignment. This causes GCC to use the default section alignment of 32 bytes. This in turn creates a gap in the linker list due to the padding required to achieve the correct alignment, corrupting all further entries. Use DM_DRIVER_REF instead, which doesn't redeclare anything. Fixes: 0998a20cfc6 ("misc: fs_loader: Add function to get the chosen loader") Signed-off-by: Sean Anderson --- drivers/misc/fs_loader.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/misc/fs_loader.c b/drivers/misc/fs_loader.c index ccf5c7a803..1ffc199ba1 100644 --- a/drivers/misc/fs_loader.c +++ b/drivers/misc/fs_loader.c @@ -316,7 +316,7 @@ int get_fs_loader(struct udevice **dev) return ret; /* Just create a new device */ - ret = device_bind(dm_root(), DM_DRIVER_GET(fs_loader), "default-loader", + ret = device_bind(dm_root(), DM_DRIVER_REF(fs_loader), "default-loader", &default_plat, ofnode_null(), dev); if (ret) return ret; -- 2.39.5