Blame SOURCES/binutils-2.24-DW_FORM_ref_addr.patch

8101c5
*** ../binutils-2.24.orig/bfd/dwarf2.c	2014-01-28 11:58:02.072737296 +0000
8101c5
--- bfd/dwarf2.c	2014-01-28 11:59:38.575739971 +0000
8101c5
*************** find_abstract_instance_name (struct comp
8101c5
*** 2126,2131 ****
8101c5
--- 2126,2153 ----
8101c5
  	abort ();
8101c5
  
8101c5
        info_ptr = unit->sec_info_ptr + die_ref;
8101c5
+ 
8101c5
+       /* Now find the CU containing this pointer.  */
8101c5
+       if (info_ptr >= unit->info_ptr_unit && info_ptr < unit->end_ptr)
8101c5
+ 	;
8101c5
+       else
8101c5
+ 	{
8101c5
+ 	  /* Check other CUs to see if they contain the abbrev.  */
8101c5
+ 	  struct comp_unit * u;
8101c5
+ 
8101c5
+ 	  for (u = unit->prev_unit; u != NULL; u = u->prev_unit)
8101c5
+ 	    if (info_ptr >= u->info_ptr_unit && info_ptr < u->end_ptr)
8101c5
+ 	      break;
8101c5
+ 
8101c5
+ 	  if (u == NULL)
8101c5
+ 	    for (u = unit->next_unit; u != NULL; u = u->next_unit)
8101c5
+ 	      if (info_ptr >= u->info_ptr_unit && info_ptr < u->end_ptr)
8101c5
+ 		break;
8101c5
+ 
8101c5
+ 	  if (u)
8101c5
+ 	    unit = u;
8101c5
+ 	  /* else FIXME: What do we do now ?  */
8101c5
+ 	}
8101c5
      }
8101c5
    else if (attr_ptr->form == DW_FORM_GNU_ref_alt)
8101c5
      {
8101c5
*************** find_abstract_instance_name (struct comp
8101c5
*** 2137,2142 ****
8101c5
--- 2159,2166 ----
8101c5
  	  bfd_set_error (bfd_error_bad_value);
8101c5
  	  return name;
8101c5
  	}
8101c5
+       /* FIXME: Do we need to locate the correct CU, in a similar
8101c5
+ 	 fashion to the code in the DW_FORM_ref_addr case above ?  */
8101c5
      }
8101c5
    else
8101c5
      info_ptr = unit->info_ptr_unit + die_ref;