From mboxrd@z Thu Jan 1 00:00:00 1970 From: Randolph Chung Subject: Re: [parisc-linux] gcc-3.[02] alignment problem Date: Tue, 16 Jul 2002 10:22:55 -0700 Message-ID: <20020716172255.GM8724__22894.3292204805$1416621531$gmane$org@tausq.org> References: <200207161701.g6GH1D03023385@hiauly1.hia.nrc.ca> Reply-To: Randolph Chung Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: parisc-linux@parisc-linux.org, gcc@gcc.gnu.org To: John David Anglin Return-Path: In-Reply-To: <200207161701.g6GH1D03023385@hiauly1.hia.nrc.ca> Errors-To: parisc-linux-admin@lists.parisc-linux.org List-Help: List-Post: List-Subscribe: , List-Id: parisc-linux developers list List-Unsubscribe: , List-Archive: In reference to a message from John David Anglin, dated Jul 16: > > These messages are coming from the assembler (remove "-pipe"). The > > first is from "std %r4,44(%r3)". The offset "44" is not correct for > > a store double. This is probably a problem with pointer arithmetic > > in the source. > > Check the definition of RTA_ALIGNTO in linux/rtnetlink.h. ah, this is not it, but i see what it is now. include/linux/tcp_diag.h defines: struct tcpdiag_sockid { __u16 tcpdiag_sport; __u16 tcpdiag_dport; __u32 tcpdiag_src[4]; __u32 tcpdiag_dst[4]; __u32 tcpdiag_if; __u32 tcpdiag_cookie[2]; #define TCPDIAG_NOCOOKIE (~0U) }; the code goes on to do: *((struct sock **)&r->id.tcpdiag_cookie) = sk; and sk != *((struct sock **)&req->id.tcpdiag_cookie[0])) even tho tcpdiag_cookie looks like it can be 64-bit aligned in the struct, it appears that it isn't.... the "vomit grade hack" alan mentioned in another post is that in our tree, we have: struct tcpdiag_sockid { __u16 tcpdiag_sport; __u16 tcpdiag_dport; __u32 tcpdiag_src[4]; __u32 tcpdiag_dst[4]; __u32 tcpdiag_if; #if defined (__hppa__) && defined (__LP64__) char * parisc_hack_to_align_tcpdiag_cookie; #endif __u32 tcpdiag_cookie[2]; #define TCPDIAG_NOCOOKIE (~0U) }; why is the offset of tcpdiag_cookie[0] 44 and not 40? randolph -- Randolph Chung Debian GNU/Linux Developer, hppa/ia64 ports http://www.tausq.org/