Commit: Add support for attributes using DW_FORM_GNU_strp_alt

Message ID 87v9j869or.fsf@redhat.com
State New
Headers show
Series
  • Commit: Add support for attributes using DW_FORM_GNU_strp_alt
Related show

Commit Message

Alan Modra via Binutils June 30, 2020, 12:05 p.m.
Hi Guys,

  I am applying the patch below to update the DWARF parser's support for
  the DW_AT_comp_dir and DW_AT_dwo_name attributes when they use the
  DW_FORM_GNU_strp_alt form.

Cheers
  Nick

binutils/ChangeLog
2020-06-30  Nick Clifton  <nickc@redhat.com>

	* dwarf.c (read_and_display_attr_value): Support
	DW_FORM_GNU_strp_alt when used with DW_AT_dwo_name and
	DW_AT_comp_dir.

Patch

diff --git a/binutils/dwarf.c b/binutils/dwarf.c
index 34903bcf77..b2dc6fbba7 100644
--- a/binutils/dwarf.c
+++ b/binutils/dwarf.c
@@ -2574,6 +2574,9 @@  read_and_display_attr_value (unsigned long           attribute,
 	      case DW_FORM_strp:
 		add_dwo_name ((const char *) fetch_indirect_string (uvalue));
 		break;
+	      case DW_FORM_GNU_strp_alt:
+		add_dwo_name ((const char *) fetch_alt_indirect_string (uvalue));
+		break;
 	      case DW_FORM_GNU_str_index:
 		add_dwo_name (fetch_indexed_string (uvalue, this_set, offset_size, FALSE));
 		break;
@@ -2595,6 +2598,9 @@  read_and_display_attr_value (unsigned long           attribute,
 	      case DW_FORM_strp:
 		add_dwo_dir ((const char *) fetch_indirect_string (uvalue));
 		break;
+	      case DW_FORM_GNU_strp_alt:
+		add_dwo_dir (fetch_alt_indirect_string (uvalue));
+		break;
 	      case DW_FORM_line_strp:
 		add_dwo_dir ((const char *) fetch_indirect_line_string (uvalue));
 		break;