From a66a036a8fe936fb41224a9aa25e3eeda8b28602 Mon Sep 17 00:00:00 2001 From: "Peter A. Bigot" Date: Tue, 16 Jul 2019 14:57:12 -0500 Subject: [PATCH] subsys/cfb: correct font definition macro for linker script This macro provides the required alignment directives to ensure that the font definitions are placed properly for iteration as members of an array object. Closes #17581 Signed-off-by: Peter A. Bigot --- include/display/cfb.h | 3 +-- include/linker/common-rom.ld | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/include/display/cfb.h b/include/display/cfb.h index 9dbf2fb09c3..69eb82827c6 100644 --- a/include/display/cfb.h +++ b/include/display/cfb.h @@ -67,8 +67,7 @@ struct cfb_font { * @param _lc Character mapped to last font element. */ #define FONT_ENTRY_DEFINE(_name, _width, _height, _caps, _data, _fc, _lc) \ - static const struct cfb_font _name \ - __attribute__ ((section(".font_entry."))) __attribute__((used)) = \ + static const Z_STRUCT_SECTION_ITERABLE(cfb_font, _name) = \ { \ .width = _width, \ .height = _height, \ diff --git a/include/linker/common-rom.ld b/include/linker/common-rom.ld index e97a61f113c..71371bba22a 100644 --- a/include/linker/common-rom.ld +++ b/include/linker/common-rom.ld @@ -132,6 +132,6 @@ SECTION_DATA_PROLOGUE(font_entry_sections,,) { __font_entry_start = .; - KEEP(*(SORT_BY_NAME(".font_entry.*"))) + KEEP(*(SORT_BY_NAME("._cfb_font.*"))) __font_entry_end = .; } GROUP_LINK_IN(ROMABLE_REGION)