This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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;
}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]