Check zero address size.
authorH.J. Lu <hjl.tools@gmail.com>
Sun, 18 Sep 2011 16:50:17 +0000 (16:50 +0000)
committerH.J. Lu <hjl.tools@gmail.com>
Sun, 18 Sep 2011 16:50:17 +0000 (16:50 +0000)
2011-09-18  H.J. Lu  <hongjiu.lu@intel.com>

PR binutils/13196
* dwarf.c (display_debug_aranges): Check zero address size.

binutils/ChangeLog
binutils/dwarf.c

index 144dbffafcc5ad3e82705f22eb673c45efb6e51a..8af899b8d152ad624bb54d466bbfdae3def5bce3 100644 (file)
@@ -1,3 +1,8 @@
+2011-09-18  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR binutils/13196
+       * dwarf.c (display_debug_aranges): Check zero address size.
+
 2011-09-15  H.J. Lu  <hongjiu.lu@intel.com>
 
        PR binutils/13180
index 776f775421b378cdefb38f350cd97880ec93c8e6..1ee0e336c1ab68f30f1def45a7f74bc85014e460 100644 (file)
@@ -4215,6 +4215,13 @@ display_debug_aranges (struct dwarf_section *section,
 
       address_size = arange.ar_pointer_size + arange.ar_segment_size;
 
+      if (address_size == 0)
+       {
+         error (_("Invalid address size in %s section!\n"),
+                section->name);
+         break;
+       }
+
       /* The DWARF spec does not require that the address size be a power
         of two, but we do.  This will have to change if we ever encounter
         an uneven architecture.  */