ICF on PowerPC Bug

Cary Coutant ccoutant@google.com
Wed Apr 2 21:12:00 GMT 2014


> Attached patch to fix the PPC ICF problem by using references to the
> reloc info vectors. Ok to commit?

-      Icf::Sections_reachable_info v =
+      Icf::Sections_reachable_info &v =
         (it_reloc_info_list->second).section_info;
       // Stores the information of the symbol pointed to by the reloc.
-      Icf::Symbol_info s = (it_reloc_info_list->second).symbol_info;
+      Icf::Symbol_info &s = (it_reloc_info_list->second).symbol_info;
       // Stores the addend and the symbol value.
-      Icf::Addend_info a = (it_reloc_info_list->second).addend_info;
+      Icf::Addend_info &a = (it_reloc_info_list->second).addend_info;
       // Stores the offset of the reloc.
-      Icf::Offset_info o = (it_reloc_info_list->second).offset_info;
-      Icf::Reloc_addend_size_info reloc_addend_size_info =
+      Icf::Offset_info &o = (it_reloc_info_list->second).offset_info;
+      Icf::Reloc_addend_size_info &reloc_addend_size_info =
         (it_reloc_info_list->second).reloc_addend_size_info;
       Icf::Sections_reachable_info::iterator it_v = v.begin();
       Icf::Symbol_info::iterator it_s = s.begin();

Except for v and a, I think these can all be const, and their
iterators can be const_iterators. OK with those changes.

Thanks!

-cary



More information about the Binutils mailing list