This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

.align 2 ARM gas

I'm wondering about the following: I have some data included in my flash image, ascii bytes terminated by 0. In case the length of the string is even, the adding of the terminating 0

would make the next  .hword start on an odd boundary. So I fill in a .align 2 in any case.

This gives the following picture:

        .hword 0x2da0,0x6f6c ; .byte 105,110,105,116,0; .align 2 @ init
.hword 0x2d98,0x6f68 ; .byte 98,111,111,116,97,112,112,63,0; .align 2 @ bootapp?
.hword 0x2d90,0x6ef8 ; .byte 46,98,97,110,110,101,114,0; .align 2 @ .banner

0000af20  3f 34 34 3b 38 74 07 65  2a 2a 3b 2e 35 35 38 08  |?44;8t.e**;.558.|
0000af30  2e 33 34 33 04 00 00 00  a0 2d 6c 6f 69 6e 69 74  |.343.....-loinit|
0000af40  00 00 00 bf 98 2d 68 6f  62 6f 6f 74 61 70 70 3f  |.....-hobootapp?|
0000af50  00 00 00 bf 90 2d f8 6e  2e 62 61 6e 6e 65 72 00  |.....-.n.banner.|
0000af60  88 2d f0 6e 56 45 52 53  00 00 00 bf 80 2d 8c 6e  |.-.nVERS.....-.n|

You can see that init (even) becomes odd withe the 0 appended. The .align 2 seems to add 3 bytes (!) 00 00 bf. Why doesn't it just fill in 1 byte to land on an even address? BTW, why "bf"?

How can I achieve that not a whole half word is being wasted?