[Issue 472] New: zero sized _init_* symtab-objects

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Oct 31 06:20:49 PST 2006


http://d.puremagic.com/issues/show_bug.cgi?id=472

           Summary: zero sized _init_* symtab-objects
           Product: D
           Version: 0.170
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: thomas-dloop at kuehne.cn


# 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.


-- 




More information about the Digitalmars-d-bugs mailing list