Re: [Bluez-devel] Alignment issue

Marcel Holtmann
2004-08-10T23:12:54Z

Hi Daryl,

> I ran into an alignment problem on our ARM platform. It showed up as corrupt
> SDP responses. I traced it back to bt_put_unaligned() in bluetooth.h
>
> The attached patch should fix the problem (it does as far as I can tell).
> The compiler probably thinks both arguments to memcpy() are aligned and so
> makes an optimization which breaks the copy (because the destination is not
> actually aligned). Perhaps this is a compiler bug... I'm using gcc 3.3.3.
> After googling and reading some discussion on the topic it seems that it's
> probably not a compiler bug. I'll leave that for someone else to decide. :)

I am not an expert in this area. I thought that this method of getting
unaligned support was compatible accross the platforms. Looking at the
kernel unaligned for ARM shows me that this is actually more different.
I need verification of that patch with GCC 2.95 and from PowerPC and
SPARC platforms. I would do it by myself for SPARC, but the harddrive of
my Sun machine is dead.

Regards

Marcel

-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.