From 273f73fc5cc09bf66aefdaa05e8e0ad23c6a0957 Mon Sep 17 00:00:00 2001 From: Liam Girdwood Date: Fri, 30 Mar 2018 14:44:17 +0100 Subject: [PATCH] cnl: core: Add support for xcc xcc has more strict rules than gcc: - Add missing sections to linker scripts - Fix compile warnings - Extend memory enabling timeout to infinite (too small delay for xcc) Signed-off-by: Tomasz Lauda # Conflicts: # src/platform/apollolake/platform.c # src/platform/cannonlake/platform.c --- rimage/manifest.c | 9 ++++++++- rimage/manifest.h | 3 +++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/rimage/manifest.c b/rimage/manifest.c index 243c194fb..f3f856004 100644 --- a/rimage/manifest.c +++ b/rimage/manifest.c @@ -211,11 +211,18 @@ static int man_get_module_manifest(struct image *image, struct module *module, section = &module->section[man_section_idx]; /* load in manifest data */ - ret = fseek(module->fd, section->sh_offset, SEEK_SET); + /* module built using xcc has preceding bytes */ + if (section->sh_size > sizeof(sof_mod)) + ret = fseek(module->fd, + section->sh_offset + XCC_MOD_OFFSET, SEEK_SET); + else + ret = fseek(module->fd, section->sh_offset, SEEK_SET); + if (ret < 0) { fprintf(stderr, "error: can't seek to section %d\n", ret); return ret; } + count = fread(&sof_mod, 1, sizeof(sof_mod), module->fd); if (count != sizeof(sof_mod)) { fprintf(stderr, "error: can't read section %d\n", -errno); diff --git a/rimage/manifest.h b/rimage/manifest.h index ca951321f..8d1d3d2ca 100644 --- a/rimage/manifest.h +++ b/rimage/manifest.h @@ -22,6 +22,9 @@ #define MAN_PAGE_SIZE 4096 +/* start offset for modules built using xcc */ +#define XCC_MOD_OFFSET 0x8 + /* start offset for base FW module */ #define FILE_TEXT_OFFSET 0x8000