This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH v4] gold: Fix non-deterministic behaviour of Mips gold.


On Fri, May 20, 2016 at 1:09 AM, Cary Coutant <ccoutant@gmail.com> wrote:
>>     * mips.cc (Mips_got_entry::Mips_got_entry): Remove object argument
>>     for global got symbols, and set addend to 0.
>>     (Mips_got_entry::hash): Change hash algorithm.
>>     (Mips_got_entry::equals): Refactor.
>>     (Mips_got_entry::object): Return input object for local got symbols
>>     from union d.
>>     (Mips_got_entry::addend): Change return of the relocation addend.
>>     (Mips_got_entry::addend_): Move from union d.
>>     (Mips_got_entry::object_): Move into union d.
>>     (class Mips_symbol_hash): New class.
>>     (Mips_got_info::Global_got_entry_set): New type.
>>     (Mips_got_info::global_got_symbols): Change return type to
>>     Global_got_entry_set.
>>     (Mips_got_info::global_got_symbols_): Change type to
>>     Global_got_entry_set.
>>     (Mips_symbol::hash): New method.
>>     (Mips_output_data_la25_stub::symbols_): Change type to std::vector.
>>     (Mips_output_data_mips_stubs::Mips_stubs_entry_set): New type.
>>     (Mips_output_data_mips_stubs::symbols_): Change type to
>>     Mips_stubs_entry_set.
>>     (Mips_got_info::record_global_got_symbol): Don't pass object
>>     argument when creating global got symbol.
>>     (Mips_got_info::record_got_entry): Remove find before inserting
>>     got entries.
>>     (Mips_got_info::add_reloc_only_entries): Change type of iterator
>>     to Global_got_entry_set.
>>     (Mips_got_info::count_got_symbols): Likewise.
>>     (Mips_output_data_la25_stub::create_la25_stub): Use push_back
>>     for adding entries to symbols_.
>>     (Mips_output_data_la25_stub::do_write): Change type of iterator
>>     to std::vector.
>>     (Mips_output_data_mips_stubs::set_lazy_stub_offsets): Change type
>>     of iterator to Mips_stubs_entry_set.
>>     (Mips_output_data_mips_stubs::set_needs_dynsym_value): Likewise.
>>     (Mips_output_data_mips_stubs::do_write): Likewise.
>
> Committed with the suggested change. Revised patch attached.
>
> Thanks, and sorry for the delay!
>
> -cary

Hi,

this patch breaks the gold build for me since not all callers of
Mips_got_info::global_got_symbols() were adjusted to use the new
return type.

I have attached the easiest possible fix.

Thanks,
Artemiy
diff --git a/gold/mips.cc b/gold/mips.cc
index b8c74d0..60c881e 100644
--- a/gold/mips.cc
+++ b/gold/mips.cc
@@ -6142,7 +6142,8 @@ Mips_output_data_got<size, big_endian>::do_write(Output_file* of)
   this->got_view_ = oview;
 
   // Write lazy stub addresses.
-  for (typename Unordered_set<Mips_symbol<size>*>::iterator
+  for (typename Unordered_set<Mips_symbol<size>*,
+                              Mips_symbol_hash<size> >::iterator
        p = this->master_got_info_->global_got_symbols().begin();
        p != this->master_got_info_->global_got_symbols().end();
        ++p)
@@ -6159,7 +6160,8 @@ Mips_output_data_got<size, big_endian>::do_write(Output_file* of)
     }
 
   // Add +1 to GGA_NONE nonzero MIPS16 and microMIPS entries.
-  for (typename Unordered_set<Mips_symbol<size>*>::iterator
+  for (typename Unordered_set<Mips_symbol<size>*,
+                              Mips_symbol_hash<size> >::iterator
        p = this->master_got_info_->global_got_symbols().begin();
        p != this->master_got_info_->global_got_symbols().end();
        ++p)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]