This is an automated email from the ASF dual-hosted git repository. acassis pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit 899c56c21843338868ad3231e431e6013b053a5d Author: Marco Casaroli <[email protected]> AuthorDate: Mon Sep 28 14:12:44 2026 +0200 binfmt/libnxflat: Fix the style of libnxflat_bind.c. Whitespace only, and older than the change that follows it. nxstyle checks every file a pull request touches in full, and this one had 37 errors: the case labels of the relocation switch sat at the column of its brace, three assignments were one column short, and a declaration had no blank line after it. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Marco Casaroli <[email protected]> --- binfmt/libnxflat/libnxflat_bind.c | 109 +++++++++++++++++++------------------- 1 file changed, 55 insertions(+), 54 deletions(-) diff --git a/binfmt/libnxflat/libnxflat_bind.c b/binfmt/libnxflat/libnxflat_bind.c index 73a75f55b21..990f6f41a20 100644 --- a/binfmt/libnxflat/libnxflat_bind.c +++ b/binfmt/libnxflat/libnxflat_bind.c @@ -110,7 +110,7 @@ static inline int nxflat_bindrel32i(FAR struct nxflat_loadinfo_s *loadinfo, { addr = (FAR uint32_t *)(offset + loadinfo->dspace->region); binfo(" Before: %08" PRIx32 "\n", *addr); - *addr += (uint32_t)(loadinfo->ispace + sizeof(struct nxflat_hdr_s)); + *addr += (uint32_t)(loadinfo->ispace + sizeof(struct nxflat_hdr_s)); binfo(" After: %08" PRIx32 "\n", *addr); return OK; } @@ -151,7 +151,7 @@ static inline int nxflat_bindrel32d(FAR struct nxflat_loadinfo_s *loadinfo, { addr = (FAR uint32_t *)(offset + loadinfo->dspace->region); binfo(" Before: %08" PRIx32 "\n", *addr); - *addr += (uint32_t)(loadinfo->dspace->region); + *addr += (uint32_t)(loadinfo->dspace->region); binfo(" After: %08" PRIx32 "\n", *addr); return OK; } @@ -195,7 +195,7 @@ static inline int nxflat_bindrel32id(FAR struct nxflat_loadinfo_s *loadinfo, addr = (FAR uint32_t *)(offset + loadinfo->dspace->region); binfo(" Before: %08x\n", *addr); - *addr += ((uint32_t)loadinfo->ispace - + *addr += ((uint32_t)loadinfo->ispace - (uint32_t)(loadinfo->dspace->region)); binfo(" After: %08x\n", *addr); @@ -287,61 +287,61 @@ static inline int nxflat_gotrelocs(FAR struct nxflat_loadinfo_s *loadinfo) switch (NXFLAT_RELOC_TYPE(reloc.r_info)) { - /* NXFLAT_RELOC_TYPE_REL32I Meaning: Object file contains a 32-bit - * offset into I-Space at the - * offset. - * Fixup: Add mapped I-Space address - * to the offset. - */ - - case NXFLAT_RELOC_TYPE_REL32I: - { - result = nxflat_bindrel32i(loadinfo, - NXFLAT_RELOC_OFFSET(reloc.r_info)); - } - break; - - /* NXFLAT_RELOC_TYPE_REL32D Meaning: Object file contains a 32-bit - * offset into D-Space at the - * offset. - * Fixup: Add allocated D-Space address - * to the offset. - */ - - case NXFLAT_RELOC_TYPE_REL32D: - { - result = nxflat_bindrel32d(loadinfo, - NXFLAT_RELOC_OFFSET(reloc.r_info)); - } - break; - - /* NXFLAT_RELOC_TYPE_REL32ID Meaning: Object file contains a 32-bit - * offset into I-Space at the - * offset that will unfortunately - * be references relative to the - * GOT - * Fixup: Add allocated the mapped - * I-Space address MINUS the - * allocated D-Space address to - * the offset. - */ + /* NXFLAT_RELOC_TYPE_REL32I Meaning: Object file contains a 32-bit + * offset into I-Space at the + * offset. + * Fixup: Add mapped I-Space address + * to the offset. + */ + + case NXFLAT_RELOC_TYPE_REL32I: + { + result = nxflat_bindrel32i(loadinfo, + NXFLAT_RELOC_OFFSET(reloc.r_info)); + } + break; + + /* NXFLAT_RELOC_TYPE_REL32D Meaning: Object file contains a 32-bit + * offset into D-Space at the + * offset. + * Fixup: Add allocated D-Space address + * to the offset. + */ + + case NXFLAT_RELOC_TYPE_REL32D: + { + result = nxflat_bindrel32d(loadinfo, + NXFLAT_RELOC_OFFSET(reloc.r_info)); + } + break; + + /* NXFLAT_RELOC_TYPE_REL32ID Meaning: Object file contains a 32-bit + * offset into I-Space at the + * offset that will + * unfortunately be references + * relative to the GOT + * Fixup: Add allocated the mapped + * I-Space address MINUS the + * allocated D-Space address to + * the offset. + */ #ifdef NXFLAT_RELOC_TYPE_REL32ID - case NXFLAT_RELOC_TYPE_REL32ID: - { - result = nxflat_bindrel32id(loadinfo, - NXFLAT_RELOC_OFFSET(reloc.r_info)); - } - break; + case NXFLAT_RELOC_TYPE_REL32ID: + { + result = nxflat_bindrel32id(loadinfo, + NXFLAT_RELOC_OFFSET(reloc.r_info)); + } + break; #endif - default: - { - berr("ERROR: Unrecognized relocation type: %" PRId32 "\n", - (uint32_t)NXFLAT_RELOC_TYPE(reloc.r_info)); - result = -EINVAL; - } - break; + default: + { + berr("ERROR: Unrecognized relocation type: %" PRId32 "\n", + (uint32_t)NXFLAT_RELOC_TYPE(reloc.r_info)); + result = -EINVAL; + } + break; } /* Check for failures */ @@ -637,6 +637,7 @@ int nxflat_bind(FAR struct nxflat_loadinfo_s *loadinfo, */ int ret = nxflat_bindimports(loadinfo, exports, nexports); + if (ret == OK) { /* Then bind all GOT relocations */
