https://sourceware.org/bugzilla/show_bug.cgi?id=29451
--- Comment #11 from Mark Wielaard <mark at klomp dot org> ---
(In reply to Jan Beulich from comment #8)
> (In reply to Mark Wielaard from comment #7)
> > > and the symbol size is also 0 in the table:
> > > $ readelf -s crti.o
> > >
> > > Symbol table '.symtab' contains 11 entries:
> > >    Num:    Value          Size Type    Bind   Vis      Ndx Name
> > > ...
> > >      9: 0000000000000000     0 FUNC    GLOBAL HIDDEN     5 _init
> > 
> > So if the size really is zero than high_pc should be one larger than low_pc
> > (if expressed as addr in DWARF < 4) and 1 if expressed as unsigned constant
> > (for DWARF >=4)
> > 
> > Having the addresses equal or high_pc zero does not express the zero sized
> > region.
> 
> Doesn't high_pc being one larger than low_pc express a 1-byte region?

Yes, you are right. Technically since high_pc is one past the last address it
describes just a single address (of low_pc).

To describe a DIE without size you should only emit a low_pc attribute and no
high_pc attribute.

According to the DWARF spec a DIE  that has a machine code
address or range of machine code addresses associated has:

• A DW_AT_low_pc attribute for a single address,
• A DW_AT_low_pc and DW_AT_high_pc pair of attributes for a single
contiguous range of addresses, or
• A DW_AT_ranges attribute for a non-contiguous range of addresses.

Where the high_pc expresses the first location past the last instruction
associated with the entity.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Reply via email to