Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 6 Jul 2001 21:47:59 -0700 (PDT)
From:      Matthew Jacob <mjacob@feral.com>
To:        "David O'Brien" <obrien@NUXI.com>
Cc:        alpha@FreeBSD.ORG
Subject:   this a gcc bug?
Message-ID:  <Pine.BSF.4.21.0107062130090.48822-100000@beppo>

next in thread | raw e-mail | index | archive | help

I'm taking it your our point person for toolchain issues? If not, could you
direct me to....?

I was tracking down unaligned faults in ping...

They come from an unaligned reference in that:

struct sockaddr whereto;
...
	bzero((char *)&whereto, sizeof(struct sockaddr));
	to = (struct sockaddr_in *)&whereto;
...
	       (void)printf("PING %s (%s)", hostname,
                    inet_ntoa(to->sin_addr));

...
pid 528 (ping): unaligned access: va=0x120017ad3 pc=0x120003850 ra=0x12000335c
op=ldl

Why?

Well, in test compiling ping.c I found:

yorp.feral.com > nm /tmp/ping |grep where
0000000120027b0f B whereto

But was it the linker?


No. Assembler output shows:
	...
        .comm   options,4,4
        .comm   rcvd_tbl,128,1
        .comm   whereto,16,1
	...


Say &what&? Here we have a structure (struct sockaddr) that has only
byte required alignment?

Structs, no matter what there contents, have been ALDOUBLE since Portable C
compiler days- or so I thought. Maybe I'm just showing my ignorance/age. Have
I
gone nuts?

-matt




To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-alpha" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0107062130090.48822-100000>