[PATCH 2/2] ldso: make hashcode handling more generic
Chris Zankel
chris at zankel.net
Mon Jan 13 16:18:29 UTC 2014
Hi,
I was wondering if anyone had a chance to look at these changes again? I
have attached the two patches we propose so we can add support for TLS
descriptors.
It would be great to get an ACK for it (or NACK with maybe some other
suggestions).
Thanks,
-Chris
On 11/7/13, 1:52 PM, Chris Zankel wrote:
> Hi Rich,
>
> Thanks for your feedback.
>
> On 11/6/13, 9:27 PM, Rich Felker wrote:
>> On Wed, Nov 06, 2013 at 11:23:06AM +0200, Baruch Siach wrote:
>>> The hashcode handling code never accesses the underlying structure
>>> 'struct funcdesc_value', but only operates on pointer to pointers,
>>> so we can use void** instead.
>> No you can't. This is an aliasing violation, and a compiler performing
>> LTO would be free to reorder accesses in such a way as to horribly
>> break things. However it appears the code may already contain some
>
> I think the original comment was a bit misleading, and I'm not sure
> how to really word it. However, I fail to see where the aliasing
> violation would be, but admit that I might be missing something.
>
> The hashcode routine handles pointers, and they are never
> dereferenced. My understanding is that void* is guaranteed to hold any
> pointer (in size and alignment) and allows assignment to any other
> pointer (T* <-> void*). In that case, it would be save to have a table
> of pointers (void* table[]) and cast between T* and table[i]. This
> seems to be the essence of that code.
>
>> similar aliasing violations. This should be investigated before any
>> further changes are made.
> Would be great if you could point me to those violations. Note that
> I'm not trying to defend the actual implementation of that code, but
> it is also used that way in glibc, so we should only rewrite or fix if
> and what is necessary.
>
> Thanks,
> -Chris
>
-------------- next part --------------
An embedded message was scrubbed...
From: Baruch Siach <baruch at tkos.co.il>
Subject: [PATCH 2/2] ldso: make hashcode handling more generic
Date: Wed, 6 Nov 2013 11:23:06 +0200
Size: 7975
URL: <http://lists.busybox.net/pipermail/uclibc/attachments/20140113/e6bbfe91/attachment.mht>
-------------- next part --------------
An embedded message was scrubbed...
From: Baruch Siach <baruch at tkos.co.il>
Subject: [PATCH 1/2] ldso: move hashcode handling code to a separate header file
Date: Wed, 6 Nov 2013 11:23:05 +0200
Size: 16690
URL: <http://lists.busybox.net/pipermail/uclibc/attachments/20140113/e6bbfe91/attachment-0001.mht>
More information about the uClibc
mailing list