public inbox for crossgcc@sourceware.org
 help / color / mirror / Atom feed
* Arm packing
@ 2000-10-26 11:48 David Milburn
  2000-10-26 12:03 ` Philip Blundell
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: David Milburn @ 2000-10-26 11:48 UTC (permalink / raw)
  To: 'crossgcc@sources.redhat.com'; +Cc: 'releng@cygnus.com'

I have recently compiled the dhcp-2.0 package under Linux for both x86 and arm. On the x86 platform, sizeof eh returns 14, and on the arm, sizeof eh returns 16.

struct ether_header{
   u_int8_t ether_dhost[ETHER_ADDR_LEN];
   u_int8_t ether_shost[ETHER_ADDR_LEN];
   u_int16_t ether_type;
};

struct ether_header eh;

For the arm platform, I had to do this:

struct ether_header{
   u_int8_t ether_dhost[ETHER_ADDR_LEN];
   u_int8_t ether_shost[ETHER_ADDR_LEN];
   u_int16_t ether_type;
} __attribute__ ((packed));

Is this a arm compiler (armv4l-unknown-linux-gnu) bug?

When I dumped the contents of the eh structure it was identical in both cases, the problem occurs when dhclient copys sizeof eh to another buffer (get two extra bytes on the arm platform).

Thanks,
David

David M. Milburn
Red Hat Inc.
voice - 256 704 9242
http://www.redhat.com
mailto:dmilburn@redhat.com 





------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 5+ messages in thread
* Re: Arm packing
@ 2000-10-26 12:47 Michael K. Elwood
  0 siblings, 0 replies; 5+ messages in thread
From: Michael K. Elwood @ 2000-10-26 12:47 UTC (permalink / raw)
  To: crossgcc

Stan Katz wrote:
> Robert Floyd [ mailto:robert.floyd@inet.com ] Wrote:
> > Since I really want to write my code in C but I also don't want to
> > recreate the wheel, since there is alot of assembly language
> > functions I
> > could use, how could I write this DoHelloWorld function in C.
> >> Snip
> <<portions deleted>>
> This lets the C compiler handle the assignment of the addresses to the
> registers which are passed as parameters to the asm function. Since the
> compiler seems to concatenate all the asm strings into one long string, I
> use a single asm statement and let it concatenate the strings before
> processing the asm.

Wouldn't it just be easier to modify your asm to properly use the C
calling conventions for your machine?

MKE
-- 
**********************************************************
Michael K. Elwood                     mkelwood@qsicorp.com
QSI Corporation

The fourth(?) Law of Thermodynamics:
     (Work in Theory) <= (Work in Practice)
**********************************************************

------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2000-10-26 12:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-10-26 11:48 Arm packing David Milburn
2000-10-26 12:03 ` Philip Blundell
2000-10-26 12:14 ` Rod Stewart
2000-10-26 12:47 ` David Querbach
2000-10-26 12:47 Michael K. Elwood

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).