From 42655dd47b0e8c24d8c747618c3268921e661d09 Mon Sep 17 00:00:00 2001
From: Sergey Fedorov <vital.had@gmail.com>
Date: Tue, 11 Nov 2025 17:23:38 +0800
Subject: [PATCH 03/13] target.cpp: minor tweak re padding

---
 src/trans/target.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/trans/target.cpp b/src/trans/target.cpp
index ff07ecca..840f0946 100644
--- a/src/trans/target.cpp
+++ b/src/trans/target.cpp
@@ -1084,7 +1084,7 @@ namespace {
             // >= 4 and up to 8 use embedding = 4. Skip ZST.
             if(Target_GetCurSpec().m_arch.m_name == "powerpc")
             {
-                if ( e.size > 0 )
+                if ( e.size > 0 && e.field != ~0u )
                 {
                     if( !is_first_field && align >= 4 && align <= 8 )
                     {
@@ -1093,7 +1093,8 @@ namespace {
                 }
             }
 
-            if ( e.size > 0 )
+            // Track first field for all architectures (only actual fields, not padding)
+            if ( e.size > 0 && e.field != ~0u )
             {
                 is_first_field = false;
             }
-- 
2.43.0

