lib1asmfuncs.asm calls raise unconditionally

Bug #822478 reported by Bernhard Rosenkraenzer
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Linaro GCC
Invalid
Undecided
Unassigned

Bug Description

gcc/configs/arm/lib1funcs.asm, line 1266, calls raise(), even if built with -fno-exceptions -- resulting in

/mnt/user/bero/android-toolchain-androideabi/bin/../lib/gcc/arm-linux-androideabi/4.6.2/armv7-a/libgcc.a(_dvmd_lnx.o): In function `__aeabi_ldiv0':
/mnt/user/bero/toolchain-arm-linux-androideabi/build/gcc-linaro-4.6-2011.07-0/arm-linux-androideabi/armv7-a/libgcc/../../../.././../gcc/gcc-linaro-4.6-2011.07-0/libgcc/../gcc/config/arm/lib1funcs.asm:1266: undefined reference to `raise'
collect2: ld returned 1 exit status

e.g. when linking Android init.

Revision history for this message
Michael Hope (michaelh1) wrote :

__aeabi_ldiv0 is called when a division by zero error occurs. According to the ARM ABI ('Run-time ABI for the ARM® Architecture 2.08'), the implementation may:
 * Return the value passed to them as a parameter.
 * Or, return a fixed value defined by the execution environment (such as 0).
 * Or, raise a signal (often SIGFPE) or throw an exception, and do not return.

The version that comes with libgcc calls the standard C function 'raise' to kill the current process. See:
 http://pubs.opengroup.org/onlinepubs/000095399/functions/raise.html

The Bionic implementation is at:
 bionic/libc/unistd/raise.c

Note that this is unrelated to C++ exceptions. It seems that your C library isn't getting linked in. If you can't use the C library, implement your own version of raise() or __aeabi_ldiv0. The version in libgcc is a weak symbol and will be overriden by your version.

Changed in gcc-linaro:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.