From 886278e55f3a7e5ab1ba8e12974cf824778c5995 Mon Sep 17 00:00:00 2001 From: Sandrine Bailleux Date: Thu, 20 Mar 2014 15:51:02 +0000 Subject: [PATCH] Semihosting: Fix file mode to load binaries on Windows Trusted firmware binaries loaded via semihosting used to be opened using 'r' mode (i.e. read mode). This is fine on POSIX conforming systems (including Linux) but for Windows it also means that the file should be opened in text mode. 'rb' mode must be specified instead for binary mode. On POSIX conforming systems, 'rb' mode is equivalent to 'r' mode so it does no harm. Fixes ARM-software/tf-issues#69 Change-Id: Ifa53f2ecfd765f572dea5dd73191f9fe2b2c2011 --- plat/fvp/plat_io_storage.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plat/fvp/plat_io_storage.c b/plat/fvp/plat_io_storage.c index 0f1e3f5c5..3c34f15af 100644 --- a/plat/fvp/plat_io_storage.c +++ b/plat/fvp/plat_io_storage.c @@ -60,22 +60,22 @@ static io_block_spec fip_block_spec = { static io_file_spec bl2_file_spec = { .path = BL2_IMAGE_NAME, - .mode = FOPEN_MODE_R + .mode = FOPEN_MODE_RB }; static io_file_spec bl31_file_spec = { .path = BL31_IMAGE_NAME, - .mode = FOPEN_MODE_R + .mode = FOPEN_MODE_RB }; static io_file_spec bl32_file_spec = { .path = BL32_IMAGE_NAME, - .mode = FOPEN_MODE_R + .mode = FOPEN_MODE_RB }; static io_file_spec bl33_file_spec = { .path = BL33_IMAGE_NAME, - .mode = FOPEN_MODE_R + .mode = FOPEN_MODE_RB }; static int open_fip(void *spec);