This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH][GOLD] Make string offset assignment independent of implementation of unordered map elements order.
- From: Ian Lance Taylor <iant at google dot com>
- To: Doug Kwan (éæå) <dougkwan at google dot com>
- Cc: binutils <binutils at sourceware dot org>
- Date: Sun, 14 Mar 2010 20:33:29 -0700
- Subject: Re: [PATCH][GOLD] Make string offset assignment independent of implementation of unordered map elements order.
- References: <498552561003131533p2d33a84dh2a2b30262908524c@mail.gmail.com>
"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