Ov3rM1nd wrote:
> Hi,
>
> Is there a way to specify attributes of variables? Like in gcc, example:
>
> typedef struct __attribute__((aligned(2), packed))
> {
>     MAC_ADDR        DestMACAddr;
>     MAC_ADDR        SourceMACAddr;
>     WORD_VAL        Type;
> } ETHER_HEADER;
>
> We would have a structure 2 bytes aligned and packed.
Did you find an answer to this question?  I have pretty much the same 
issue but with an asm file.  I'd like to have a specific structure word 
aligned.

In assembly, you can add .even or .odd as a statement to ensure that the 
instruction counter is placed on an even or odd instruction.  I have the 
following situation though:

In my assembly file, the structure is even aligned but then I link the 
outputted rel file with my c firmware and the structure is no longer 
even aligned due to its placement withing the firmware binary.  If I 
then change the .even to .odd, It works.  Later, after changing the 
firmware, I may have to switch it back to .even.  I can't seem to find a 
way to tell the assembly output to always be even aligned without 
specifying it as an ABS section instead of REL section.  Perhaps using 
an ABS section is the better way to go but I haven't experimented with 
this as much.

-Dennis

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to