Skip to content
Permalink
Browse files

LOG_BACKEND_DEFINE(): use Z_STRUCT_SECTION_ITERABLE()

Replace the open coded section attribute by Z_STRUCT_SECTION_ITERABLE()
to properly align structure instances on 64-bit targets.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
  • Loading branch information...
Nicolas Pitre authored and carlescufi committed Aug 5, 2019
1 parent caa99b7 commit cd4e7893ea4d01b99e3182d1ef07ef870a6b6bea
Showing with 2 additions and 3 deletions.
  1. +1 −1 include/linker/common-rom.ld
  2. +1 −2 include/logging/log_backend.h
@@ -143,7 +143,7 @@
SECTION_DATA_PROLOGUE(log_backends_sections,,)
{
__log_backends_start = .;
KEEP(*(".log_backends"));
KEEP(*("._log_backend.*"));
__log_backends_end = .;
} GROUP_LINK_IN(ROMABLE_REGION)

@@ -78,8 +78,7 @@ extern const struct log_backend __log_backends_end[0];
.active = false, \
.id = 0, \
}; \
static const struct log_backend _name \
__attribute__ ((section(".log_backends"))) __attribute__((used)) = \
static const Z_STRUCT_SECTION_ITERABLE(log_backend, _name) = \
{ \
.api = &_api, \
.cb = &UTIL_CAT(backend_cb_, _name), \

0 comments on commit cd4e789

Please sign in to comment.
You can’t perform that action at this time.