[LLVMdev] [Compiler-RT] [ARM] Where __aeabi_[il]div0 builtins should be implemented?

Sergey Dmitrouk
Fri, 05 Sep 2014 18:10:01 -0000

Hi,

There are several places in compiler-rt which refer to __aeabi_idiv0.
For example, in lib/builtins/arm/udivsi3.S:

#ifdef __ARM_EABI__
    b __aeabi_idiv0
#else
    JMP(lr)
#endif

At the same time there is no definition of it.  It looks as if it was
done intentionally so that third-party could provide custom handler for
division by zero.

IMHO It's not very consistent and looks odd as all other __aebi_*
functions are provided by compiler-rt.

Did I get it all right or maybe I'm missing something?

libgcc provides both __aeabi_idiv0 and __aeabi_ldiv0 as weak symbols,
any reasons not to do the same in compiler-rt?  Or, to put it
differently, why force external implementation of these functions?

Thanks,
Sergey