[binutils] Add minimal dwz -m support.

Jakub Jelinek jakub at fedoraproject.org
Tue Jun 19 07:50:53 UTC 2012


commit 59f002d13adbbb5cb355e97ab4c64dae3d6f3cb5
Author: Jakub Jelinek <jakub at redhat.com>
Date:   Tue Jun 19 09:50:51 2012 +0200

    Add minimal dwz -m support.

 binutils-2.22.52.0.4-dwz.patch |  119 ++++++++++++++++++++++++++++++++++++++++
 binutils.spec                  |    8 ++-
 2 files changed, 126 insertions(+), 1 deletions(-)
---
diff --git a/binutils-2.22.52.0.4-dwz.patch b/binutils-2.22.52.0.4-dwz.patch
new file mode 100644
index 0000000..171b051
--- /dev/null
+++ b/binutils-2.22.52.0.4-dwz.patch
@@ -0,0 +1,119 @@
+2012-06-08  Jakub Jelinek  <jakub at redhat.com>
+
+	* dwarf.c (read_and_display_attr_value): Handle
+	DW_FORM_GNU_ref_alt and DW_FORM_GNU_strp_alt.
+	(display_debug_macro): Handle DW_MACRO_GNU_define_indirect_alt,
+	DW_MACRO_GNU_undef_indirect_alt and
+	DW_MACRO_GNU_transparent_include_alt.
+
+	* dwarf2.def (DW_FORM_GNU_ref_alt, DW_FORM_GNU_strp_alt): New
+	forms.
+	* dwarf2.h (enum dwarf_macro_record_type): Add
+	DW_MACRO_GNU_define_indirect_alt, DW_MACRO_GNU_undef_indirect_alt
+	and DW_MACRO_GNU_transparent_include_alt.
+
+--- binutils/dwarf.c	17 May 2012 10:00:35 -0000	1.115
++++ binutils/dwarf.c	8 Jun 2012 19:07:33 -0000	1.116
+@@ -1284,6 +1284,8 @@ read_and_display_attr_value (unsigned lo
+ 
+     case DW_FORM_strp:
+     case DW_FORM_sec_offset:
++    case DW_FORM_GNU_ref_alt:
++    case DW_FORM_GNU_strp_alt:
+       uvalue = byte_get (data, offset_size);
+       data += offset_size;
+       break;
+@@ -1349,6 +1351,11 @@ read_and_display_attr_value (unsigned lo
+ 	printf (" <0x%s>", dwarf_vmatoa ("x",uvalue));
+       break;
+ 
++    case DW_FORM_GNU_ref_alt:
++      if (!do_loc)
++	printf (" <alt 0x%s>", dwarf_vmatoa ("x",uvalue));
++      break;
++
+     case DW_FORM_ref1:
+     case DW_FORM_ref2:
+     case DW_FORM_ref4:
+@@ -1458,6 +1465,12 @@ read_and_display_attr_value (unsigned lo
+         }
+       break;
+ 
++    case DW_FORM_GNU_strp_alt:
++      if (!do_loc)
++	printf (_(" (alt indirect string, offset: 0x%s)"),
++		dwarf_vmatoa ("x", uvalue));
++      break;
++
+     case DW_FORM_indirect:
+       /* Handled above.  */
+       break;
+@@ -1796,7 +1809,8 @@ read_and_display_attr_value (unsigned lo
+ 
+     case DW_AT_import:
+       {
+-        if (form == DW_FORM_ref_sig8)
++	if (form == DW_FORM_ref_sig8
++	    || form == DW_FORM_GNU_ref_alt)
+           break;
+ 
+ 	if (form == DW_FORM_ref1
+@@ -3629,6 +3643,31 @@ display_debug_macro (struct dwarf_sectio
+ 		      (unsigned long) offset);
+ 	      break;
+ 
++	    case DW_MACRO_GNU_define_indirect_alt:
++	      lineno = read_leb128 (curr, &bytes_read, 0);
++	      curr += bytes_read;
++	      offset = byte_get (curr, offset_size);
++	      curr += offset_size;
++	      printf (_(" DW_MACRO_GNU_define_indirect_alt - lineno : %d macro offset : 0x%lx\n"),
++		      lineno, (unsigned long) offset);
++	      break;
++
++	    case DW_MACRO_GNU_undef_indirect_alt:
++	      lineno = read_leb128 (curr, &bytes_read, 0);
++	      curr += bytes_read;
++	      offset = byte_get (curr, offset_size);
++	      curr += offset_size;
++	      printf (_(" DW_MACRO_GNU_undef_indirect_alt - lineno : %d macro offset : 0x%lx\n"),
++		      lineno, (unsigned long) offset);
++	      break;
++
++	    case DW_MACRO_GNU_transparent_include_alt:
++	      offset = byte_get (curr, offset_size);
++	      curr += offset_size;
++	      printf (_(" DW_MACRO_GNU_transparent_include_alt - offset : 0x%lx\n"),
++		      (unsigned long) offset);
++	      break;
++
+ 	    default:
+ 	      if (extended_ops == NULL || extended_ops[op] == NULL)
+ 		{
+--- include/dwarf2.def	22 May 2012 18:05:30 -0000	1.4
++++ include/dwarf2.def	8 Jun 2012 19:01:23 -0000	1.5
+@@ -205,6 +205,10 @@ DW_FORM (DW_FORM_ref_sig8, 0x20)
+ /* Extensions for Fission.  See http://gcc.gnu.org/wiki/DebugFission.  */
+ DW_FORM (DW_FORM_GNU_addr_index, 0x1f01)
+ DW_FORM (DW_FORM_GNU_str_index, 0x1f02)
++/* Extensions for DWZ multifile.
++   See http://www.dwarfstd.org/ShowIssue.php?issue=120604.1&type=open .  */
++DW_FORM (DW_FORM_GNU_ref_alt, 0x1f20)
++DW_FORM (DW_FORM_GNU_strp_alt, 0x1f21)
+ DW_END_FORM
+ 
+ DW_FIRST_AT (DW_AT_sibling, 0x01)
+--- include/dwarf2.h	27 Apr 2012 18:03:18 -0000	1.29
++++ include/dwarf2.h	8 Jun 2012 19:01:23 -0000	1.30
+@@ -333,6 +333,11 @@ enum dwarf_macro_record_type
+     DW_MACRO_GNU_define_indirect = 5,
+     DW_MACRO_GNU_undef_indirect = 6,
+     DW_MACRO_GNU_transparent_include = 7,
++    /* Extensions for DWZ multifile.
++       See http://www.dwarfstd.org/ShowIssue.php?issue=120604.1&type=open .  */
++    DW_MACRO_GNU_define_indirect_alt = 8,
++    DW_MACRO_GNU_undef_indirect_alt = 9,
++    DW_MACRO_GNU_transparent_include_alt = 10,
+     DW_MACRO_GNU_lo_user = 0xe0,
+     DW_MACRO_GNU_hi_user = 0xff
+   };
diff --git a/binutils.spec b/binutils.spec
index 5850c02..57e8556 100644
--- a/binutils.spec
+++ b/binutils.spec
@@ -17,7 +17,7 @@
 Summary: A GNU collection of binary utilities
 Name: %{?cross}binutils%{?_with_debug:-debug}
 Version: 2.22.52.0.4
-Release: 1%{?dist}
+Release: 2%{?dist}
 License: GPLv3+
 Group: Development/Tools
 URL: http://sources.redhat.com/binutils
@@ -38,6 +38,8 @@ Patch07: binutils-2.20.51.0.10-sec-merge-emit.patch
 Patch08: binutils-2.22.52.0.1-relro-on-by-default.patch
 # Local patch - export demangle.h with the binutils-devel rpm.
 Patch09: binutils-2.22.52.0.1-export-demangle.h.patch
+# Backport for https://fedoraproject.org/wiki/Features/DwarfCompressor
+Patch10: binutils-2.22.52.0.4-dwz.patch
 
 %define gold_arches %ix86 x86_64
 
@@ -139,6 +141,7 @@ using libelf instead of BFD.
 %patch08 -p0 -b .relro~
 %endif
 %patch09 -p0 -b .export-demangle-h~
+%patch10 -p0 -b .dwz~
 
 # We cannot run autotools as there is an exact requirement of autoconf-2.59.
 
@@ -433,6 +436,9 @@ exit 0
 %endif # %{isnative}
 
 %changelog
+* Tue Jun 19 2012 Jakub Jelinek <jakub at redhat.com> - 2.22.52.0.4-2
+- Add minimal dwz -m support.
+
 * Wed Jun 06 2012 Nick Clifton <nickc at redhat.com> - 2.22.52.0.4-1
 - Rebase on 2.22.52.0.4 release.  (#829027)
 


More information about the scm-commits mailing list