Gnu assembler question for ARM

Ciaccia ciacciax@yahoo.com
Sun May 6 22:50:00 GMT 2007


Hi Ian,
Could you please give me some examples on how to use the .struct expression? Online there is not much information, the only useful file I could find was the "struct.s" fine in the gas testsuite.

I tried to convert this C-struct

struct test {
    int x;
    char y;
    int z;
};

to assember with the following:

    .struct 0
x:    .int    0
y:    .byte    0
z:    .int    0

But the offset for the z field is 5 instead of the expected 8. How to fix that? 
I would really be happy to see an example of struct in action...

Thanks again
Andrea

----- Original Message ----
From: Ian Lance Taylor <iant@google.com>
To: Ciaccia <ciacciax@yahoo.com>
Cc: Nick Clifton <nickc@redhat.com>; Paul Brook <paul@codesourcery.com>; binutils@sourceware.org
Sent: Friday, May 4, 2007 5:17:53 PM
Subject: Re: Gnu assembler question for ARM

Ciaccia <ciacciax@yahoo.com> writes:

> @this is pseudocode, it's not expected to work
> #define field1 0
> #define field2 (field1 + 4)
> #define field3 (field2 + 4)

See the .struct pseudo-op in the assembler documentation.

Ian




__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



More information about the Binutils mailing list