[Issue 19148] Alignment of section does not reflect the maximum alignment of its contents
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Fri Aug 10 00:39:25 UTC 2018
https://issues.dlang.org/show_bug.cgi?id=19148
--- Comment #3 from Yuxuan Shui <yshuiv7 at gmail.com> ---
I found the actual bug in codegen. In elfobj.c data_start(), when a symbol
doesn't have a explicit alignment (Salignment <= 0), the symbol itself is
aligned, but its section's alignment is not updated.
To reproduce:
__gshared real x;
pragma(msg, x.alignof);
Compiling it prints: 16LU, but the .data section of the resulting object file
is only aligned to 8 bytes.
--
More information about the Digitalmars-d-bugs
mailing list