Bug 472 – zero sized _init_* symtab-objects

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Linux
Creation time
2006-10-31T08:20:00Z
Last change time
2014-02-15T13:21:05Z
Assigned to
bugzilla
Creator
thomas-dloop

Comments

Comment #0 by thomas-dloop — 2006-10-31T08:20:46Z
# struct Hund{ # int a = 1; # long b = 2; # short c = 3; # byte d = 4; # float e = 5; # cfloat f = 6 + 0i; # } # # struct Katze{ # byte g = 89; # } # # struct Maus{ # } dmd -c test.d readelf -s test.o Symbol table '.symtab' contains 20 entries: Num: Value Size Type Bind Vis Ndx Name 13: 00000000 0 OBJECT GLOBAL DEFAULT 6 _init_4test4Hund 14: 00000020 0 OBJECT GLOBAL DEFAULT 6 _init_4test5Katze 15: 00000021 0 OBJECT GLOBAL DEFAULT 6 _init_4test4Maus documentation of Elf32_Sym.st_size (Portable Formats Specification, Version 1.1): > Many symbols have associated sizes. For example, > a data object’s size is the number of bytes contained > in the object. This member holds 0 if the symbol has > no size or an unknown size. _init_* seem to have a known size.
Comment #1 by mk — 2013-11-03T14:45:14Z
Seems fixed in DMD 1.076 and D2.
Comment #2 by andrei — 2013-11-03T14:53:26Z
Thanks for following up on this old bug!