Skip to content

Commit bcd9628

Browse files
ktrzcinxlgirdwood
authored andcommitted
ext_manifest: byt: fix .fw_metadata section alignment
Section of this section should be aligned to EXT_MAN_ALIGN, proper way of doing this with ALIGN() function inside linker script didn't work, because of removing READONLY attribute for this segment, what leads to error in rimage. This solution introduce changes only for platforms, where problem exists, so generic tools like rimage are kept clean of such a hacks. Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
1 parent 0596f5b commit bcd9628

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

src/platform/baytrail/baytrail.x.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,8 @@ SECTIONS
552552

553553
.fw_metadata (COPY) : ALIGN(1024)
554554
{
555-
KEEP (*(.fw_metadata))
555+
KEEP (*(.fw_metadata));
556+
KEEP (*(.fw_metadata.align));
556557
} >fw_metadata_seg :metadata_entries_phdr
557558

558559
.fw_ready : ALIGN(4)

src/platform/baytrail/platform.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,24 @@
3434
#include <ipc/header.h>
3535
#include <ipc/info.h>
3636
#include <kernel/abi.h>
37+
#include <kernel/ext_manifest.h>
3738
#include <config.h>
3839
#include <version.h>
3940
#include <errno.h>
4041
#include <stdbool.h>
4142
#include <stddef.h>
4243
#include <stdint.h>
4344

45+
/*
46+
* following element is created to assure proper section size alignment, besides
47+
* of build tools limitation - removing `READONLY` flag when updated `.` value
48+
* with `ALIGN(.)` in linker script.
49+
*/
50+
const struct {
51+
char elem[0];
52+
} ext_manifest_align_element
53+
__aligned(EXT_MAN_ALIGN) __section(".fw_metadata.align") = {};
54+
4455
static const struct sof_ipc_fw_ready ready
4556
__section(".fw_ready") = {
4657
.hdr = {

0 commit comments

Comments
 (0)