This is the mail archive of the
libc-hacker@cygnus.com
mailing list for the glibc project.
Patches for structure packing....
- To: Ulrich Drepper <drepper@cygnus.com>, libc-hacker@cygnus.com
- Subject: Patches for structure packing....
- From: Scott Bambrough <scottb@corelcomputer.com>
- Date: Wed, 14 Apr 1999 16:29:27 -0400
- Organization: Corel Computer Corporation
The following patches force structures to be packed on the ARM. The structures
ether_addr and ether_header in ethernet.h must be packed in order for tcpdump to
function correctly. Actually tcpdump has its own version of these structures
but the principle is the same. Similarly the structure tftphdr must be packed
or tftp and tftpd will not function correctly.
The map structure in ksc5601 has a comment that states it should be packed in
all architechures. This is definitely not the case on the ARM.
1999-04-14 Scott Bambrough <scottb@netwinder.org>
* sysdeps/unix/sysv/linux/arm/net/ethernet.h:
struct ether_addr and struct ether_header must be packed on the ARM.
The default alignment constraints add padding to the end of the structures.
1999-04-14 Scott Bambrough <scottb@netwinder.org>
* inet/arpa/tftp.h:
struct tftphdr must be packed on the ARM. The default alignment constraints
add padding to the end of the structure and between members.
1999-04-14 Scott Bambrough <scottb@netwinder.org>
* iconvdata/ksc5601.h:
struct map should be packed on the ARM. The comment says the structure should
be
packed on all architechures. The default alignment constraints add padding to
the
end of the structure.
Index: ethernet.h
===================================================================
RCS file: /glibc/cvsfiles/libc/sysdeps/unix/sysv/linux/net/ethernet.h,v
retrieving revision 1.1
diff -r1.1 ethernet.h
36c36
< };
---
> } __attribute__((packed));
44c44
< };
---
> } __attribute__((packed));
Index: ksc5601.h
===================================================================
RCS file: /glibc/cvsfiles/libc/iconvdata/ksc5601.h,v
retrieving revision 1.8
diff -r1.8 ksc5601.h
35,36c35,36
< char val[2];
< };
---
> char val[2] __attribute__((packed));
> } __attribute__((packed));
Index: tftp.h
===================================================================
RCS file: /glibc/cvsfiles/libc/inet/arpa/tftp.h,v
retrieving revision 1.4
diff -r1.4 tftp.h
59,61c59,61
< } th_u;
< char th_data[1]; /* data or error string */
< };
---
> } __attribute__ ((packed)) th_u;
> char th_data[1] __attribute__((packed)); /* data or error string */
> } __attribute__ ((packed));