Bug 21763 – Zeroed static array is not placed in BSS with -g build option

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Windows
Creation time
2021-03-25T00:02:30Z
Last change time
2024-12-13T19:15:27Z
Assigned to
No Owner
Creator
ryuukk_
Moved to GitHub: dmd#19895 →

Comments

Comment #0 by ryuukk.dev — 2021-03-25T00:02:30Z
The following code: ``` __gshared ubyte[0x1000000 - 1] BUFFER = 0; void main() {} ``` When compiled with: dmd -g -m64 Will produce an exe of size: 21_378_560 bytes Without -g, it'll produce an exe of size: 415_744 bytes It only happen on windows, only with DMD, only with that -g option
Comment #1 by ryuukk.dev — 2021-03-25T01:05:01Z
It is also happening with -m32mscoff As discussed in the IRC, it seems to be related to COFF stuff, i'm not knowledgeable enough to dig deeper
Comment #2 by robert.schadek — 2024-12-13T19:15:27Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19895 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB