On Fri, 13 Dec 2013, Niels Möller wrote:
Martin Storsjö martin@martin.st writes:
static const uint16_t t[4] = {1,2,3,4};
?
This seems to output something like this: .section __TEXT,__const
I see. So we need to define a system-dependent RODATA macro in config.m4, expanding to the right directive.
Second problem was .hword, what pseudoop does Apple's assembler use for 16-bit constants? I think current GNU as has a couple of different names for the same thing, so if we can find a name accepted by both assemblers that's nice, otherwise it's another problem which requires a macro in config.m4.
Ah right, I missed this part. Your C code snippet seemed to use .short - the whole relevant part is:
.section __TEXT,__const .align 1 ## @t _t: .short 1 ## 0x1 .short 2 ## 0x2 .short 3 ## 0x3 .short 4 ## 0x4
// Martin