[Ltrace-devel] r68 - ltrace/trunk

Petr Machata pmachata at redhat.com
Fri Nov 24 16:24:51 CET 2006


Ian Wienand wrote:
> +/* stolen from elfutils-0.123 */
> +static unsigned long elf_gnu_hash(const char *name)
> +{
> +	unsigned long h = 5381;
> +	const unsigned char *string = (const unsigned char *)name;
> +	unsigned char c;
> +	for (c = *string; c; c = *++string)
> +		h = h * 33 + c;
> +	return h & 0xffffffff;
> +}

Turns out gcc doesn't like having elf_gnu_hash declared non-static the 
first time, and static later.  Attached patch fixes this by renaming to 
elf_gnu_hash to private_elf_gnu_hash.  The patch also wipes away some 
unused variables at gnu hash traversal.  If there are no objections, 
I'll commit this with following changelog entry:

2006-11-24  Petr Machata  <pmachata at redhat.com>

	* elf.c (elf_gnu_hash): renamed to private_elf_gnu_hash to avoid
	conflicts with non-static version from glibc.
	* elf.c (in_load_libraries): removed unused variables
	bitmask_idxbits and shift.

PM
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ltrace-0.5-gnuhash.patch
Type: text/x-patch
Size: 956 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/ltrace-devel/attachments/20061124/79248810/ltrace-0.5-gnuhash.bin


More information about the Ltrace-devel mailing list