This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
objdump reporting incorrect packed struct sizes for arm?
- From: Jeff Baker <jbaker at qnx dot com>
- To: "'binutils at sources dot redhat dot com'" <binutils at sources dot redhat dot com>
- Date: Wed, 23 Jul 2003 15:11:03 -0400
- Subject: objdump reporting incorrect packed struct sizes for arm?
I've seen this behaviour in 2.10.1, 2.12.1 and the current HEAD for the
binutils. I'm hoping that someone can confirm it on something other than
NTO and tell me whether or not it's a bug.
If I compile the following code for x86, MIPS, ppc or sh objdump reports the
symbol for the struct as:
00000005 O *COM* 00000001 five
For arm I get:
00000008 O *COM* 00000008 five
When the program is compiled and executed on arm it prints the expected
value of 5, so I know the struct is actually being packed. It would appear
that objdump is just reporting it wrong.
#pragma pack(1)
struct five {
unsigned char a;
unsigned b;
};
struct five five;
int main(void) {
printf("%d\n", sizeof(five));
return 0;
}