This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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]: random global function name


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



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