diff options
| author | 2026-03-14 17:27:37 +0100 | |
|---|---|---|
| committer | 2026-03-14 17:46:54 +0100 | |
| commit | 42ce457bba06bd3607fc04700a919b6c395f22c3 (patch) | |
| tree | 77a3f2230324248055a69a41d12b18471d56fe4f /ir/ir.c | |
| parent | 1f3ebe69478f245f69cd6f77db946226557085d2 (diff) | |
c: static eval refactoring
Explicit node for static symbol (addresses). Should not break with edge
cases like the previous ad-hoc approach. And some other bugfixes
Diffstat (limited to 'ir/ir.c')
| -rw-r--r-- | ir/ir.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -159,10 +159,12 @@ mksymref(internstr s, enum symflags symflags) } union ref -mkdatref(internstr name, union type ctype, uint siz, uint align, const void *bytes, uint n, bool deref) +mkdatref(internstr name, union type ctype, uint siz, uint align, + const void *bytes, uint n, bool deref, bool funclocal) { - struct irdat dat = { .ctype = ctype, .align = align, .siz = siz, .name = name }; - dat.section = objout.code && align >= 4 && align <= targ_primsizes[TYPTR] && siz <= 16 ? Stext : Srodata; + struct irdat dat = { .ctype = ctype, .align = align, .siz = siz, .name = name, .section = Srodata }; + if (funclocal && objout.code && align >= 4 && align <= targ_primsizes[TYPTR] && siz <= 16) + dat.section = Stext; assert(n <= siz && siz && align); if (!name) { |