This is the mail archive of the gcc-bugs@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]

[Bug middle-end/192] String literals don't obey -fdata-sections


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=192

--- Comment #13 from Matt Whitlock <gcc at mattwhitlock dot name> ---
(In reply to H.J. Lu from comment #12)
> Would it better to use MD5 checksum on string contents?

MD5 would be slower for not much gain in uniqueness (assuming its output is
truncated to 32 bits). This application doesn't require a cryptographically
strong hash function, as the consequence of a collision is merely that a string
gets included in the binary when maybe it didn't need to be.

Actually, I would favor replacing the very old (1996) Lookup2 hash function
(implemented in libiberty/hashtab.c) with a more modern hash function, such as
MurmurHash3, CityHash, or even Lookup3, all of which are faster than Lookup2.

I would hesitate to use more than 32 bits, as the section names would start
getting rather long.


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