This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH]: random global function name
- From: Nathan Sidwell <nathan at codesourcery dot com>
- To: Richard Henderson <rth at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org, Zack Weinberg <zack at codesourcery dot com>
- Date: Wed, 09 Jul 2003 09:46:19 +0100
- Subject: Re: [PATCH]: random global function name
- Organization: Codesourcery LLC
- References: <3F06F3F4.3020600@codesourcery.com> <20030708225503.GB481@redhat.com>
Richard Henderson wrote:
On Sat, Jul 05, 2003 at 04:51:16PM +0100, Nathan Sidwell wrote:
This patch replaces the append_random_chars function with a crc32, and
hence removes a use of clean_symbol_name -- it seems silly to generate
a random string in a complicated manner, and then strip it of bogus chars.
The crc32_string function will be used from elsewhere.
I don't like this at all. We've reduced the amount of
uniqueness from a complete pathname (which is almost
certainly unique within a given project, at least), to
a 32-bit value.
No, we've not done that. The complete pathname is still used.
Old algorithm
clean_symbol (strcat (input_file_name, weak_object_name, random_chars-ala-mkstemp))
new algorithm
strcat (clean_symbol (input_file_name), crc32(weak_object_name), crc32(random))
The weak_object_name is something we're not sure is unique anyway -
if we had a guaranteed unique object name we'd've used it.
nathan
--
Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC
The voices in my head said this was stupid too
nathan@codesourcery.com :: http://www.planetfall.pwp.blueyonder.co.uk