[binutils patch] DWARF-5: readelf: .debug_names

Nick Clifton nickc@redhat.com
Mon Jun 12 09:56:00 GMT 2017


Hi Jan,

> thanks for the approval but I cannot check it in yet as it depends on:
> 	[gcc patch] DWARF-5: Define DW_IDX_GNU_static and DW_IDX_GNU_external

OK.

>>> +      printf (_("Version %ld\n"), (long) dwarf_version);
>>> +      if (dwarf_version != 5)
>>
>> Shouldn't this test be for >= 5 ?
> 
> 0..4: Such .debug_names format has never been defined anywhere.
> 5: The supported version.
> 6..65535: Their format may/will change, I do not think readelf should attempt
> 	  decoding future unknown data format.
> 
> It is written similarly as .gdb_index version check is written:
>    /* Prior versions are obsolete, and future versions may not be
>       backwards compatible.  */
>    if (version < 3 || version > 8)
>      {
>        warn (_("Unsupported version %lu.\n"), (unsigned long) version);
>        return 0;
>      }

Fair enough - but please could you add a comment to this effect so that future
readers of the code do wonder about the version check.

Cheers
  Nick




More information about the Binutils mailing list