debug_loc decoding error with readelf/objdump ?

Christian Bruel christian.bruel@st.com
Tue Aug 31 10:25:00 GMT 2010


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






-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: bad.s
URL: <https://sourceware.org/pipermail/binutils/attachments/20100831/ee06b597/attachment.ksh>


More information about the Binutils mailing list