Bug 1154803 - Put our sigaction diversion in __sigaction if it exists. r=glandium, a=sledru

This commit is contained in:
travis
2015-04-20 17:15:32 -05:00
parent 0088702fbc
commit 4cff87ebfb

View File

@@ -1112,8 +1112,17 @@ SEGVHandler::FinishInitialization()
*/ */
void *libc = dlopen("libc.so", RTLD_GLOBAL | RTLD_LAZY); void *libc = dlopen("libc.so", RTLD_GLOBAL | RTLD_LAZY);
if (libc) { if (libc) {
/*
* Lollipop bionic only has a small trampoline in sigaction, with the real
* work happening in __sigaction. Divert there instead of sigaction if it exists.
* Bug 1154803
*/
libc_sigaction = reinterpret_cast<sigaction_func>(dlsym(libc, "__sigaction"));
if (!libc_sigaction) {
libc_sigaction = libc_sigaction =
reinterpret_cast<sigaction_func>(dlsym(libc, "sigaction")); reinterpret_cast<sigaction_func>(dlsym(libc, "sigaction"));
}
} else } else
#endif #endif
{ {