Arm packing

David Milburn dmilburn@redhat.com
Thu Oct 26 11:48:00 GMT 2000


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



More information about the crossgcc mailing list