This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Gnu assembler question for ARM
- From: Ciaccia <ciacciax at yahoo dot com>
- To: Dave Korn <dave dot korn at artimi dot com>
- Cc: binutils at sourceware dot org
- Date: Mon, 7 May 2007 00:49:23 -0700 (PDT)
- Subject: Re: Gnu assembler question for ARM
> The compiler alway aligns the members of structs, so you would really need
> to precede each member with alignment directive:
>
> .struct 0
>
> .balign 4
> x: .int 0
>
> .balign 1
> y: .byte 0
>
> .balign 4
> z: .int 0
>
> except if the struct has __attribute__ ((packed)), then there is no padding.
Hi Dave,
Thanks for the help. I see now the analogy between a normal .text section and a .struct one. From what I understand, in both of them is possible to define symbols using directives such as ".int" or ".balign", but the ".struct" does not generate asm output, while ".text" does... right?
Apart from that, I find strange that there is almost no documentation nor examples online. I tried with google (standard search, groups, codesearch) and koders, but I did not find an example on how to use it. I wonder if this feature should not be explained better...
I still have some unresolved questions (for example, how to nicely nest structs, how to sizeof), and an example would really help me. For example, what would be the best (cleaner) way to use vector struct defined as following?
struct point {
int x;
int y;
int z;
};
struct vector {
struct point v0;
struct point v1;
};
Thanks again for your help
Andrea
____________________________________________________________________________________
8:00? 8:25? 8:40? Find a flick in no time
with the Yahoo! Search movie showtime shortcut.
http://tools.search.yahoo.com/shortcuts/#news