public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* objdump reporting incorrect packed struct sizes for arm?
@ 2003-07-23 19:11 Jeff Baker
  0 siblings, 0 replies; only message in thread
From: Jeff Baker @ 2003-07-23 19:11 UTC (permalink / raw)
  To: 'binutils@sources.redhat.com'

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-07-23 19:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-23 19:11 objdump reporting incorrect packed struct sizes for arm? Jeff Baker

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).