Seems strange. Can you post sample code?
Sure (found a solution in the meantime).
This is the timer callback (a minimal version actually)
int do_sample_on_change(int stime, int param) {
SetHPTimerAfterNow(sdelay, do_sample_on_change_ARM, do_sample_on_change_ARM, 0);
}
Here's the wrapper:
int __attribute__((naked,noinline)) do_sample_on_change_ARM_(int a, int b) {
asm volatile (
#ifndef THUMB_FW
".code 32\n"
"do_sample_on_change_ARM:\n"
"adr r3, dsoc_thumb+1\n"
"bx r3\n"
".code 16\n"
"dsoc_thumb:\n"
#endif
"push {lr}\n"
"bl do_sample_on_change\n"
"pop {pc}\n"
//"b do_sample_on_change\n" // no good, generates unsupported "relocation type 102"
);
// just to calm down the compiler
return 0;
}
do_sample_on_change_ARM_() can't be passed to
SetHPTimerAfterNow(), because it is treated as a Thumb function. I have come up with a workaround that actually works: the
do_sample_on_change_ARM label can be used correctly, probably because it's inside a .code 32 section (
do_sample_on_change_ARM is of course declared as the correct type of function).
The wrapper's Thumb section can't be as simple as a
b <label> instruction because it generates a relocation type that can't be handled by elf2flt.