[PATCH 1/3] binutils: Handle DWARF5 DW_FORM_ref_addr and DW_UT_partial.

Nick Clifton nickc@redhat.com
Thu Sep 24 10:23:49 GMT 2020
Hi Mark,

> binutils/ChangeLog:
> 
> 	* dwarf.c (read_and_display_attr_value): Handle DW_FORM_ref_addr
> 	for dwarf_version 5 just as version 3 and 4 (only 2 is different).
> 	(process_debug_info): Allow DW_UT_partial.

Approved - please apply - I do however have one small suggested change:

> -      else if (dwarf_version == 3 || dwarf_version == 4)
> +      else if (dwarf_version == 3 || dwarf_version == 4 || dwarf_version == 5)
>  	SAFE_BYTE_GET_AND_INC (uvalue, data, offset_size, end);
>        else
> -	error (_("Internal error: DWARF version is not 2, 3 or 4.\n"));
> +	error (_("Internal error: DWARF version is not 2, 3, 4 or 5.\n"));

I think that it is safe to say that say that DW_FORM_ref_addr is not going
to change in future versions of the DWARF spec, so it would be easier/simpler
to change the check to be "dwarf_version > 2" and the error message to be
"DW_FORM_ref_addr is not supported in DWARF version 1".

Cheers
  Nick



More information about the Binutils mailing list