bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug gas/29451] gas-2.39 started adding 0-sized DIEs to functions withou


From: mark at klomp dot org
Subject: [Bug gas/29451] gas-2.39 started adding 0-sized DIEs to functions without .size
Date: Tue, 09 Aug 2022 10:09:32 +0000

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

[Prev in Thread] Current Thread [Next in Thread]