Skip to content

Latest commit

 

History

History
21 lines (17 loc) · 1.71 KB

AGGREGATES.md

File metadata and controls

21 lines (17 loc) · 1.71 KB

Aggregate layout and global storage

Cinder now parses inline struct and union definitions, computes target LP64 field offsets and tail padding, and retains those offsets in the type model. Struct fields are placed in declaration order with each field's target alignment; unions begin every field at offset zero and take the maximum field size. Layout overflow and incomplete fields are diagnostics.

Field selection and scalar member access lower through typed member addresses. Nested structures, unions, member arrays, and pointers to arrays use target offsets and strides. Aggregate assignment/copy, bitfields, flexible members, aggregate initializer lists, and aggregate ABI classification remain open.

Constant global objects cross the module and object boundary. Integer constant expressions and scalar floating literals enter .data; uninitialized complete objects enter .bss. String-initialized character arrays use writable .data or .rodata according to element qualification, with target-size zero fill. Symbols carry section-relative offsets, binding, and sizes. Scalar reads/writes use declared widths and RIP-relative relocations. Float32 storage uses actual 32-bit representation and SSE conversion at the internal value boundary. The interpreter shares owned global objects across calls; direct accesses and address aliases observe the same byte storage. Local objects use type-derived stack extents and declared-width native loads and stores.

The implementation does not infer layout from host sizeof. The object-section test parses the emitted ELF header and section-name table independently and checks .text, .data, .rodata, .bss, .rela.text, symbol/string tables, and non-executable-stack metadata.