-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
aarch32-symbolic: Setting up an ABI-compatible stack #439
Conversation
cb7b4a4
to
14f3124
Compare
...so that it can also be used by AArch32.
As can be seen in CI, all variants (un/optimized, lazy/eager memory model) of the
Of course, they do so with the completely generic |
Here's the source and the disassembly: // movt.c
// A test case which ensures that the `movt` instruction works as expected.
int __attribute__((noinline)) test_movt(void) {
int ret = 0;
// After the movt instruction, the value of r0 should be 0x10000, which
// should suffice to make the `movne %0 #1` instruction fire and set the
// value of ret (i.e., %0) to 1.
__asm__(
"movw r6, #0x0;"
"movt r6, #0x1;"
"cmp r6, #0x0;"
"movne %0, #1;"
: "=r"(ret) /* Outputs */
: /* Inputs */
: "r6", "r7" /* Clobbered registers */
);
return ret;
}
void _start() {
test_movt();
} On
On
For what it's worth, |
A simpler version of this test also fails: int __attribute__((noinline)) test_noop(void) {
__asm__(
"nop;"
: /* Outputs */
: /* Inputs */
: "r6", "r7" /* Clobbered registers */
);
return 0;
}
int main() {
return test_noop();
}
|
e05c322
to
33af281
Compare
@RyanGlScott points out that the generated Macaw CFG has a
|
After fixing an off-by-one error (the stack pointer was initially set to one past the end of the stack, instead of at the end), I now see:
I think what was happening is that the read from |
Fascinating: it appears that CI passes. No idea why I might be getting |
Wild. I don't suppose it's due to your local copy not rebuilding things thoroughly? For what it's worth, the |
Like #433 + #437, but for AArch32. Towards #430. Based on #438. Needs to be integrated into the test suite for validation.