Как и следовало ожидать, размер 12, смещение 8 и 9
20 #include "stdint.h"
21 struct foo10 {
22 uint32_t i1;
23 uint32_t i2;
24 uint8_t c;
25 uint8_t d;
26 };
27
\ In section .text, align 2, keep-with-next
28 int size()
29 {
30 return sizeof(struct foo10);
\ size: (+1)
\ 0x0 0x200C MOVS R0,#+12
\ 0x2 0x4770 BX LR ;; return
31 };
32
\ In section .text, align 2, keep-with-next
33 uint8_t offs_c(struct foo10 * p)
34 {
35 return p->c;
\ offs_c: (+1)
\ 0x0 0x7A00 LDRB R0,[R0, #+8]
\ 0x2 0x4770 BX LR ;; return
36 };
37
\ In section .text, align 2, keep-with-next
38 uint8_t offs_d(struct foo10 * p)
39 {
40 return p->d;
\ offs_d: (+1)
\ 0x0 0x7A40 LDRB R0,[R0, #+9]
\ 0x2 0x4770 BX LR ;; return
41 };