graphitemaster / incbin

Include binary files in C/C++
The Unlicense
941 stars 90 forks source link

we're almost there on ARM: .align pain #15

Closed ahupowerdns closed 8 years ago

ahupowerdns commented 8 years ago

So it turns out.. .align 4 on ARM means 'align on 16 bytes'.

.align 1 means 'align on 2 bytes'. (so 1<<1).

.align 0, which could conceivably do the right thing, means align on 2 bytes, for $reasons.

.balign 1 on GNU AS does the right thing on all platforms, but may be GNU AS specific. Meanwhile, I have found no portable way of saying ".align 0" for reals on ARM. A cursory web search appears to say that you should simply not have an .align statement then.

Everything is terrible. Thoughts welcome on what the best thing to do would be! We need the 'End' token to be aligned flush after the binary object.

graphitemaster commented 8 years ago

Well that's just plain stupid.

graphitemaster commented 8 years ago

The hard one is .align 0

graphitemaster commented 8 years ago

Okay, I think this should work