This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

debug_loc decoding error with readelf/objdump ?


Hello,

When using a DWARF2 debug_loc entry, with 2 relative addresses at 0 and with a 0 size, I get a strange "There is a hole" warning message, and the entries are not decoded (subsequent ones are corrupted).

for instance, using the attached reduced case from a more complex GCC generated DWARF2 : with

as bad.s -o bad.o && objdump --dwarf=loc bad.o

I get:
------------------------------------------
Contents of the .debug_loc section:

    Offset   Begin    End      Expression
    00000000 <End of list>
objdump: Warning: There is a hole [0x8 - 0x13] in .debug_loc section.
    00000013 <End of list>
-------------------------------------------

Note that the entry is not dumped, I expected to get:

--------------------------------------------
Contents of the .debug_loc section:

    Offset   Begin    End      Expression
    00000000 00000000 00000000 (DW_OP_reg4) (start == end)
    00000000 <End of list>
---------------------------------------------

Reading the DWARF2 specifications, in chapter 7.7.2 on locations lists, I don't see anything that prevents my example to be valid.

Both readelf, dwarfdump report the same warning, but dwarfdump seems to be OK with it.

Could this be a bug with readelf and dwarfdump ? Or did I miss something from the standard ? (and so would indicate a bug in GCC) ?

many thanks.

Christian






Attachment: bad.s
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]