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][GOLD] Make string offset assignment independent of implementation of unordered map elements order.


"Doug Kwan (éæå)" <dougkwan@google.com> writes:

>     Currently Stringpool_template::set_string_offsets transverse an
> unordered map and assign string offsets for unoptimized string pools.
> The ordered of elements in an unordered map depends on many things
> like the version of STL used and the with of size_t.   This leads to
> different outputs generated from the same input.  This patch fixes
> this problem by assigning strings offsets in the order strings are
> inserted into a string pool.    The patch was tested on both x86_64
> Linux and ARM Linux natively.

The stringpool code is pretty time intensive for the linker, so I'm
not thrilled about walking the hash table twice.  When not optimizing,
I think we can actually calculate key_to_offset_ as we add strings to
the table.  That's even better, since we can eliminate the hash table
walk.  How does that sound?

Ian


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