Returning structs in registers - ARM ABI in GCC

前端 未结 4 737
一整个雨季
一整个雨季 2021-01-13 18:01

In the ARM ABI documentation I come across functions defined like:

__value_in_regs struct bar foo(int a, int b) {
    ...
}

but GCC(4.3

4条回答
  •  不要未来只要你来
    2021-01-13 18:43

    I'm not sure if this will work, but you can try using the pcs function attribute:

    struct bar foo(int a, int b) __attribute__((pcs("aapcs")));
    struct bar foo(int a, int b) {
        ...
    }
    

提交回复
热议问题