This is the mail archive of the binutils@sourceware.org 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]

Re: Gnu assembler question for ARM


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 


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